forked from ethereumfollowprotocol/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
126 lines (125 loc) · 3.25 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
warnOnUnsupportedTypeScriptVersion: true
},
env: { node: true, browser: true },
reportUnusedDisableDirectives: true,
extends: [
'eslint:recommended',
'plugin:unicorn/all',
'plugin:@typescript-eslint/recommended',
'plugin:jsonc/prettier',
'plugin:astro/recommended',
'prettier'
],
plugins: ['@typescript-eslint', 'prettier'],
overrides: [
{
files: ['*.ts', '*.d.ts'],
rules: {
'@typescript-eslint/no-namespace': ['off']
}
},
{
files: ['*.mdx', '*.md'],
extends: 'plugin:mdx/recommended',
rules: {
'@typescript-eslint/no-unused-vars': ['off'],
'no-unused-vars': ['off'],
'mdx/no-unused-expressions': ['off']
},
settings: {
'mdx/code-blocks': true,
'mdx/language-mapper': {}
}
},
{
files: ['*.js', '*.cjs', '*.mjs'],
/**
* These rules apply to code blocks in MDX files.
*/
rules: {
'no-unused-vars': ['off'],
'@typescript-eslint/no-unused-vars': ['warn'],
'no-undef': ['off']
}
},
{
files: ['*.astro'],
parser: 'astro-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro']
},
rules: {}
}
],
rules: {
'unicorn/no-keyword-prefix': ['error', { disallowedPrefixes: ['new', 'for'] }],
'unicorn/filename-case': ['off'],
'unicorn/prefer-module': ['off'],
'unicorn/no-array-reduce': ['off'],
'unicorn/consistent-function-scoping': ['off', { checkArrowFunctions: false }],
'unicorn/prefer-top-level-await': ['off'],
'unicorn/prefer-event-target': ['off'],
'unicorn/prevent-abbreviations': [
'error',
{
allowList: {
ProcessEnv: true,
ImportMetaEnv: true,
Props: true,
Env: true
},
checkFilenames: false
}
],
'import/no-anonymous-default-export': ['off'],
'no-unused-vars': ['off'],
'@typescript-eslint/no-unused-vars': ['off'],
'array-element-newline': ['error', 'consistent'],
'object-curly-spacing': ['error', 'always'],
'prettier/prettier': [
'warn',
{},
{
usePrettierrc: true,
fileInfoOptions: {
withNodeModules: true
}
}
],
'no-mixed-operators': ['off'],
'no-multiple-empty-lines': ['off'],
'no-unexpected-multiline': ['off'],
'@typescript-eslint/triple-slash-reference': ['off'],
'@typescript-eslint/no-var-requires': ['off'],
'@typescript-eslint/prefer-namespace-keyword': ['off'],
'@typescript-eslint/no-empty-interface': ['off'],
'@typescript-eslint/consistent-type-imports': [
'warn',
{
prefer: 'type-imports',
fixStyle: 'inline-type-imports'
}
],
'@typescript-eslint/ban-ts-comment': ['off'],
'@typescript-eslint/ban-types': [
'warn',
{
types: {
String: {
message: 'Use string instead',
fixWith: 'string'
},
'{}': false
}
}
]
}
}