0.1.3 • Published 6 years ago
eslint-config-jcv v0.1.3
Unnecessary ESLint and Prettier setup
Personally unnecessary config for ESLint and Prettier. I guess you can use it too, though there's hardly anything in it.
What it does
- Lints JavaScript based on the latest standards
- Fixes issues and formatting errors with Prettier
- Lints + Fixes inside of HTML script tags
- Lints + Fixes React via eslint-config-airbnb
Please don't just install some rando's configuration for a potential code-breaking tool. Look at what I'm using and determine which rules work best for you.
Installing
We're reasonable people, so let's install this locally.
If you don't already have a
package.jsonfile, create one withnpm init.Install the config's dependencies:
npx install-peerdeps --dev eslint-config-jcv- Create a
.eslintrc.jsfile in the root of your project's directory (it should live where package.json does). Your.eslintrc.jsfile should look like this:
{
"extends": [
"jcv"
]
}For React projects:
{
"extends": [
"jcv"
"jcv/react"
]
}Alternatively, you can put this object in your package.json under the property "eslintConfig".
- You can add two scripts to your package.json to lint and/or fix:
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},- Now you can manually lint your code by running
npm run lintand fix all fixable issues withnpm run lint:fix. You probably want your editor to do this though.
Setup and instructions "inspired" by Wes Bos' No-Sweat™ config.