44 */
55"use strict"
66
7+ const { Linter } = require ( "eslint" )
8+
9+ const isESLint7 = Linter . version . startsWith ( "7" )
10+
11+ /** @type {import('eslint').Linter.Config } */
712module . exports = {
813 root : true ,
914 plugins : [ "@eslint-community/mysticatea" ] ,
@@ -27,7 +32,7 @@ module.exports = {
2732 "consistent-return" : "error" ,
2833 curly : "error" ,
2934 "default-case" : "error" ,
30- "default-case-last" : "error" ,
35+ ... ( isESLint7 ? { "default-case-last" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
3136 "default-param-last" : "error" ,
3237 "dot-notation" : "error" ,
3338 eqeqeq : [ "error" , "always" , { null : "ignore" } ] ,
@@ -93,7 +98,7 @@ module.exports = {
9398 "no-lone-blocks" : "error" ,
9499 "no-lonely-if" : "error" ,
95100 "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
97102 "no-misleading-character-class" : "error" ,
98103 "no-mixed-operators" : [
99104 "error" ,
@@ -108,14 +113,14 @@ module.exports = {
108113 "no-new-object" : "error" ,
109114 "no-new-require" : "error" ,
110115 "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
112117 "no-obj-calls" : "error" ,
113118 "no-octal" : "error" ,
114119 "no-octal-escape" : "error" ,
115120 "no-param-reassign" : [ "error" , { props : false } ] ,
116121 "no-process-env" : "error" ,
117122 "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
119124 "no-prototype-builtins" : "error" ,
120125 "no-redeclare" : [ "error" , { builtinGlobals : true } ] ,
121126 "no-regex-spaces" : "error" ,
@@ -146,10 +151,10 @@ module.exports = {
146151 "no-unmodified-loop-condition" : "error" ,
147152 "no-unneeded-ternary" : "error" ,
148153 "no-unreachable" : "error" ,
149- "no-unreachable-loop" : "error" ,
154+ ... ( isESLint7 ? { "no-unreachable-loop" : "off" } : { } ) , // TODO: enable once we drop ESLint v6 support
150155 "no-unsafe-finally" : "error" ,
151156 "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
153158 "no-unused-expressions" : "error" ,
154159 "no-unused-labels" : "error" ,
155160 "no-unused-vars" : [
@@ -163,7 +168,7 @@ module.exports = {
163168 } ,
164169 ] ,
165170 "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
167172 "no-useless-call" : "error" ,
168173 "no-useless-catch" : "error" ,
169174 "no-useless-concat" : "error" ,
0 commit comments