ESLint (and Prettier, and tsconfig) config
This package provides Evaneos's configs for front projects.
.eslintrc as an extensible shared config
.prettierrc as an importable/extensible file
What it does
This setup lints, and formats based on Evaneos' practices. Feel free to override the rules that make sense for you.
Installing
-
In your project folder, run:
npm i -D @evaneos/eslint-config
npx install-peerdeps --dev @evaneos/eslint-config
You will see several dependencies were installed.
-
Now, create (or update) a .eslintrc file with the following content:
Don't forget to adapt the parserOptions.project if it's different in your project.
{
"extends": ["@evaneos/eslint-config"],
"parserOptions": {
"project": ["./tsconfig.json"]
}
}
If you need to extend the configuration with other plugins, make sure that @evaneos/eslint-config/prettier is the last item of the array
{
"extends": [
"@evaneos/eslint-config",
// ...,
"@evaneos/eslint-config/prettier",
],
"parserOptions": {
"project": ["./tsconfig.json"]
}
}
-
Add prettier config to your package.json
{
"prettier": "@evaneos/eslint-config/.prettierrc.js"
}
If you want to override it, you'll have to spread the config into a .prettierrc.js file instead, eg:
module.exports = {
...require('@evaneos/eslint-config/.prettierrc.js'),
semi: false,
};