1
+ import globals from "globals" ;
2
+ import path from "node:path" ;
3
+ import { fileURLToPath } from "node:url" ;
4
+ import js from "@eslint/js" ;
5
+ import { FlatCompat } from "@eslint/eslintrc" ;
6
+
7
+ const __filename = fileURLToPath ( import . meta. url ) ;
8
+ const __dirname = path . dirname ( __filename ) ;
9
+ const compat = new FlatCompat ( {
10
+ baseDirectory : __dirname ,
11
+ recommendedConfig : js . configs . recommended ,
12
+ allConfig : js . configs . all
13
+ } ) ;
14
+
15
+ export default [ ...compat . extends ( "eslint:recommended" ) , {
16
+ languageOptions : {
17
+ globals : {
18
+ ...globals . browser ,
19
+ ...globals . webextensions ,
20
+ ...globals . jquery ,
21
+ } ,
22
+ } ,
23
+
24
+ files : [ "source/js/*.js" ] ,
25
+
26
+ rules : {
27
+ "no-console" : "off" ,
28
+
29
+ indent : [ "warn" , 2 , {
30
+ SwitchCase : 1 ,
31
+ } ] ,
32
+
33
+ "no-trailing-spaces" : "warn" ,
34
+ "eol-last" : "warn" ,
35
+ "no-multiple-empty-lines" : "warn" ,
36
+
37
+ "space-unary-ops" : [ "warn" , {
38
+ words : true ,
39
+ nonwords : false ,
40
+ } ] ,
41
+
42
+ "space-infix-ops" : "warn" ,
43
+ "keyword-spacing" : "warn" ,
44
+ "space-before-blocks" : [ "warn" , "always" ] ,
45
+ "operator-linebreak" : "warn" ,
46
+ "space-before-function-paren" : [ "warn" , "never" ] ,
47
+ "space-in-parens" : [ "warn" , "never" ] ,
48
+ "array-bracket-spacing" : [ "warn" , "never" ] ,
49
+ "no-spaced-func" : "warn" ,
50
+
51
+ "no-unused-vars" : [ "error" , { "caughtErrors" : "none" } ] ,
52
+
53
+ "key-spacing" : [ "warn" , {
54
+ beforeColon : false ,
55
+ afterColon : true ,
56
+ } ] ,
57
+
58
+ "quote-props" : [ "warn" , "as-needed" ] ,
59
+
60
+ "brace-style" : [ "warn" , "1tbs" , {
61
+ allowSingleLine : true ,
62
+ } ] ,
63
+
64
+ curly : [ "warn" , "multi-line" ] ,
65
+ "no-with" : "warn" ,
66
+ "dot-notation" : "warn" ,
67
+ semi : [ "warn" , "always" ] ,
68
+ "no-var" : "warn" ,
69
+ } ,
70
+ } ] ;
0 commit comments