Created
November 7, 2020 17:10
-
-
Save raulingg/1a135d047a9ca4c4c271bd6370af8c76 to your computer and use it in GitHub Desktop.
My ESLint config for Next.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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