Skip to content

Instantly share code, notes, and snippets.

@remy
Last active April 13, 2021 04:48
Show Gist options
  • Save remy/f33649333bc85a4d00d2fbc27209e6ce to your computer and use it in GitHub Desktop.
Save remy/f33649333bc85a4d00d2fbc27209e6ce to your computer and use it in GitHub Desktop.
My Next.js eslint config + `npm install --save-dev eslint eslint-plugin-react babel-eslint`
{
"parser": "babel-eslint",
"env": {
"browser": true,
"es6": true,
"commonjs": true
},
"globals": {
"process": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 9,
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"react/prop-types": 0,
"react/jsx-uses-vars": [
2
],
"react/jsx-no-undef": "error",
"no-console": 0
}
}
@stephanembl
Copy link

Careful! You install eslint-config-airbnb but extend eslint:recommended instead of airbnb.

@M-Izadmehr
Copy link

Thanks dude

:-D :-D

@wallawe
Copy link

wallawe commented Sep 26, 2019

dumb question, but after doing everything above, how do you run the linter? I was hoping to get it to run on every hot reload like CRA does

@imVinayPandya
Copy link

Thank you

@sinxwal
Copy link

sinxwal commented May 5, 2020

dumb question, but after doing everything above, how do you run the linter? I was hoping to get it to run on every hot reload like CRA does

You have to configure your IDE (VSCode, WebStorm, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment