-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
.eslintrc.json
110 lines (110 loc) · 2.97 KB
/
.eslintrc.json
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
106
107
108
109
110
{
"root": true,
"extends": ["xo", "prettier", "plugin:n/recommended-module"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "unicorn", "prettier", "import"],
"env": {
"node": true,
"es2022": true
},
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"ignorePatterns": [
".git",
"node_modules",
"coverage",
"dist",
"packages/*/node_modules",
"packages/*/__snapshots__"
],
"rules": {
"capitalized-comments": "off",
"default-param-last": "off",
"padding-line-between-statements": "off",
"n/no-missing-import": [
"error",
{
"allowModules": ["@inquirer/figures"]
}
],
"no-eq-null": "off",
"no-redeclare": "off",
"no-restricted-imports": [
"error",
{
"name": "lodash",
"message": "Do not import the whole of 'lodash'. Import the needed function instead e.g `import map from 'lodash/map.js'`"
}
],
"no-shadow": "error",
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"import/no-duplicates": "error",
"import/order": "error",
"prettier/prettier": "error",
"unicorn/better-regex": "error",
"unicorn/explicit-length-check": "error",
"unicorn/no-abusive-eslint-disable": "error",
"unicorn/no-new-array": "error",
"unicorn/numeric-separators-style": "error",
"unicorn/prefer-at": "error",
"unicorn/prefer-includes": "error",
"unicorn/prefer-module": "error",
"unicorn/prefer-node-protocol": "error",
"unicorn/prefer-number-properties": "error",
"unicorn/prefer-regexp-test": "error",
"unicorn/prefer-spread": "error",
"unicorn/prefer-string-replace-all": "error",
"unicorn/prefer-ternary": "error"
},
"overrides": [
{
"files": ["*.ts", "*.mts"],
"rules": {
// Disabled per typescript-eslint recommendation: https://github.com/typescript-eslint/typescript-eslint/blob/e26e43ffba96f6d46198b22f1c8dd5c814db2652/docs/getting-started/linting/FAQ.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
"no-undef": "off",
"n/no-missing-import": "off",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error"
}
},
{
"files": ["*.cjs"],
"rules": {
"n/no-missing-require": "off"
},
"globals": {
"require": "readonly"
},
"parserOptions": {
"sourceType": "script"
}
},
{
"files": ["packages/inquirer/test/**", "packages/**/*.test.*"],
"rules": {
"n/no-extraneous-import": [
"error",
{
"allowModules": ["vitest"]
}
],
"n/no-extraneous-require": [
"error",
{
"allowModules": ["vitest"]
}
]
}
}
]
}