eslint-plugin-nwronski
This repo contains the linting rules for my projects that use ESLint with TypeScript.
Installation
Install ESLint and TSLint (for now) for your project.
yarn add --dev eslint tslint
Default (TypeScript/Node)
Install the eslint-plugin-nwronski
module and dependencies
yarn add --dev eslint-plugin-nwronski
Create a .eslintrc.json
file in the root folder of your project and add the following:
.eslintrc.json
Add lint
script to your package.json
:
package.json
Angular (TypeScript/Jasmine/Protractor)
Install the eslint-plugin-nwronski
module and dependencies
yarn add --dev @angular-eslint/eslint-plugin @angular-eslint/template-parser @angular-eslint/eslint-plugin-template @angular-eslint/builder eslint-plugin-nwronski
Create a .eslintrc.json
file in the root folder of your project and add the following:
.eslintrc.json
Create a tsconfig.eslint.json
file in the root folder of your project and add the following:
tsconfig.eslint.json
Add lint
script to your package.json
:
package.json
Add ESLint configuration for Angular CLI to your angular.json
:
angular.json
React (TypeScript/Jest)
Install the eslint-plugin-nwronski
module and dependencies
yarn add --dev eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y eslint-plugin-jest eslint-plugin-nwronski
Create a .eslintrc.json
file in the root folder of your project and add the following:
.eslintrc.json
Add lint
script to your package.json
:
package.json
Usage
CLI
yarn run lint
lint-staged
yarn add --dev lint-staged
.lintstagedrc.json
vscode
.vscode/settings.json