This repository has been archived by the owner on Feb 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
49 lines (49 loc) · 1.63 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
44
45
46
47
48
49
/**
* @type {import('eslint').Linter.Config<import('eslint/rules/index').ESLintRules>}
*/
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2020,
ecmaFeatures: { jsx: true },
},
env: {
browser: true,
node: true,
es6: true,
},
extends: [
"eslint:recommended",
"next/core-web-vitals", // https://github.com/vercel/next.js/tree/canary/packages/eslint-config-next
// extends:
// "next"
// // "plugin:react/recommended"
// // "plugin:react-hooks/recommended"
// // "plugin:@next/next/recommended"
// "plugin:@next/next/core-web-vitals"
// plugins:
// "import", "react", "jsx-a11y"
"plugin:prettier/recommended",
// extends: "prettier"
// plugins: "prettier"
],
plugins: ["@typescript-eslint/eslint-plugin", "prettier", "unused-imports"],
rules: {
"prettier/prettier": "warn",
"array-callback-return": "warn", // enforce return on Array.map() and etc.
"no-constant-binary-expression": "warn", // a + b ?? c
"no-dupe-class-members": "off", // that's a TypeScript thing
"no-unused-vars": "off", // default one, replaced by "unused-imports" plugin
"unused-imports/no-unused-vars": "warn",
"unused-imports/no-unused-imports": "warn",
"no-redeclare": "off", // I wanna combine namespaces with functions
"react-hooks/exhaustive-deps": "off", // the amount of extra dependencies is excessive
"no-empty": "off", // annoying
"@next/next/no-img-element": "off", // not useful at the moment
"no-undef": "off", // TypeScript does it better
},
globals: {
React: true,
NodeJS: true,
},
};