4
4
*/
5
5
"use strict"
6
6
7
+ const { Linter } = require ( "eslint" )
8
+
9
+ const isESLint7 = Linter . version . startsWith ( "7" )
10
+
11
+ /** @type {import('eslint').Linter.Config } */
7
12
module . exports = {
8
13
root : true ,
9
14
plugins : [ "@eslint-community/mysticatea" ] ,
@@ -27,7 +32,7 @@ module.exports = {
27
32
"consistent-return" : "error" ,
28
33
curly : "error" ,
29
34
"default-case" : "error" ,
30
- "default-case-last" : "error" ,
35
+ ... ( isESLint7 ? { "default-case-last" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
31
36
"default-param-last" : "error" ,
32
37
"dot-notation" : "error" ,
33
38
eqeqeq : [ "error" , "always" , { null : "ignore" } ] ,
@@ -93,7 +98,7 @@ module.exports = {
93
98
"no-lone-blocks" : "error" ,
94
99
"no-lonely-if" : "error" ,
95
100
"no-loop-func" : "error" ,
96
- "no-loss-of-precision" : "error" ,
101
+ ... ( isESLint7 ? { "no-loss-of-precision" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
97
102
"no-misleading-character-class" : "error" ,
98
103
"no-mixed-operators" : [
99
104
"error" ,
@@ -108,14 +113,14 @@ module.exports = {
108
113
"no-new-object" : "error" ,
109
114
"no-new-require" : "error" ,
110
115
"no-new-wrappers" : "error" ,
111
- "no-nonoctal-decimal-escape" : "error" ,
116
+ ... ( isESLint7 ? { "no-nonoctal-decimal-escape" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
112
117
"no-obj-calls" : "error" ,
113
118
"no-octal" : "error" ,
114
119
"no-octal-escape" : "error" ,
115
120
"no-param-reassign" : [ "error" , { props : false } ] ,
116
121
"no-process-env" : "error" ,
117
122
"no-process-exit" : "error" ,
118
- "no-promise-executor-return" : "error" ,
123
+ ... ( isESLint7 ? { "no-promise-executor-return" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
119
124
"no-prototype-builtins" : "error" ,
120
125
"no-redeclare" : [ "error" , { builtinGlobals : true } ] ,
121
126
"no-regex-spaces" : "error" ,
@@ -146,10 +151,10 @@ module.exports = {
146
151
"no-unmodified-loop-condition" : "error" ,
147
152
"no-unneeded-ternary" : "error" ,
148
153
"no-unreachable" : "error" ,
149
- "no-unreachable-loop" : "error" ,
154
+ ... ( isESLint7 ? { "no-unreachable-loop" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
150
155
"no-unsafe-finally" : "error" ,
151
156
"no-unsafe-negation" : [ "error" , { enforceForOrderingRelations : true } ] ,
152
- "no-unsafe-optional-chaining" : "error" ,
157
+ ... ( isESLint7 ? { "no-unsafe-optional-chaining" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
153
158
"no-unused-expressions" : "error" ,
154
159
"no-unused-labels" : "error" ,
155
160
"no-unused-vars" : [
@@ -163,7 +168,7 @@ module.exports = {
163
168
} ,
164
169
] ,
165
170
"no-use-before-define" : [ "error" , "nofunc" ] ,
166
- "no-useless-backreference" : "error" ,
171
+ ... ( isESLint7 ? { "no-useless-backreference" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
167
172
"no-useless-call" : "error" ,
168
173
"no-useless-catch" : "error" ,
169
174
"no-useless-concat" : "error" ,
0 commit comments