eslint-config-js-standards
v1.0.1
Published
Shareable ESLint configurations for Javascript
Downloads
2
Maintainers
Readme
Shareable ESLint Configurations for Javascript
Overview
This documentation provides developers with a step-by-step guide on integrating shareable ESLint configuration eslint-config-js-standards
for javascript rules in any front-end project. ESLint is a static code analysis tool for identifying and fixing common programming errors and enforcing coding standards.
The project is built and maintained by Covalience, LLC.
Installation
By running the following command, we are installing the latest version of eslint-config-js-standards and its dependencies:
npm install --save-dev eslint eslint-config-js-standards
Minimum dependencies version requirement:
The following are the minimum versions of the dependencies required to use eslint-config-js-standards
:
eslint
>= 8.27.0
:warning: If your project is using older versions of the above dependencies. Please check the older versions of this package and follow its documentation.
Usage
Once the eslint-config-js-standards
package is installed, you can use by specifying eslint-config-js-standards
in the extends
section in your ESLint configuration.
- Update .eslintrc.{js,yml,json,cjs} with the following:
extends:[
- 'eslint:recommended',
+ 'eslint-config-js-standards'
]
ESLint Formatter (Optional)
ESLint comes with several built-in formatters to control the appearance of the linting results, and supports third-party formatters as well. For more details, please refer to here.
Following are the steps to setup html
eslint formatter.
- Update
package.json
file with the following:
scripts:{
+ "lint:format":"eslint . --format=html --output-file=eslintReport.html"
}
- Run
npm run lint:format
in the terminal. This will generate a HTML file namedeslintReport.html
at the root directory of your project and while opening it, it will show all eslint errors and warnings found.
Example of ESLint Report in HTML: