generated from hyoban-template/starter-next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
90 lines (84 loc) · 2.29 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* eslint-env node */
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:unicorn/recommended",
"plugin:jsx-a11y/recommended",
"plugin:@eslint-react/all-legacy",
"plugin:react-hooks/recommended",
"plugin:@next/next/recommended",
"plugin:tailwindcss/recommended",
"prettier",
],
plugins: ["@typescript-eslint", "validate-jsx-nesting"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
root: true,
ignorePatterns: ["**/*.js", "**/*.cjs", "**/*.mjs"],
rules: {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-import-type-side-effects": "error",
"unicorn/prevent-abbreviations": "off",
// https://github.com/sindresorhus/meta/discussions/7
"unicorn/no-null": "off",
// https://github.com/orgs/web-infra-dev/discussions/10
"unicorn/prefer-top-level-await": "off",
"no-console": ["warn", { allow: ["warn", "error"] }],
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: {
arguments: false,
attributes: false,
},
},
],
"@eslint-react/naming-convention/filename": [
"error",
{
rule: "kebab-case",
},
],
"validate-jsx-nesting/no-invalid-jsx-nesting": "error",
"tailwindcss/classnames-order": "off",
},
settings: {
tailwindcss: {
callees: ["classnames", "clsx", "ctl", "cn"],
},
},
overrides: [
{
files: ["*.tsx", "*.ts"],
excludedFiles: [
"src/app/**/{layout,page,loding,not-found,error,global-error,route,template,default}.tsx",
"*.config.ts",
],
rules: {
// disable export * and enum
"no-restricted-syntax": [
"error",
{
selector: ":matches(ExportAllDeclaration)",
message: "Export only modules you need.",
},
{
selector: "TSEnumDeclaration",
message: "We should not use Enum",
},
],
"no-restricted-exports": [
"error",
{
restrictDefaultExports: { direct: true },
},
],
},
},
],
}