eslint-config-devjmetivier
v2.5.3
Published
ESLint Config from Devin Metivier
Downloads
12
Maintainers
Readme
Opinionated ESLint Setup
These are my settings for ESLint and Prettier for Eslint
If you like them, awesome. If not, change them up!
What this does
- Lints JavaScript based on the latest standards
- Fixes issues and formatting errors with Eslint + Prettier
- Lints + Fixes JSX markup
Installing
You can use eslint globally and/or locally per project. It's usually best to install this locally once per project, that way you can have project specific settings as well as sync those settings with others working on your project via git.
Local / Per Project Install
If you don't already have a package.json file, create one with
npm init
oryarn init
.Install everything needed by the config:
npm install eslint-config-devjmetivier
oryarn add eslint-config-devjmetivier
Create a .eslintrc file in the root of your project's directory (it should live where package.json does). Your .eslintrc file should look like this:
{ "extends": ["devjmetivier"] }
Tip: You can alternatively put this object in your package.json under the property "eslintConfig":. This makes one less file in your project.
You can add two scripts to your package.json to lint and/or fix:
"scripts": { "lint": "eslint . --ext .js,.ts,.jsx,.tsx", "lint:fix": "eslint . --ext .js,.ts,.jsx,.tsx --fix" }
Now you can manually lint your code by running
npm run lint
and fix all fixable issues withnpm run lint:fix
. You probably want your editor to do this automagically, though.