Extendable eslint config, with TypeScript and Prettier and (optionally) React.
Installation
npm i -D @thesergiomiguel/eslint-config
Note: npm versions > 3 and < 7 don't automatically install peerDependencies, so peep into package.json and install them manually as needed.
Usage
- Add this package to the
extendsarray ineslintrc
{
extends: [..., '@thesergiomiguel/eslint-config'],
}If you are using ESLint in a React project, use @thesergiomiguel/eslint-config/with-react instead.
- Specify the location of your
tsconfiginconfig.parserOptions
{
tsconfigRootDir: __dirname,
project: "./tsconfig.json",
}
This is necessary to enable rules that require type information.
- Export the Prettier config exposed here from your
prettierrc
module.exports = {
...require('@thesergiomiguel/eslint-config/prettierrc'),
};