Base eslint config for typescript projects
npm install @chax-at/eslint-config --save-dev
npm install eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser --save-dev
Add the config to the extends rule section of your .eslintrc
{
"extends": [
"@chax-at/eslint-config"
]
}
{
"env": {
"browser": true,
"es6": true,
"mocha": true,
"node": true
},
"extends": [
"@chax-at/eslint-config"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"legacyDecorators": true,
"modules": true
},
"ecmaVersion": 6,
"project": "./tsconfig.json",
"sourceType": "module",
"tsconfigRootDir": "./"
},
"plugins": [
"@typescript-eslint",
"mocha"
]
}
To test changes locally:
- run
npm link
in the cloned eslint-config project directory - run
npm link @chax-at/eslint-config
in the project you want to test your config - make sure you rerun the above command after an
npm install
- run
npm unlink @chax-at/eslint-config
after you are done