@jgarber/eslint-config 9.0.0 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +69 -138
  2. package/package.json +21 -12
package/index.js CHANGED
@@ -1,76 +1,70 @@
1
- import { cwd } from "node:process";
2
1
  import { resolve } from "node:path";
3
2
 
3
+ import { defineConfig } from "eslint/config";
4
4
  import { includeIgnoreFile } from "@eslint/compat";
5
- import js from "@eslint/js";
6
- import stylistic from "@stylistic/eslint-plugin";
7
5
 
8
6
  import arrayFunc from "eslint-plugin-array-func";
9
- import jsdoc from "eslint-plugin-jsdoc";
10
- import n from "eslint-plugin-n";
11
- import regexp from "eslint-plugin-regexp";
7
+ import js from "@eslint/js";
12
8
  import sortClassMembers from "eslint-plugin-sort-class-members";
9
+ import stylistic from "@stylistic/eslint-plugin";
13
10
 
14
- export default [
11
+ export default defineConfig([
15
12
  /**
16
13
  * @see {@link https://eslint.org/docs/latest/use/configure/ignore#including-gitignore-files}
17
14
  */
18
- includeIgnoreFile(resolve(cwd(), ".gitignore")),
19
-
20
- /**
21
- * @see {@link https://www.npmjs.com/package/eslint-plugin-jsdoc}
22
- */
23
- jsdoc.configs["flat/recommended"],
24
-
25
- /**
26
- * @see {@link https://www.npmjs.com/package/@eslint/js}
27
- * @see {@link https://eslint.org/docs/latest/rules/}
28
- */
29
- js.configs.recommended,
30
-
31
- /**
32
- * @see {@link https://eslint.style/guide/config-presets}
33
- * @see {@link https://eslint.style/packages/default}
34
- * @see {@link https://github.com/eslint-stylistic/eslint-stylistic/blob/main/packages/eslint-plugin/configs/customize.ts}
35
- */
36
- stylistic.configs.customize({
37
- braceStyle: "1tbs",
38
- jsx: false,
39
- quotes: "double",
40
- semi: true,
41
- }),
42
-
43
- /**
44
- * @see {@link https://www.npmjs.com/package/eslint-plugin-array-func}
45
- */
46
- arrayFunc.configs.all,
47
-
48
- /**
49
- * @see {@link https://www.npmjs.com/package/eslint-plugin-n}
50
- */
51
- n.configs["flat/recommended"],
52
-
53
- /**
54
- * @see {@link https://www.npmjs.com/package/eslint-plugin-regexp}
55
- */
56
- regexp.configs["flat/recommended"],
57
-
58
- /**
59
- * @see {@link https://www.npmjs.com/package/eslint-plugin-sort-class-members}
60
- */
61
- sortClassMembers.configs["flat/recommended"],
15
+ includeIgnoreFile(resolve(".gitignore")),
62
16
 
63
17
  /**
64
18
  * @see {@link https://www.npmjs.com/package/@jgarber/eslint-config}
65
19
  */
66
20
  {
21
+ extends: [
22
+ "js/recommended",
23
+ "stylistic/recommended",
24
+ "arrayFunc/all",
25
+ "sortClassMembers/flat/recommended",
26
+ ],
27
+
28
+ plugins: {
29
+ arrayFunc,
30
+ js,
31
+ sortClassMembers,
32
+ stylistic,
33
+ },
34
+
67
35
  rules: {
36
+ /**
37
+ * Enforce sorted import declarations within modules.
38
+ *
39
+ * @see {@link https://eslint.org/docs/latest/rules/sort-imports}
40
+ */
41
+ "sort-imports": ["error", {
42
+ allowSeparatedGroups: true,
43
+ }],
44
+
45
+ /**
46
+ * Require object keys to be sorted.
47
+ *
48
+ * @see {@link https://eslint.org/docs/latest/rules/sort-keys}
49
+ */
50
+ "sort-keys": ["error", "asc", {
51
+ allowLineSeparatedGroups: true,
52
+ natural: true,
53
+ }],
54
+
68
55
  /**
69
56
  * Enforce consistent line breaks between array elements.
70
57
  *
71
58
  * @see {@link https://eslint.style/rules/default/array-element-newline}
72
59
  */
73
- "@stylistic/array-element-newline": ["error", "consistent"],
60
+ "stylistic/array-element-newline": ["error", "consistent"],
61
+
62
+ /**
63
+ * Enforce consistent brace style for blocks.
64
+ *
65
+ * @see {@link https://eslint.style/rules/default/brace-style}
66
+ */
67
+ "stylistic/brace-style": ["error", "1tbs"],
74
68
 
75
69
  /**
76
70
  * Enforce consistent usage of line breaks between arguments of a function
@@ -78,7 +72,7 @@ export default [
78
72
  *
79
73
  * @see {@link https://eslint.style/rules/js/function-call-argument-newline}
80
74
  */
81
- "@stylistic/function-call-argument-newline": ["error", "consistent"],
75
+ "stylistic/function-call-argument-newline": ["error", "consistent"],
82
76
 
83
77
  /**
84
78
  * Disallow spaces between the function name and the opening parenthesis
@@ -86,7 +80,7 @@ export default [
86
80
  *
87
81
  * @see {@link https://eslint.style/rules/default/function-call-spacing}
88
82
  */
89
- "@stylistic/function-call-spacing": ["error"],
83
+ "stylistic/function-call-spacing": "error",
90
84
 
91
85
  /**
92
86
  * Enforce a consistent location for an arrow function containing an
@@ -94,15 +88,7 @@ export default [
94
88
  *
95
89
  * @see {@link https://eslint.style/rules/default/implicit-arrow-linebreak}
96
90
  */
97
- "@stylistic/implicit-arrow-linebreak": "error",
98
-
99
- /**
100
- * Enforce consistent line endings independent of operating system, VCS,
101
- * or editor.
102
- *
103
- * @see {@link https://eslint.style/rules/default/linebreak-style}
104
- */
105
- "@stylistic/linebreak-style": "warn",
91
+ "stylistic/implicit-arrow-linebreak": "error",
106
92
 
107
93
  /**
108
94
  * Enforce a maximum line length to increase code readability and
@@ -110,53 +96,50 @@ export default [
110
96
  *
111
97
  * @see {@link https://eslint.style/rules/default/max-len}
112
98
  */
113
- "@stylistic/max-len": ["warn", {
99
+ "stylistic/max-len": ["warn", {
114
100
  code: 120,
115
101
  comments: 80,
116
102
  ignoreUrls: true,
117
- tabWidth: 2,
118
103
  }],
119
104
 
120
105
  /**
121
- * Disallow unnecessary semicolons.
106
+ * Warns against using the arrow function syntax in places where it could
107
+ * be confused with a comparison operator.
122
108
  *
123
- * @see {@link https://eslint.style/rules/default/no-extra-semi}
109
+ * @see {@link https://eslint.style/rules/default/no-confusing-arrow}
124
110
  */
125
- "@stylistic/no-extra-semi": "error",
111
+ "stylistic/no-confusing-arrow": "warn",
126
112
 
127
113
  /**
128
- * Warns against using the arrow function syntax in places where it could
129
- * be confused with a comparison operator.
114
+ * Disallow unnecessary semicolons.
130
115
  *
131
- * @see {@link https://eslint.style/rules/default/no-confusing-arrow}
116
+ * @see {@link https://eslint.style/rules/default/no-extra-semi}
132
117
  */
133
- "@stylistic/no-confusing-arrow": "warn",
118
+ "stylistic/no-extra-semi": "error",
134
119
 
135
120
  /**
136
121
  * Enforce a consistent linebreak style for operators.
137
122
  *
138
123
  * @see {@link https://eslint.style/rules/default/operator-linebreak}
139
124
  */
140
- "@stylistic/operator-linebreak": ["error", "after"],
125
+ "stylistic/operator-linebreak": ["error", "after"],
141
126
 
142
127
  /**
143
- * Disallow quotes around object literal property names that are not
144
- * strictly required.
128
+ * Enforce the consistent use of quotes.
145
129
  *
146
- * @see {@link https://eslint.style/rules/default/quote-props}
130
+ * @see {@link https://eslint.style/rules/default/quotes}
147
131
  */
148
- "@stylistic/quote-props": ["error", "as-needed"],
132
+ "stylistic/quotes": ["error", "double", {
133
+ allowTemplateLiterals: "avoidEscape",
134
+ avoidEscape: true,
135
+ }],
149
136
 
150
137
  /**
151
- * Enforce consistent spacing before function parentheses.
138
+ * Enforce consistent use of semicolons.
152
139
  *
153
- * @see {@link https://eslint.style/rules/js/space-before-function-paren}
140
+ * @see {@link https://eslint.style/rules/default/semi}
154
141
  */
155
- "@stylistic/space-before-function-paren": ["error", {
156
- anonymous: "never",
157
- asyncArrow: "always",
158
- named: "never",
159
- }],
142
+ "stylistic/semi": ["error", "always"],
160
143
 
161
144
  /**
162
145
  * Control spacing around colons of `case` and `default` clauses in
@@ -164,59 +147,7 @@ export default [
164
147
  *
165
148
  * @see {@link https://eslint.style/rules/default/switch-colon-spacing}
166
149
  */
167
- "@stylistic/switch-colon-spacing": "error",
168
-
169
- /**
170
- * Sorts tags by a specified sequence according to tag name, optionally
171
- * adding line breaks between tag groups.
172
- *
173
- * @see {@link https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/rules/sort-tags.md}
174
- */
175
- "jsdoc/sort-tags": ["warn", { alphabetizeExtras: true }],
176
-
177
- /**
178
- * Enforce lines (or no lines) between tags.
179
- *
180
- * @see {@link https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/rules/tag-lines.md}
181
- */
182
- "jsdoc/tag-lines": ["warn", "any", { startLines: 1 }],
183
-
184
- /*
185
- * Disallow unsupported Node.js built-in APIs on the specified version .
186
- *
187
- * @see {@link https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/node-builtins.md}
188
- */
189
- "n/no-unsupported-features/node-builtins": ["error", {
190
- allowExperimental: true,
191
- }],
192
-
193
- /**
194
- * Disallow unused variables.
195
- *
196
- * @see {@link https://eslint.org/docs/latest/rules/no-unused-vars}
197
- */
198
- "no-unused-vars": ["error", {
199
- argsIgnorePattern: "^_",
200
- destructuredArrayIgnorePattern: "^_",
201
- }],
202
-
203
- /**
204
- * Enforce sorted import declarations within modules.
205
- *
206
- * @see {@link https://eslint.org/docs/latest/rules/sort-imports}
207
- */
208
- "sort-imports": ["error", { allowSeparatedGroups: true }],
209
-
210
- /**
211
- * Require object keys to be sorted.
212
- *
213
- * @see {@link https://eslint.org/docs/latest/rules/sort-keys}
214
- */
215
- "sort-keys": ["error", "asc", {
216
- allowLineSeparatedGroups: true,
217
- caseSensitive: false,
218
- natural: true,
219
- }],
150
+ "stylistic/switch-colon-spacing": "error",
220
151
  },
221
152
  },
222
- ];
153
+ ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jgarber/eslint-config",
3
- "version": "9.0.0",
3
+ "version": "11.0.0",
4
4
  "description": "Shareable ESLint configuration.",
5
5
  "keywords": [
6
6
  "config",
@@ -26,23 +26,32 @@
26
26
  "test": "NODE_V8_COVERAGE=coverage node --experimental-test-coverage --test"
27
27
  },
28
28
  "dependencies": {
29
- "@eslint/compat": "^1.3.1",
30
- "@eslint/js": "^9.30.1",
31
- "@stylistic/eslint-plugin": "^5.1.0",
32
- "eslint-plugin-array-func": "^5.0.2",
33
- "eslint-plugin-jsdoc": "^51.3.4",
34
- "eslint-plugin-n": "^17.21.0",
35
- "eslint-plugin-regexp": "^2.9.0",
36
- "eslint-plugin-sort-class-members": "^1.21.0"
29
+ "@eslint/compat": "^2.0.5",
30
+ "@eslint/js": "^10.0.1",
31
+ "@stylistic/eslint-plugin": "^5.10.0",
32
+ "eslint-plugin-array-func": "^5.1.1",
33
+ "eslint-plugin-sort-class-members": "^1.22.1"
37
34
  },
38
35
  "devDependencies": {
39
- "eslint": "^9.30.1"
36
+ "eslint": "^10.2.0"
40
37
  },
41
38
  "peerDependencies": {
42
- "eslint": ">=9.30.1"
39
+ "eslint": "^10.2.0"
43
40
  },
44
41
  "engines": {
45
- "node": "^20.11.0 || >=21.2.0"
42
+ "node": "^20.19.0 || ^22.13.0 || >=24"
43
+ },
44
+ "devEngines": {
45
+ "packageManager": {
46
+ "name": "npm",
47
+ "onFail": "warn",
48
+ "version": "11.11.0"
49
+ },
50
+ "runtime": {
51
+ "name": "node",
52
+ "onFail": "warn",
53
+ "version": "24.14.1"
54
+ }
46
55
  },
47
56
  "publishConfig": {
48
57
  "access": "public"