This package provides Infinum's ESLint plugin.
npm install --save-dev @infinum/eslint-plugin
The basic usage of this plugin is to extend the plugin:@infinum/core
config in your ESLint configuration file.
{
"extends": ["plugin:@infinum/core"]
}
However, we can also extend .eslintrc
with additional configs. The idea is to have modular configs and that you can choose what rules you want to have on the project. E.g., there is no need to have TypeScript
rules on a JavaScript
project. The entire list of configs can be found in src/configs/index.ts
.
NOTE: some configs require additional plugins to be installed. E.g.,
@infinum/react
requireseslint-plugin-react
andeslint-plugin-react-hooks
to be installed.
Install the following packages:
npm install --save-dev eslint-plugin-rxjs eslint-plugin-jasmine @infinum/eslint-plugin
Add this to you eslint
config:
{
"extends": ["plugin:@infinum/core", "plugin:@infinum/typescript", "plugin:@infinum/angular"],
"parserOptions": {
"project": ["./tsconfig.json"]
}
}
Install the following packages:
npm install -D -E \
@infinum/eslint-plugin@2 \
eslint-plugin-react@7 \
eslint-plugin-react-hooks@4 \
eslint-plugin-jsx-a11y@6 \
@typescript-eslint/eslint-plugin@7 \
@typescript-eslint/parser@7 \
@next/eslint-plugin-next@14 \
eslint-plugin-typescript-enum@2 \
eslint-plugin-chakra-ui@0.11
Add this to you eslint
config:
{
"extends": [
"plugin:@infinum/core",
"plugin:@infinum/typescript",
"plugin:@infinum/react",
"plugin:@infinum/next-js",
"plugin:@infinum/chakra-ui"
],
"parserOptions": {
"project": ["./tsconfig.json"]
}
}
The MIT License
js-linters
is maintained and sponsored by
Infinum.