-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.cjs
53 lines (48 loc) · 1.39 KB
/
.eslintrc.cjs
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
50
51
52
53
/* eslint-env node */
module.exports = {
// plugins
plugins: ["@typescript-eslint", "prettier", "simple-import-sort", "react"],
// default rules
extends: [
"next/core-web-vitals",
"next/typescript",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/stylistic",
"plugin:prettier/recommended",
],
// parser rules
root: true,
ignorePatterns: [".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
ecmaVersion: "latest",
projectService: true,
tsconfigRootDir: __dirname,
},
rules: {
// formatting / style rules
"prettier/prettier": "warn",
"no-console": ["error", { allow: ["error"] }],
camelcase: "warn",
"react/function-component-definition": [
"error",
{
namedComponents: "function-declaration",
unnamedComponents: "function-expression",
},
],
// typescript rules
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/require-await": "warn",
// import rules
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
},
};