1.0.5 • Published 5 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.jsonfile already, create one using thenpm initcommand. - Run the command:
npx install-peerdeps --dev eslint-config-nahid - Create a file named
.eslintrcand 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.jsonfile:
"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.