1.0.5 • Published 4 years ago
eslint-config-nahid v1.0.5
eslint-config-nahid
My sharable and pluggable ESLint + Prettier configuration.
Contents
Features
- Lints JS according to latest standards using ESLint.
- Formats JS using Prettier.
- Lints & formats React using Airbnb's very popular ESLint config.
Requirements
Installation
- If your project doesn't have a
package.json
file already, create one using thenpm init
command. - Run the command:
npx install-peerdeps --dev eslint-config-nahid
- Create a file named
.eslintrc
and insert the following there:
{
"extends": [ "nahid" ]
}
This object can also be added in your package.json
file instead under the eslintConfig
property.
Learn more about using shareable ESLint config here.
Usage
- You can try running the following command
eslint .
to run ESLint. Look at ESLint's command-line interface guide here. - I prefer adding two scripts to the
package.json
file:
"scripts": {
"lint-js": "eslint \"**/*.js\"",
"lint-js:fix": "eslint \"**/*.js\" --fix",
}
That way, I can run npm run lint-js
and npm run lint-js:fix
to lint and lint/fix all the JS files in the codebase.
The documentation for ESLint as a whole can be found here.