44 */
55"use strict"
66
7+ const { ESLint, version : ESLintVersion } = require ( "eslint" )
8+
9+ const version = ESLint . version || ESLintVersion
10+ const isESLint7 = version . startsWith ( "7" )
11+
12+ /** @type {import('eslint').Linter.Config } */
713module . exports = {
814 root : true ,
915 plugins : [ "@eslint-community/mysticatea" ] ,
@@ -27,7 +33,7 @@ module.exports = {
2733 "consistent-return" : "error" ,
2834 curly : "error" ,
2935 "default-case" : "error" ,
30- "default-case-last" : "error" ,
36+ ... ( isESLint7 ? { "default-case-last" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
3137 "default-param-last" : "error" ,
3238 "dot-notation" : "error" ,
3339 eqeqeq : [ "error" , "always" , { null : "ignore" } ] ,
@@ -93,7 +99,7 @@ module.exports = {
9399 "no-lone-blocks" : "error" ,
94100 "no-lonely-if" : "error" ,
95101 "no-loop-func" : "error" ,
96- "no-loss-of-precision" : "error" ,
102+ ... ( isESLint7 ? { "no-loss-of-precision" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
97103 "no-misleading-character-class" : "error" ,
98104 "no-mixed-operators" : [
99105 "error" ,
@@ -108,14 +114,14 @@ module.exports = {
108114 "no-new-object" : "error" ,
109115 "no-new-require" : "error" ,
110116 "no-new-wrappers" : "error" ,
111- "no-nonoctal-decimal-escape" : "error" ,
117+ ... ( isESLint7 ? { "no-nonoctal-decimal-escape" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
112118 "no-obj-calls" : "error" ,
113119 "no-octal" : "error" ,
114120 "no-octal-escape" : "error" ,
115121 "no-param-reassign" : [ "error" , { props : false } ] ,
116122 "no-process-env" : "error" ,
117123 "no-process-exit" : "error" ,
118- "no-promise-executor-return" : "error" ,
124+ ... ( isESLint7 ? { "no-promise-executor-return" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
119125 "no-prototype-builtins" : "error" ,
120126 "no-redeclare" : [ "error" , { builtinGlobals : true } ] ,
121127 "no-regex-spaces" : "error" ,
@@ -146,10 +152,10 @@ module.exports = {
146152 "no-unmodified-loop-condition" : "error" ,
147153 "no-unneeded-ternary" : "error" ,
148154 "no-unreachable" : "error" ,
149- "no-unreachable-loop" : "error" ,
155+ ... ( isESLint7 ? { "no-unreachable-loop" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
150156 "no-unsafe-finally" : "error" ,
151157 "no-unsafe-negation" : [ "error" , { enforceForOrderingRelations : true } ] ,
152- "no-unsafe-optional-chaining" : "error" ,
158+ ... ( isESLint7 ? { "no-unsafe-optional-chaining" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
153159 "no-unused-expressions" : "error" ,
154160 "no-unused-labels" : "error" ,
155161 "no-unused-vars" : [
@@ -163,7 +169,7 @@ module.exports = {
163169 } ,
164170 ] ,
165171 "no-use-before-define" : [ "error" , "nofunc" ] ,
166- "no-useless-backreference" : "error" ,
172+ ... ( isESLint7 ? { "no-useless-backreference" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
167173 "no-useless-call" : "error" ,
168174 "no-useless-catch" : "error" ,
169175 "no-useless-concat" : "error" ,
0 commit comments