@axah/eslint-config
v3.1.0
Published
Shared eslint config for @axah projects
Downloads
117
Readme
@axah/eslint-config
Shared Eslint config for @axah projects
Install
$ npm install --save-dev @axah/eslint-config
$ yarn add --dev @axah/eslint-config
Usage
Also make sure to have prettier
and of course typescript
and eslint
installed as well.
Then add the following config to your extend array in your eslint config file.
module.exports = {
extends: [
'@axah/eslint-config', // this is the base
/*
for react: '@axah/eslint-config/react'
*/
],
parserOptions: {
project: './tsconfig.json', // should be the path to the projects tsconfig.json
},
}
IMPORTANT:
- For this config to work you need to have a tsconfig.json file at the repo root level, and then you have to set the parserOptions.project to point to your tsconfig file. see the @typescript-eslint plugin docs.
- for the best experience you should have a prettier config file at the repo root as well, otherwise the eslint-config-prettier will use its builtin defaults.
- if you use path aliases, (e.g. use "@" as a path alias to /src etc.), you will probably need to setup a path resolver for the eslint-plugin-import package or turn off some of its rules. There is a resolver for node, typescript, babel, webpack etc.