ESLint shareable config for TypeScript projects
Shared configuration for ESLint. Follow the instructions below to easily include this configuration in another project without having to duplicate the file!
First thing first, let's make sure you have the necessary pre-requisites.
npx install-peerdeps --dev eslint-config-typescript-tc
@typescript-eslint/parser and eslint-config-prettier are peer dependencies and must be installed.
This module works best when paired with eslint-config-tc
. Please follow its install instructions.
Add the following to your .eslintrc.js
file:
module.exports = {
extends: ['eslint-config-tc', 'eslint-config-typescript-tc'],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
};
If you need to override a rule, your .eslintrc.js
file should look like the example below. All shared rules will be used, but @typescript-eslint/array-type
will be turned off.
module.exports = {
extends: ['eslint-config-tc', 'eslint-config-typescript-tc'],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
"rules": {
"@typescript-eslint/array-type": "off"
}
};
- eslint-config-tc - ESLint shareable config for JavaScript projects
Please see the CONTRIBUTING.md file for more information.
Please see the CHANGELOG.md for more information.
Copyright (c) 2020-2023 Thomas Lindner. Licensed under the MIT license.