@prowise/eslint-config-linting-rules
v2.0.4
Published
Default Prowise linting rules for npm packages.
Downloads
4,340
Readme
Prowise linting rules
This repository contains the Prowise basic linting rules Rules are based on:
- The Airbnb rule sets
- The recommended rules of Eslint and the different plugins
- Prowise Style Guide
What is this repository for?
- Easy setup to all linting rules on a code repository
How to use
- Install this package with
npm install @prowise/eslint-config-linting-rules -D
- Depending on the type of project, add the following line to your
eslintrc
file:- Plain javascript project:
"extends": ["@prowise/eslint-config-linting-rules"],
- Typescript project:
"extends": ["@prowise/eslint-config-linting-rules/typescript"],
- Node-typescript backend project:
"extends": ["@prowise/eslint-config-linting-rules/backend"],
- React-typescript frontend project:
"extends": ["@prowise/eslint-config-linting-rules/frontend"],
- Plain javascript project:
Note: Don't forget to add the project to your parserOptions
in the .eslintrc.js
file for typescript projects!
Sample of a .eslintrc.js
file:
module.exports = {
extends: ["@prowise/eslint-config-linting-rules/frontend"],
parserOptions: {
project: "./tsconfig.json",
},
};
Know issues
ESM extension rules
The esm-extensions/force-extensions
rule might not work correctly when you use the path
option in tsconfig.json
. This has to do with the fact that the rule determines external packages by looking at the node_modules
folder which cannot be found.
It is best NOT to use paths redirects.
Installing a new version
When trying to update the installed lining version by npm i -D "@prowise/eslint-config-linting-rules@latest
you might get an error on a peer dependency.
In this case you can uninstall the linter by npm uninstall "@prowise/eslint-config-linting-rules
and reinstall it again with npm i -D "@prowise/eslint-config-linting-rules@latest