forked from SpyglassMC/Spyglass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
64 lines (61 loc) · 1.33 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
module.exports = {
"extends": [
'prettier',
],
"env": {
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"tsconfigRootDir": __dirname,
"project": "./packages/**/tsconfig.json"
},
"plugins": [
"@typescript-eslint"
],
"ignorePatterns": [
"**/*.js",
"**/*.cjs",
"**/*.mjs",
"**/node_modules",
"**/dist",
"**/lib",
"**/out",
"**/test-out",
"/scripts",
],
"rules": {
"@typescript-eslint/consistent-type-imports": [
"warn",
{
"prefer": "type-imports"
}
],
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/no-floating-promises": "error",
"indent": "off",
"no-fallthrough": "warn",
"no-restricted-syntax": [
"warn",
// https://astexplorer.net/
// https://eslint.org/docs/developer-guide/selectors
{
"selector": `:matches(
TSNullKeyword,
:not(
CallExpression[callee.object.name="Object"][callee.property.name="create"]
) > Literal[raw=null]
)`.replace(/\s/g, ''),
"message": "Use `undefined` instead of `null` when possible."
},
{
"selector": 'ImportDeclaration > Literal[value=/\\bsrc\\b/]',
"message": "Import from the `lib` dir instead of the `src` dir."
},
],
"prefer-const": "warn",
"prefer-object-spread": "warn",
}
}