-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.cjs
105 lines (103 loc) · 2.59 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/* eslint-disable no-undef */
/* eslint-disable unicorn/prefer-module */
const typescriptProject = ["./tsconfig.json"];
module.exports = {
root: true,
env: {
node: true,
browser: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
project: typescriptProject,
},
settings: {
"import/core-modules": ["bun:test"],
"import/resolver": {
typescript: {
project: typescriptProject,
},
node: {
project: typescriptProject,
},
},
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:unicorn/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:prettier/recommended",
"plugin:tailwindcss/recommended",
],
rules: {
"import/order": [
"error",
{
"newlines-between": "always",
distinctGroup: false,
pathGroups: [
{
pattern: "@/**",
group: "internal",
position: "before",
},
],
groups: [
"builtin",
"external",
"internal",
"index",
"type",
"object",
"parent",
"sibling",
],
},
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
disallowTypeAnnotations: false,
},
],
// allow unused vars prefixed with `_`
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"unicorn/no-null": "off",
"unicorn/filename-case": [
"error",
{
case: "kebabCase",
ignore: [],
},
],
"unicorn/prevent-abbreviations": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-await-expression-member": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/consistent-function-scoping": [
"error",
{ checkArrowFunctions: false },
],
"unicorn/throw-new-error": "off",
"unicorn/prefer-structured-clone": "off",
"unicorn/prefer-string-raw": "off",
// array-callback-return is recommended
// See https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v48.0.1/docs/rules/no-useless-undefined.md
"unicorn/no-useless-undefined": ["error", { checkArguments: false }],
"array-callback-return": [
"error",
{
allowImplicit: true,
},
],
"unicorn/no-array-reduce": ["error", { allowSimpleOperations: true }],
"import/no-relative-packages": "error",
},
};