Perfective ESLint Config
@perfective/eslint-config
provides
a shareable ESLint configuration
that is used for the development of the @perfective
packages.
As the @perfective
library itself,
these rules are configured for the TypeScript projects only.
In addition to the core ESLint rules
and the @typescript-eslint
plugin rules,
@perfective/eslint-config
configures:
To simplify configuring ESLint support in the IDEs and editors,
the severity of all fixable rules is warning
.
That allows to visually distinguish errors that have to be fixed manually
from issues that will be fixed automatically.
Setup
Require @perfective/eslint-config
and its peer dependencies as dev dependencies.
npm install --save-dev \
@perfective/eslint-config \
@typescript-eslint/eslint-plugin \
@typescript-eslint/parser \
eslint \
eslint-import-resolver-typescript \
eslint-plugin-deprecation \
eslint-plugin-eslint-comments \
eslint-plugin-import \
eslint-plugin-jest \
eslint-plugin-jest-formatting \
eslint-plugin-node \
eslint-plugin-prefer-arrow \
eslint-plugin-promise \
eslint-plugin-rxjs \
eslint-plugin-sonarjs \
eslint-plugin-unicorn \
tslint
Require the configuration in your root .eslintrc.js
or .eslintrc.json
.
{
"extends": ["@perfective"]
}
TSLint
ESLint and its plugins replace most of the TSLint rules.
Yet, there are plenty of rules that need to be supported.
Until then, it's recommended to also use the TSLint and its configuration.
Adding tslint.json
to the project root:
{
"extends": ["@perfective/eslint-config/tslint"]
}
Read the full documentation
in the repository.