@vita-mojo/eslint-plugin-eslint v1.0.0-eslint-f466c2e-447-rc.0
ESLint
This library was generated with Nx.
Installation
Install the package:
npm i --save-dev @vita-mojo/eslint-plugin-eslint
Create an
.eslintrc.jsonfile in the root of the project with the following content:{ "overrides": [ { "extends": ["plugin:@vita-mojo/eslint/javascript"], "files": ["*.{js,jsx}"], }, { "extends": ["plugin:@vita-mojo/eslint/browser", "plugin:@vita-mojo/eslint/react"], "files": ["src/*.{js,jsx,ts,tsx}"], }, { "extends": ["plugin:@vita-mojo/eslint/node"], "files": ["scripts/*.{js,jsx,ts,tsx}"], }, { "extends": ["plugin:@vita-mojo/eslint/service-worker"], "files": ["service-worker.js"] }, { "extends": ["plugin:@vita-mojo/eslint/typescript", "plugin:@vita-mojo/eslint/prettier-typescript"], "files": ["*.{ts,tsx}"] }, { "env": { "jest": true }, "files": ["*.spec.{js,jsx,ts,tsx}", "*.test.{js,jsx,ts,tsx}"] }, { "extends": ["plugin:@vita-mojo/eslint/prettier"], "files": ["*"] } ], "plugins": ["@vita-mojo/eslint"], "root": true }Some things to note about the config:
- The
plugin:@vita-mojo/eslint/prettierconfig must be extended last.
- The
Extending the Rules
In the .eslintrc.json file, the default rules can be overridden with custom ones if desired. These rules should be set
within an overrides block for the relevant file type.
The following is an example of what the config could look like if ts-ignore comments should be allowed:
"overrides": [
{
"files": ["*.{ts,tsx}"],
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-inferrable-types": "off"
}
]If you make use of custom components for HTML elements, it's worth adding them to the ESLint settings in order to get more accurate linting. For example:
"settings": {
"jsx-a11y": {
"components": {
"Button": "button",
"Image": "img",
"Input": "input",
"Link": "a"
}
}
}For more information on this, see the eslint-plugin-jsx-a11y
documentation.
Building
Run nx build eslint to build the library.
Running unit tests
Run nx test eslint to execute the unit tests via Jest.
9 months ago
9 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago