-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
43 lines (43 loc) · 1.58 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// .eslintrc.js
// https://paulintrognon.fr/blog/post/typescript-prettier-eslint-next-js
// https://www.npmjs.com/package/eslint-config-nextjs
// https://github.com/vercel/next.js/tree/canary/examples/with-typescript-eslint-jest
// eslint-disable-next-line no-undef
module.exports = {
root: true,
parser: "@typescript-eslint/parser", // the TypeScript parser we installed earlier
parserOptions: {
ecmaFeatures: { jsx: true }, // Allows for the parsing of JSX
},
plugins: ["@typescript-eslint", "import", "react"],
extends: [
"eslint:recommended", // eslint default rules
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:@typescript-eslint/eslint-recommended", // eslint TypeScript rules (github.com/typescript-eslint/typescript-eslint)
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended", // eslint react rules (github.com/yannickcr/eslint-plugin-react)
"plugin:jsx-a11y/recommended", // accessibility plugin
"plugin:@next/next/recommended",
],
rules: {
"react/prop-types": "off", // We turn off prop-types rule, as we will use TypeScript's types instead.
"react/react-in-jsx-scope": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"jsx-a11y/anchor-is-valid": "off",
"@typescript-eslint/no-unused-vars": ["error"],
},
settings: {
"import/resolver": {
typescript: {
project: ".",
},
},
react: {
version: "detect",
},
files: ["**/*.ts", "**/*.tsx"],
},
};