@perfective/eslint-config
provides
a shareable ESLint configuration
that is used for the development of the @perfective
packages.
These rules are primarily configured for TypeScript projects.
In addition to the core ESLint rules,
@typescript-eslint
,
and ESlint Stylistic plugin rules,
@perfective/eslint-config
includes configurations for the ESLint plugins:
-
eslint-plugin-array-func
; -
eslint-plugin-cypress
(optional); -
eslint-plugin-deprecation
; -
eslint-plugin-eslint-comments
; -
eslint-plugin-import
; -
eslint-plugin-jest
(optional); -
eslint-plugin-jest-dom
(optional); -
eslint-plugin-jest-formatting
(optional, required ifeslint-plugin-jest
is installed); -
eslint-plugin-jsdoc
; -
eslint-plugin-node
; -
eslint-plugin-prefer-arrow
; -
eslint-plugin-promise
; -
eslint-plugin-rxjs
(optional); -
eslint-plugin-simple-import-sort
; -
eslint-plugin-sonarjs
; -
eslint-plugin-testing-library
(optional); -
eslint-plugin-unicorn
.
To simplify configuring ESLint support in the IDEs and editors,
the severity of all fixable rules is a warning
.
In addition, it allows distinguishing errors that have to be fixed manually
from issues that will be fixed automatically.
-
Require
@perfective/eslint-config
and its peer dependencies as dev dependencies.npm install --save-dev \ @perfective/eslint-config \ @babel/eslint-parser \ @stylistic/eslint-plugin \ @typescript-eslint/eslint-plugin \ @typescript-eslint/eslint-plugin-tslint \ @typescript-eslint/parser \ eslint \ eslint-import-resolver-typescript \ eslint-plugin-array-func \ eslint-plugin-deprecation \ eslint-plugin-eslint-comments \ eslint-plugin-import \ eslint-plugin-jsdoc \ eslint-plugin-node \ eslint-plugin-prefer-arrow \ eslint-plugin-promise \ eslint-plugin-simple-import-sort \ eslint-plugin-sonarjs \ eslint-plugin-unicorn \ tslint
-
Install optional peer dependencies that add linting rules for the tools you use.
npm install --save-dev \ eslint-plugin-cypress \ eslint-plugin-jest \ eslint-plugin-jest-dom \ eslint-plugin-jest-formatting \ eslint-plugin-rxjs \ eslint-plugin-testing-library
The
eslint-plugin-jest-formatting
module is required, if theeslint-plugin-jest
module is installed.The
@perfective/eslint-config
automatically includes rules for these plugins, if the dependency is installed. -
Require the configuration in your root
.eslintrc.js
.module.exports = { extends: ['@perfective/eslint-config'], };
ESLint and its plugins replace most of the TSLint rules. Yet, a few rules still need to be supported. TSLint rules are executed using the ESLint Plugin TSLint.
Read the full documentation in the repository.