1
1
module . exports = {
2
+ root : true ,
2
3
env : {
3
4
browser : true ,
4
5
greasemonkey : true ,
5
6
es2021 : true ,
6
7
} ,
8
+ parserOptions : {
9
+ ecmaVersion : "latest" ,
10
+ } ,
11
+ extends : [
12
+ "plugin:@cspell/recommended" ,
13
+ "plugin:security/recommended-legacy" ,
14
+
15
+ // Display Prettier errors as ESLint errors.
16
+ // Enables eslint-plugin-prettier and eslint-config-prettier.
17
+ "plugin:prettier/recommended" ,
18
+
19
+ //! Prettier should always be the last configuration in the extends array.
20
+ ] ,
21
+ rules : { } ,
7
22
overrides : [
8
- {
9
- env : {
10
- node : true ,
11
- } ,
12
- files : [ ".eslintrc.{js,cjs}" ] ,
13
- parserOptions : {
14
- sourceType : "script" ,
15
- } ,
16
- } ,
23
+ /*
24
+ * Userscript files.
25
+ */
17
26
{
18
27
files : [ "*.user.js" ] ,
19
28
extends : [ "plugin:userscripts/recommended" ] ,
20
- rules : { } ,
29
+ rules : {
30
+ "userscripts/better-use-match" : "off" , // Disable this warning for now.
31
+ } ,
21
32
settings : {
22
33
userscriptVersions : {
23
34
tampermonkey : ">=4" ,
@@ -26,9 +37,87 @@ module.exports = {
26
37
} ,
27
38
} ,
28
39
} ,
40
+
41
+ /*
42
+ * JSON files.
43
+ */
44
+ {
45
+ files : [ "*.json" ] ,
46
+ extends : [
47
+ "plugin:json/recommended-with-comments" ,
48
+
49
+ // Display Prettier errors as ESLint errors.
50
+ // Enables eslint-plugin-prettier and eslint-config-prettier.
51
+ "plugin:prettier/recommended" ,
52
+
53
+ //! Prettier should always be the last configuration in the extends array.
54
+ ] ,
55
+ } ,
56
+
57
+ /*
58
+ * `package.json` file.
59
+ * This needs it's own configuration, because it doesn't work together with `plugin:json`.
60
+ * See https://github.com/kellyselden/eslint-plugin-json-files/issues/40
61
+ * Must be after `*.json`.
62
+ */
63
+ {
64
+ files : [ "package.json" ] ,
65
+ plugins : [ "json-files" ] ,
66
+ extends : [
67
+ // Display Prettier errors as ESLint errors.
68
+ // Enables eslint-plugin-prettier and eslint-config-prettier.
69
+ "plugin:prettier/recommended" ,
70
+
71
+ //! Prettier should always be the last configuration in the extends array.
72
+ ] ,
73
+ rules : {
74
+ "json-files/ensure-repository-directory" : "error" ,
75
+ "json-files/no-branch-in-dependencies" : "error" ,
76
+ "json-files/require-engines" : "error" ,
77
+ "json-files/require-license" : "error" ,
78
+ "json-files/require-unique-dependency-names" : "error" ,
79
+ "json-files/sort-package-json" : "error" ,
80
+ } ,
81
+ } ,
82
+
83
+ /*
84
+ * Markdown files.
85
+ */
86
+ {
87
+ files : [ "*.md" ] ,
88
+ parser : "eslint-plugin-markdownlint/parser" ,
89
+ extends : [
90
+ "plugin:markdownlint/recommended" ,
91
+
92
+ // Display Prettier errors as ESLint errors.
93
+ // Enables eslint-plugin-prettier and eslint-config-prettier.
94
+ "plugin:prettier/recommended" ,
95
+
96
+ //! Prettier should always be the last configuration in the extends array.
97
+ ] ,
98
+ rules : {
99
+ "markdownlint/md007" : [
100
+ "error" ,
101
+ {
102
+ indent : 4 ,
103
+ } ,
104
+ ] , // For compatibility with Prettier.
105
+ "markdownlint/md030" : [
106
+ "error" ,
107
+ {
108
+ ol_multi : 3 ,
109
+ ol_single : 3 ,
110
+ ul_multi : 3 ,
111
+ ul_single : 3 ,
112
+ } ,
113
+ ] , // For compatibility with Prettier.
114
+ "markdownlint/md013" : "off" , // Disable line length.
115
+ "markdownlint/md033" : [
116
+ "error" ,
117
+ { allowed_elements : [ "br" , "sup" , "kbd" ] } ,
118
+ ] ,
119
+ "prettier/prettier" : [ "error" , { parser : "markdown" } ] ,
120
+ } ,
121
+ } ,
29
122
] ,
30
- parserOptions : {
31
- ecmaVersion : "latest" ,
32
- } ,
33
- rules : { } ,
34
123
} ;
0 commit comments