1+ import globals from 'globals' ;
12import js from '@eslint/js' ;
3+ import ts from 'typescript-eslint' ;
24
35const rules = {
46 rules : {
@@ -16,10 +18,10 @@ const rules = {
1618 "eqeqeq" : [ "error" , "smart" ] ,
1719 "func-call-spacing" : [ "warn" , "never" ] ,
1820 "grouped-accessor-pairs" : "error" ,
19- "indent" : [ "off" , 4 ] ,
21+ "indent" : [ "off" , 2 ] ,
2022 "keyword-spacing" : "error" ,
2123 "linebreak-style" : [ "error" , "unix" ] ,
22- "no-await-in-loop" : "error " ,
24+ "no-await-in-loop" : "off " ,
2325 "no-caller" : "error" ,
2426 "no-catch-shadow" : "error" ,
2527 "no-console" : "warn" ,
@@ -34,14 +36,15 @@ const rules = {
3436 "no-floating-decimal" : "error" ,
3537 "no-global-assign" : "error" ,
3638 "no-implied-eval" : "error" ,
37- "no-invalid-this" : "off " ,
39+ "no-invalid-this" : "error " ,
3840 "no-iterator" : "error" ,
3941 "no-labels" : "error" ,
4042 "no-label-var" : "error" ,
4143 "no-lone-blocks" : "error" ,
4244 "no-loop-func" : "error" ,
4345 "no-loss-of-precision" : "error" ,
4446 "no-multi-str" : "error" ,
47+ "no-native-reassign" : "error" ,
4548 "no-new" : "error" ,
4649 "no-new-func" : "error" ,
4750 "no-new-wrappers" : "error" ,
@@ -70,7 +73,7 @@ const rules = {
7073 "no-unreachable" : "warn" ,
7174 "no-unreachable-loop" : "warn" ,
7275 "no-unused-expressions" : "error" ,
73- "no-unused-vars" : [ "warn ", { "vars" : "all" , "args" : "none" , "caughtErrors" : "none" } ] ,
76+ "no-unused-vars" : "off ", // typescript-eslint will check it
7477 "no-use-before-define" : [ "off" , "nofunc" ] ,
7578 "no-useless-backreference" : "warn" ,
7679 "no-useless-call" : "warn" ,
@@ -83,19 +86,44 @@ const rules = {
8386 "no-warning-comments" : "warn" ,
8487 "no-whitespace-before-property" : "warn" ,
8588 "no-with" : "error" ,
86- "quotes" : [ "error" , "single" , { "allowTemplateLiterals" : true } ] ,
8789 "radix" : [ "error" , "always" ] ,
8890 "require-atomic-updates" : "error" ,
8991 "require-await" : "error" ,
9092 "semi" : [ "error" , "always" ] ,
9193 "semi-spacing" : "error" ,
9294 "space-unary-ops" : "error" ,
93- "wrap-regex" : "off"
95+ "wrap-regex" : "off" ,
96+
97+ "@typescript-eslint/array-type" : "off" ,
98+ "@typescript-eslint/no-empty-function" : "off" ,
99+ "@typescript-eslint/no-explicit-any" : "warn" ,
100+ "@typescript-eslint/no-inferrable-types" : [ "warn" , { "ignoreParameters" : true } ] ,
101+ "@typescript-eslint/no-unused-vars" : [ "warn" , { "vars" : "all" , "args" : "none" , "caughtErrors" : "none" , "destructuredArrayIgnorePattern" : "^_" } ]
94102 }
95103} ;
96104
97105export default [
98106 js . configs . recommended ,
99- rules
107+ ...ts . configs . recommended ,
108+ ...ts . configs . stylistic ,
109+ rules ,
110+ {
111+ files : [ '**/*.{js,ts}' ] ,
112+ languageOptions : {
113+ globals : {
114+ ...globals . browser
115+ }
116+ }
117+ } ,
118+ {
119+ files : [ 'scripts/*' , 'test/*' ] ,
120+ languageOptions : {
121+ globals : {
122+ Bun : false
123+ }
124+ } ,
125+ rules : {
126+ "no-console" : "off"
127+ }
128+ }
100129] ;
101-
0 commit comments