ESLint configuration for my projects
MIT License
ESLint configuration for my projects.
ESLint config Cecilia is an opinionated shareable ESLint config used in my JavaScript projects (Vanilla.js, React.js or Node.js).
npm i -D eslint-config-cecilia
npx cecilia
.eslintrc.js
file.prettierrc.js
filelint
script commands in your package.json
yarn add --dev eslint-config-cecilia
yarn cecilia
.eslintrc.js
file.prettierrc.js
filelint
script commands in your package.json
npm i -D eslint-config-cecilia eslint prettier eslint-config-prettier eslint-plugin-prettier eslint-config-airbnb eslint-plugin-import eslint-plugin-jsdoc eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-unicorn
yarn add --dev eslint-config-cecilia eslint prettier eslint-config-prettier eslint-plugin-prettier eslint-config-airbnb eslint-plugin-import eslint-plugin-jsdoc eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-unicorn
.eslintrc.js
file in your project root directory and use the extends
attribute.Paste this code to extend the ESLint ruleset:
module.exports = {
extends: 'cecilia',
}
Optional - Override Rules
For more information, see "Configuring Rules" in the ESLint Help.
module.exports = {
extends: 'cecilia',
rules: {
//
// rules to override.
//
}
}
Pro tip
Check the list of available rules.
Optional - Specifying Environments
For more information, see "Specifying Environments" in the ESLint Help.
module.exports = {
extends: 'cecilia',
env: {
browser: true,
node: true,
...
},
}
.prettierrc.js
file in your project root directory and change some rules.module.exports = {
semi: false,
singleQuote: true,
trailingComma: 'all',
}
package.json
fileOpen the package.json
file and add the following scripts entries:
...
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --write './**/*.{js,jsx,json}'"
},
...
yarn lint
or npm run lint
to lint your code.
yarn lint:fix
or npm run lint:fix
to lint and fix your code.
yarn format
or npm run format
to format your code.
Pro tip
Install ESLint and Prettier extensions for Visual Studio Code.
Want to contribute? All contributions are welcome. Read the contributing guide.
If you have questions tweet me at @sandro_m_m or open an issue.
This project is licensed under the MIT License - see the LICENSE file for details
This project helped you? Please consider giving this repository a star ⭐.