Skip to content

Instantly share code, notes, and snippets.

@raulingg
Created November 7, 2020 17:10
Show Gist options
  • Save raulingg/1a135d047a9ca4c4c271bd6370af8c76 to your computer and use it in GitHub Desktop.
Save raulingg/1a135d047a9ca4c4c271bd6370af8c76 to your computer and use it in GitHub Desktop.
My ESLint config for Next.js
{
"root": true, // Make sure eslint picks up the config at the root of the directory
"parserOptions": {
"ecmaVersion": 2020, // Use the latest ecmascript standard
"sourceType": "module", // Allows using import/export statements
"ecmaFeatures": {
"jsx": true // Enable JSX since we're using React
}
},
"settings": {
"react": {
"version": "detect" // Automatically detect the react version
}
},
"env": {
"browser": true, // Enables browser globals like window and document
"amd": true, // Enables require() and define() as global variables as per the amd spec.
"node": true // Enables Node.js global variables and Node.js scoping.
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:prettier/recommended" // Make this the last element so prettier config overrides other formatting rules
],
"rules": {
"react/react-in-jsx-scope": false,
"react/prop-types": false,
"prettier/prettier": ["error", {}, { "usePrettierrc": true }] // Use our .prettierrc file as source
}
}
@raulingg
Copy link
Author

raulingg commented Nov 7, 2020

Thanks to @onygami. I came across the config that appeals to me at https://dev.to/onygami/eslint-and-prettier-for-react-apps-bonus-next-js-and-typescript-3e46

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