@jgarber/eslint-config 10.0.0 → 11.1.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 -140
  2. package/package.json +20 -12
package/index.js CHANGED
@@ -1,76 +1,68 @@
1
- import { cwd } from "node:process";
2
1
  import { resolve } from "node:path";
3
2
 
4
- import { includeIgnoreFile } from "@eslint/compat";
5
- import js from "@eslint/js";
6
- import stylistic from "@stylistic/eslint-plugin";
7
-
3
+ import { defineConfig, includeIgnoreFile } from "eslint/config";
8
4
  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";
5
+ import js from "@eslint/js";
12
6
  import sortClassMembers from "eslint-plugin-sort-class-members";
7
+ import stylistic from "@stylistic/eslint-plugin";
13
8
 
14
- export default [
9
+ export default defineConfig([
15
10
  /**
16
11
  * @see {@link https://eslint.org/docs/latest/use/configure/ignore#including-gitignore-files}
17
12
  */
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"],
13
+ includeIgnoreFile(resolve(".gitignore")),
62
14
 
63
15
  /**
64
16
  * @see {@link https://www.npmjs.com/package/@jgarber/eslint-config}
65
17
  */
66
18
  {
19
+ extends: [
20
+ "js/recommended",
21
+ "stylistic/recommended",
22
+ "arrayFunc/all",
23
+ "sortClassMembers/flat/recommended",
24
+ ],
25
+
26
+ plugins: {
27
+ arrayFunc,
28
+ js,
29
+ sortClassMembers,
30
+ stylistic,
31
+ },
32
+
67
33
  rules: {
34
+ /**
35
+ * Enforce sorted import declarations within modules.
36
+ *
37
+ * @see {@link https://eslint.org/docs/latest/rules/sort-imports}
38
+ */
39
+ "sort-imports": ["error", {
40
+ allowSeparatedGroups: true,
41
+ }],
42
+
43
+ /**
44
+ * Require object keys to be sorted.
45
+ *
46
+ * @see {@link https://eslint.org/docs/latest/rules/sort-keys}
47
+ */
48
+ "sort-keys": ["error", "asc", {
49
+ allowLineSeparatedGroups: true,
50
+ natural: true,
51
+ }],
52
+
68
53
  /**
69
54
  * Enforce consistent line breaks between array elements.
70
55
  *
71
56
  * @see {@link https://eslint.style/rules/default/array-element-newline}
72
57
  */
73
- "@stylistic/array-element-newline": ["error", "consistent"],
58
+ "stylistic/array-element-newline": ["error", "consistent"],
59
+
60
+ /**
61
+ * Enforce consistent brace style for blocks.
62
+ *
63
+ * @see {@link https://eslint.style/rules/default/brace-style}
64
+ */
65
+ "stylistic/brace-style": ["error", "1tbs"],
74
66
 
75
67
  /**
76
68
  * Enforce consistent usage of line breaks between arguments of a function
@@ -78,7 +70,7 @@ export default [
78
70
  *
79
71
  * @see {@link https://eslint.style/rules/js/function-call-argument-newline}
80
72
  */
81
- "@stylistic/function-call-argument-newline": ["error", "consistent"],
73
+ "stylistic/function-call-argument-newline": ["error", "consistent"],
82
74
 
83
75
  /**
84
76
  * Disallow spaces between the function name and the opening parenthesis
@@ -86,7 +78,7 @@ export default [
86
78
  *
87
79
  * @see {@link https://eslint.style/rules/default/function-call-spacing}
88
80
  */
89
- "@stylistic/function-call-spacing": ["error"],
81
+ "stylistic/function-call-spacing": "error",
90
82
 
91
83
  /**
92
84
  * Enforce a consistent location for an arrow function containing an
@@ -94,15 +86,7 @@ export default [
94
86
  *
95
87
  * @see {@link https://eslint.style/rules/default/implicit-arrow-linebreak}
96
88
  */
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",
89
+ "stylistic/implicit-arrow-linebreak": "error",
106
90
 
107
91
  /**
108
92
  * Enforce a maximum line length to increase code readability and
@@ -110,53 +94,50 @@ export default [
110
94
  *
111
95
  * @see {@link https://eslint.style/rules/default/max-len}
112
96
  */
113
- "@stylistic/max-len": ["warn", {
97
+ "stylistic/max-len": ["warn", {
114
98
  code: 120,
115
99
  comments: 80,
116
100
  ignoreUrls: true,
117
- tabWidth: 2,
118
101
  }],
119
102
 
120
103
  /**
121
- * Disallow unnecessary semicolons.
104
+ * Warns against using the arrow function syntax in places where it could
105
+ * be confused with a comparison operator.
122
106
  *
123
- * @see {@link https://eslint.style/rules/default/no-extra-semi}
107
+ * @see {@link https://eslint.style/rules/default/no-confusing-arrow}
124
108
  */
125
- "@stylistic/no-extra-semi": "error",
109
+ "stylistic/no-confusing-arrow": "warn",
126
110
 
127
111
  /**
128
- * Warns against using the arrow function syntax in places where it could
129
- * be confused with a comparison operator.
112
+ * Disallow unnecessary semicolons.
130
113
  *
131
- * @see {@link https://eslint.style/rules/default/no-confusing-arrow}
114
+ * @see {@link https://eslint.style/rules/default/no-extra-semi}
132
115
  */
133
- "@stylistic/no-confusing-arrow": "warn",
116
+ "stylistic/no-extra-semi": "error",
134
117
 
135
118
  /**
136
119
  * Enforce a consistent linebreak style for operators.
137
120
  *
138
121
  * @see {@link https://eslint.style/rules/default/operator-linebreak}
139
122
  */
140
- "@stylistic/operator-linebreak": ["error", "after"],
123
+ "stylistic/operator-linebreak": ["error", "after"],
141
124
 
142
125
  /**
143
- * Disallow quotes around object literal property names that are not
144
- * strictly required.
126
+ * Enforce the consistent use of quotes.
145
127
  *
146
- * @see {@link https://eslint.style/rules/default/quote-props}
128
+ * @see {@link https://eslint.style/rules/default/quotes}
147
129
  */
148
- "@stylistic/quote-props": ["error", "as-needed"],
130
+ "stylistic/quotes": ["error", "double", {
131
+ allowTemplateLiterals: "avoidEscape",
132
+ avoidEscape: true,
133
+ }],
149
134
 
150
135
  /**
151
- * Enforce consistent spacing before function parentheses.
136
+ * Enforce consistent use of semicolons.
152
137
  *
153
- * @see {@link https://eslint.style/rules/js/space-before-function-paren}
138
+ * @see {@link https://eslint.style/rules/default/semi}
154
139
  */
155
- "@stylistic/space-before-function-paren": ["error", {
156
- anonymous: "never",
157
- asyncArrow: "always",
158
- named: "never",
159
- }],
140
+ "stylistic/semi": ["error", "always"],
160
141
 
161
142
  /**
162
143
  * Control spacing around colons of `case` and `default` clauses in
@@ -164,59 +145,7 @@ export default [
164
145
  *
165
146
  * @see {@link https://eslint.style/rules/default/switch-colon-spacing}
166
147
  */
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
- }],
148
+ "stylistic/switch-colon-spacing": "error",
220
149
  },
221
150
  },
222
- ];
151
+ ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jgarber/eslint-config",
3
- "version": "10.0.0",
3
+ "version": "11.1.0",
4
4
  "description": "Shareable ESLint configuration.",
5
5
  "keywords": [
6
6
  "config",
@@ -26,23 +26,31 @@
26
26
  "test": "NODE_V8_COVERAGE=coverage node --experimental-test-coverage --test"
27
27
  },
28
28
  "dependencies": {
29
- "@eslint/compat": "^1.4.0",
30
- "@eslint/js": "^9.37.0",
31
- "@stylistic/eslint-plugin": "^5.4.0",
32
- "eslint-plugin-array-func": "^5.1.0",
33
- "eslint-plugin-jsdoc": "^61.1.4",
34
- "eslint-plugin-n": "^17.23.1",
35
- "eslint-plugin-regexp": "^2.10.0",
36
- "eslint-plugin-sort-class-members": "^1.21.0"
29
+ "@eslint/js": "^10.0.1",
30
+ "@stylistic/eslint-plugin": "^5.10.0",
31
+ "eslint-plugin-array-func": "^5.1.1",
32
+ "eslint-plugin-sort-class-members": "^1.22.1"
37
33
  },
38
34
  "devDependencies": {
39
- "eslint": "^9.37.0"
35
+ "eslint": "^10.5.0"
40
36
  },
41
37
  "peerDependencies": {
42
- "eslint": ">=9.37.0"
38
+ "eslint": "^10.5.0"
43
39
  },
44
40
  "engines": {
45
- "node": "^20.11.0 || >=21.2.0"
41
+ "node": "^20.19.0 || ^22.13.0 || >=24"
42
+ },
43
+ "devEngines": {
44
+ "packageManager": {
45
+ "name": "npm",
46
+ "onFail": "warn",
47
+ "version": "11.13.0"
48
+ },
49
+ "runtime": {
50
+ "name": "node",
51
+ "onFail": "warn",
52
+ "version": "24.16.0"
53
+ }
46
54
  },
47
55
  "publishConfig": {
48
56
  "access": "public"