@solvro/config 1.0.5 → 1.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.
@@ -5,6 +5,12 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __esm = (fn, res) => function __init() {
9
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ };
11
+ var __commonJS = (cb, mod) => function __require() {
12
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
+ };
8
14
  var __export = (target, all) => {
9
15
  for (var name in all)
10
16
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -27,6 +33,229 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
33
  ));
28
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
35
 
36
+ // node_modules/tsup/assets/cjs_shims.js
37
+ var getImportMetaUrl, importMetaUrl;
38
+ var init_cjs_shims = __esm({
39
+ "node_modules/tsup/assets/cjs_shims.js"() {
40
+ "use strict";
41
+ getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
42
+ importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
43
+ }
44
+ });
45
+
46
+ // node_modules/eslint-config-prettier/index.js
47
+ var require_eslint_config_prettier = __commonJS({
48
+ "node_modules/eslint-config-prettier/index.js"(exports2, module2) {
49
+ "use strict";
50
+ init_cjs_shims();
51
+ var includeDeprecated = !process.env.ESLINT_CONFIG_PRETTIER_NO_DEPRECATED;
52
+ var specialRule = 0;
53
+ module2.exports = {
54
+ rules: {
55
+ // The following rules can be used in some cases. See the README for more
56
+ // information. These are marked with `0` instead of `"off"` so that a
57
+ // script can distinguish them. Note that there are a few more of these
58
+ // in the deprecated section below.
59
+ "curly": specialRule,
60
+ "no-unexpected-multiline": specialRule,
61
+ "@typescript-eslint/lines-around-comment": specialRule,
62
+ "@typescript-eslint/quotes": specialRule,
63
+ "babel/quotes": specialRule,
64
+ "unicorn/template-indent": specialRule,
65
+ "vue/html-self-closing": specialRule,
66
+ "vue/max-len": specialRule,
67
+ // The rest are rules that you never need to enable when using Prettier.
68
+ "@babel/object-curly-spacing": "off",
69
+ "@babel/semi": "off",
70
+ "@typescript-eslint/block-spacing": "off",
71
+ "@typescript-eslint/brace-style": "off",
72
+ "@typescript-eslint/comma-dangle": "off",
73
+ "@typescript-eslint/comma-spacing": "off",
74
+ "@typescript-eslint/func-call-spacing": "off",
75
+ "@typescript-eslint/indent": "off",
76
+ "@typescript-eslint/key-spacing": "off",
77
+ "@typescript-eslint/keyword-spacing": "off",
78
+ "@typescript-eslint/member-delimiter-style": "off",
79
+ "@typescript-eslint/no-extra-parens": "off",
80
+ "@typescript-eslint/no-extra-semi": "off",
81
+ "@typescript-eslint/object-curly-spacing": "off",
82
+ "@typescript-eslint/semi": "off",
83
+ "@typescript-eslint/space-before-blocks": "off",
84
+ "@typescript-eslint/space-before-function-paren": "off",
85
+ "@typescript-eslint/space-infix-ops": "off",
86
+ "@typescript-eslint/type-annotation-spacing": "off",
87
+ "babel/object-curly-spacing": "off",
88
+ "babel/semi": "off",
89
+ "flowtype/boolean-style": "off",
90
+ "flowtype/delimiter-dangle": "off",
91
+ "flowtype/generic-spacing": "off",
92
+ "flowtype/object-type-curly-spacing": "off",
93
+ "flowtype/object-type-delimiter": "off",
94
+ "flowtype/quotes": "off",
95
+ "flowtype/semi": "off",
96
+ "flowtype/space-after-type-colon": "off",
97
+ "flowtype/space-before-generic-bracket": "off",
98
+ "flowtype/space-before-type-colon": "off",
99
+ "flowtype/union-intersection-spacing": "off",
100
+ "react/jsx-child-element-spacing": "off",
101
+ "react/jsx-closing-bracket-location": "off",
102
+ "react/jsx-closing-tag-location": "off",
103
+ "react/jsx-curly-newline": "off",
104
+ "react/jsx-curly-spacing": "off",
105
+ "react/jsx-equals-spacing": "off",
106
+ "react/jsx-first-prop-new-line": "off",
107
+ "react/jsx-indent": "off",
108
+ "react/jsx-indent-props": "off",
109
+ "react/jsx-max-props-per-line": "off",
110
+ "react/jsx-newline": "off",
111
+ "react/jsx-one-expression-per-line": "off",
112
+ "react/jsx-props-no-multi-spaces": "off",
113
+ "react/jsx-tag-spacing": "off",
114
+ "react/jsx-wrap-multilines": "off",
115
+ "standard/array-bracket-even-spacing": "off",
116
+ "standard/computed-property-even-spacing": "off",
117
+ "standard/object-curly-even-spacing": "off",
118
+ "unicorn/empty-brace-spaces": "off",
119
+ "unicorn/no-nested-ternary": "off",
120
+ "unicorn/number-literal-case": "off",
121
+ "vue/array-bracket-newline": "off",
122
+ "vue/array-bracket-spacing": "off",
123
+ "vue/array-element-newline": "off",
124
+ "vue/arrow-spacing": "off",
125
+ "vue/block-spacing": "off",
126
+ "vue/block-tag-newline": "off",
127
+ "vue/brace-style": "off",
128
+ "vue/comma-dangle": "off",
129
+ "vue/comma-spacing": "off",
130
+ "vue/comma-style": "off",
131
+ "vue/dot-location": "off",
132
+ "vue/func-call-spacing": "off",
133
+ "vue/html-closing-bracket-newline": "off",
134
+ "vue/html-closing-bracket-spacing": "off",
135
+ "vue/html-end-tags": "off",
136
+ "vue/html-indent": "off",
137
+ "vue/html-quotes": "off",
138
+ "vue/key-spacing": "off",
139
+ "vue/keyword-spacing": "off",
140
+ "vue/max-attributes-per-line": "off",
141
+ "vue/multiline-html-element-content-newline": "off",
142
+ "vue/multiline-ternary": "off",
143
+ "vue/mustache-interpolation-spacing": "off",
144
+ "vue/no-extra-parens": "off",
145
+ "vue/no-multi-spaces": "off",
146
+ "vue/no-spaces-around-equal-signs-in-attribute": "off",
147
+ "vue/object-curly-newline": "off",
148
+ "vue/object-curly-spacing": "off",
149
+ "vue/object-property-newline": "off",
150
+ "vue/operator-linebreak": "off",
151
+ "vue/quote-props": "off",
152
+ "vue/script-indent": "off",
153
+ "vue/singleline-html-element-content-newline": "off",
154
+ "vue/space-in-parens": "off",
155
+ "vue/space-infix-ops": "off",
156
+ "vue/space-unary-ops": "off",
157
+ "vue/template-curly-spacing": "off",
158
+ ...includeDeprecated && {
159
+ // Removed in version 0.10.0.
160
+ // https://eslint.org/docs/latest/rules/space-unary-word-ops
161
+ "space-unary-word-ops": "off",
162
+ // Removed in version 1.0.0.
163
+ // https://github.com/eslint/eslint/issues/1898
164
+ "generator-star": "off",
165
+ "no-comma-dangle": "off",
166
+ "no-reserved-keys": "off",
167
+ "no-space-before-semi": "off",
168
+ "no-wrap-func": "off",
169
+ "space-after-function-name": "off",
170
+ "space-before-function-parentheses": "off",
171
+ "space-in-brackets": "off",
172
+ // Removed in version 2.0.0.
173
+ // https://github.com/eslint/eslint/issues/5032
174
+ "no-arrow-condition": "off",
175
+ "space-after-keywords": "off",
176
+ "space-before-keywords": "off",
177
+ "space-return-throw-case": "off",
178
+ // Deprecated since version 3.3.0.
179
+ // https://eslint.org/docs/rules/no-spaced-func
180
+ "no-spaced-func": "off",
181
+ // Deprecated since version 4.0.0.
182
+ // https://github.com/eslint/eslint/pull/8286
183
+ "indent-legacy": "off",
184
+ // Deprecated since version 8.53.0.
185
+ // https://eslint.org/blog/2023/10/deprecating-formatting-rules/
186
+ "array-bracket-newline": "off",
187
+ "array-bracket-spacing": "off",
188
+ "array-element-newline": "off",
189
+ "arrow-parens": "off",
190
+ "arrow-spacing": "off",
191
+ "block-spacing": "off",
192
+ "brace-style": "off",
193
+ "comma-dangle": "off",
194
+ "comma-spacing": "off",
195
+ "comma-style": "off",
196
+ "computed-property-spacing": "off",
197
+ "dot-location": "off",
198
+ "eol-last": "off",
199
+ "func-call-spacing": "off",
200
+ "function-call-argument-newline": "off",
201
+ "function-paren-newline": "off",
202
+ "generator-star-spacing": "off",
203
+ "implicit-arrow-linebreak": "off",
204
+ "indent": "off",
205
+ "jsx-quotes": "off",
206
+ "key-spacing": "off",
207
+ "keyword-spacing": "off",
208
+ "linebreak-style": "off",
209
+ "lines-around-comment": specialRule,
210
+ "max-len": specialRule,
211
+ "max-statements-per-line": "off",
212
+ "multiline-ternary": "off",
213
+ "new-parens": "off",
214
+ "newline-per-chained-call": "off",
215
+ "no-confusing-arrow": specialRule,
216
+ "no-extra-parens": "off",
217
+ "no-extra-semi": "off",
218
+ "no-floating-decimal": "off",
219
+ "no-mixed-operators": specialRule,
220
+ "no-mixed-spaces-and-tabs": "off",
221
+ "no-multi-spaces": "off",
222
+ "no-multiple-empty-lines": "off",
223
+ "no-tabs": specialRule,
224
+ "no-trailing-spaces": "off",
225
+ "no-whitespace-before-property": "off",
226
+ "nonblock-statement-body-position": "off",
227
+ "object-curly-newline": "off",
228
+ "object-curly-spacing": "off",
229
+ "object-property-newline": "off",
230
+ "one-var-declaration-per-line": "off",
231
+ "operator-linebreak": "off",
232
+ "padded-blocks": "off",
233
+ "quote-props": "off",
234
+ "quotes": specialRule,
235
+ "rest-spread-spacing": "off",
236
+ "semi": "off",
237
+ "semi-spacing": "off",
238
+ "semi-style": "off",
239
+ "space-before-blocks": "off",
240
+ "space-before-function-paren": "off",
241
+ "space-in-parens": "off",
242
+ "space-infix-ops": "off",
243
+ "space-unary-ops": "off",
244
+ "switch-colon-spacing": "off",
245
+ "template-curly-spacing": "off",
246
+ "template-tag-spacing": "off",
247
+ "wrap-iife": "off",
248
+ "wrap-regex": "off",
249
+ "yield-star-spacing": "off",
250
+ // Deprecated since version 7.0.0.
251
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#700---2017-05-06
252
+ "react/jsx-space-before-closing": "off"
253
+ }
254
+ }
255
+ };
256
+ }
257
+ });
258
+
30
259
  // eslint-config/index.ts
31
260
  var eslint_config_exports = {};
32
261
  __export(eslint_config_exports, {
@@ -53,7 +282,6 @@ __export(eslint_config_exports, {
53
282
  command: () => command,
54
283
  comments: () => comments,
55
284
  default: () => eslint_config_default,
56
- defaultPluginRenaming: () => defaultPluginRenaming,
57
285
  disables: () => disables,
58
286
  ensurePackages: () => ensurePackages,
59
287
  formatters: () => formatters,
@@ -72,8 +300,6 @@ __export(eslint_config_exports, {
72
300
  parserPlain: () => parserPlain,
73
301
  react: () => react,
74
302
  regexp: () => regexp,
75
- renamePluginInConfigs: () => renamePluginInConfigs,
76
- renameRules: () => renameRules,
77
303
  resolveSubOptions: () => resolveSubOptions,
78
304
  solvro: () => solvro,
79
305
  test: () => test,
@@ -82,16 +308,18 @@ __export(eslint_config_exports, {
82
308
  unicorn: () => unicorn
83
309
  });
84
310
  module.exports = __toCommonJS(eslint_config_exports);
85
-
86
- // node_modules/tsup/assets/cjs_shims.js
87
- var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
88
- var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
311
+ init_cjs_shims();
89
312
 
90
313
  // eslint-config/factory.ts
314
+ init_cjs_shims();
91
315
  var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
92
316
  var import_local_pkg3 = require("local-pkg");
93
317
 
318
+ // eslint-config/configs/index.ts
319
+ init_cjs_shims();
320
+
94
321
  // eslint-config/configs/command.ts
322
+ init_cjs_shims();
95
323
  var import_config = __toESM(require("eslint-plugin-command/config"), 1);
96
324
  async function command() {
97
325
  return [
@@ -102,7 +330,11 @@ async function command() {
102
330
  ];
103
331
  }
104
332
 
333
+ // eslint-config/configs/comments.ts
334
+ init_cjs_shims();
335
+
105
336
  // eslint-config/plugins.ts
337
+ init_cjs_shims();
106
338
  var import_eslint_plugin_eslint_comments = __toESM(require("@eslint-community/eslint-plugin-eslint-comments"), 1);
107
339
  var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
108
340
  var pluginImport = __toESM(require("eslint-plugin-import-x"), 1);
@@ -129,7 +361,11 @@ async function comments() {
129
361
  ];
130
362
  }
131
363
 
364
+ // eslint-config/configs/disables.ts
365
+ init_cjs_shims();
366
+
132
367
  // eslint-config/globs.ts
368
+ init_cjs_shims();
133
369
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
134
370
  var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
135
371
  var GLOB_JS = "**/*.?([cm])js";
@@ -205,7 +441,7 @@ async function disables() {
205
441
  rules: {
206
442
  "antfu/no-top-level-await": "off",
207
443
  "no-console": "off",
208
- "ts/explicit-function-return-type": "off"
444
+ "@typescript-eslint/explicit-function-return-type": "off"
209
445
  }
210
446
  },
211
447
  {
@@ -229,7 +465,7 @@ async function disables() {
229
465
  name: "solvro/disables/dts",
230
466
  rules: {
231
467
  "eslint-comments/no-unlimited-disable": "off",
232
- "import/no-duplicates": "off",
468
+ "import-x/no-duplicates": "off",
233
469
  "no-restricted-syntax": "off",
234
470
  "unused-imports/no-unused-vars": "off"
235
471
  }
@@ -238,7 +474,7 @@ async function disables() {
238
474
  files: ["**/*.js", "**/*.cjs"],
239
475
  name: "solvro/disables/cjs",
240
476
  rules: {
241
- "ts/no-require-imports": "off"
477
+ "@typescript-eslint/no-require-imports": "off"
242
478
  }
243
479
  },
244
480
  {
@@ -247,18 +483,90 @@ async function disables() {
247
483
  rules: {
248
484
  "antfu/no-top-level-await": "off",
249
485
  "no-console": "off",
250
- "ts/explicit-function-return-type": "off"
486
+ "@typescript-eslint/explicit-function-return-type": "off"
251
487
  }
252
488
  }
253
489
  ];
254
490
  }
255
491
 
492
+ // eslint-config/configs/formatters.ts
493
+ init_cjs_shims();
494
+
495
+ // eslint-config/utils.ts
496
+ init_cjs_shims();
497
+ var import_local_pkg = require("local-pkg");
498
+ var import_node_process = __toESM(require("process"), 1);
499
+ var import_node_url = require("url");
500
+ var scopeUrl = (0, import_node_url.fileURLToPath)(new URL(".", importMetaUrl));
501
+ var isCwdInScope = (0, import_local_pkg.isPackageExists)("@solvro/config");
502
+ var parserPlain = {
503
+ meta: {
504
+ name: "parser-plain"
505
+ },
506
+ parseForESLint: (code) => ({
507
+ ast: {
508
+ body: [],
509
+ comments: [],
510
+ loc: { end: code.length, start: 0 },
511
+ range: [0, code.length],
512
+ tokens: [],
513
+ type: "Program"
514
+ },
515
+ scopeManager: null,
516
+ services: { isPlain: true },
517
+ visitorKeys: {
518
+ Program: []
519
+ }
520
+ })
521
+ };
522
+ async function combine(...configs2) {
523
+ const resolved = await Promise.all(configs2);
524
+ return resolved.flat();
525
+ }
526
+ function toArray(value) {
527
+ return Array.isArray(value) ? value : [value];
528
+ }
529
+ async function interopDefault(m) {
530
+ const resolved = await m;
531
+ return resolved.default || resolved;
532
+ }
533
+ function isPackageInScope(name) {
534
+ return (0, import_local_pkg.isPackageExists)(name, { paths: [scopeUrl] });
535
+ }
536
+ async function ensurePackages(packages) {
537
+ if (import_node_process.default.env.CI || import_node_process.default.stdout.isTTY === false || isCwdInScope === false)
538
+ return;
539
+ const nonExistingPackages = packages.filter(
540
+ (i) => i && !isPackageInScope(i)
541
+ );
542
+ if (nonExistingPackages.length === 0) return;
543
+ const p = await import("@clack/prompts");
544
+ const result = await p.confirm({
545
+ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
546
+ });
547
+ if (result)
548
+ await import("@antfu/install-pkg").then(
549
+ (i) => i.installPackage(nonExistingPackages, { dev: true })
550
+ );
551
+ }
552
+ function isInEditorEnv() {
553
+ if (import_node_process.default.env.CI) return false;
554
+ if (isInGitHooksOrLintStaged()) return false;
555
+ return !!(import_node_process.default.env.VSCODE_PID || import_node_process.default.env.VSCODE_CWD || import_node_process.default.env.JETBRAINS_IDE || import_node_process.default.env.VIM || import_node_process.default.env.NVIM);
556
+ }
557
+ function isInGitHooksOrLintStaged() {
558
+ return !!(import_node_process.default.env.GIT_PARAMS || import_node_process.default.env.VSCODE_GIT_COMMAND || import_node_process.default.env.npm_lifecycle_script?.startsWith("lint-staged"));
559
+ }
560
+
256
561
  // eslint-config/configs/formatters.ts
257
562
  async function formatters() {
258
- return [];
563
+ await ensurePackages(["eslint-plugin-prettier"]);
564
+ const prettierConfig = await interopDefault(Promise.resolve().then(() => __toESM(require_eslint_config_prettier(), 1)));
565
+ return [prettierConfig];
259
566
  }
260
567
 
261
568
  // eslint-config/configs/ignores.ts
569
+ init_cjs_shims();
262
570
  async function ignores(userIgnores = []) {
263
571
  return [
264
572
  {
@@ -269,30 +577,32 @@ async function ignores(userIgnores = []) {
269
577
  }
270
578
 
271
579
  // eslint-config/configs/imports.ts
580
+ init_cjs_shims();
272
581
  async function imports() {
273
582
  return [
274
583
  {
275
584
  name: "solvro/imports/rules",
276
585
  plugins: {
277
586
  antfu: import_eslint_plugin_antfu.default,
278
- import: pluginImport
587
+ "import-x": pluginImport
279
588
  },
280
589
  rules: {
281
590
  "antfu/import-dedupe": "error",
282
591
  "antfu/no-import-dist": "error",
283
592
  "antfu/no-import-node-modules-by-path": "error",
284
- "import/first": "error",
285
- "import/no-duplicates": "error",
286
- "import/no-mutable-exports": "error",
287
- "import/no-named-default": "error",
288
- "import/no-self-import": "error",
289
- "import/no-webpack-loader-syntax": "error"
593
+ "import-x/first": "error",
594
+ "import-x/no-duplicates": "error",
595
+ "import-x/no-mutable-exports": "error",
596
+ "import-x/no-named-default": "error",
597
+ "import-x/no-self-import": "error",
598
+ "import-x/no-webpack-loader-syntax": "error"
290
599
  }
291
600
  }
292
601
  ];
293
602
  }
294
603
 
295
604
  // eslint-config/configs/javascript.ts
605
+ init_cjs_shims();
296
606
  var import_globals = __toESM(require("globals"), 1);
297
607
  async function javascript(options = {}) {
298
608
  const { isInEditor = false, overrides = {} } = options;
@@ -528,98 +838,8 @@ async function javascript(options = {}) {
528
838
  ];
529
839
  }
530
840
 
531
- // eslint-config/utils.ts
532
- var import_local_pkg = require("local-pkg");
533
- var import_node_process = __toESM(require("process"), 1);
534
- var import_node_url = require("url");
535
- var scopeUrl = (0, import_node_url.fileURLToPath)(new URL(".", importMetaUrl));
536
- var isCwdInScope = (0, import_local_pkg.isPackageExists)("@solvro/config");
537
- var parserPlain = {
538
- meta: {
539
- name: "parser-plain"
540
- },
541
- parseForESLint: (code) => ({
542
- ast: {
543
- body: [],
544
- comments: [],
545
- loc: { end: code.length, start: 0 },
546
- range: [0, code.length],
547
- tokens: [],
548
- type: "Program"
549
- },
550
- scopeManager: null,
551
- services: { isPlain: true },
552
- visitorKeys: {
553
- Program: []
554
- }
555
- })
556
- };
557
- async function combine(...configs2) {
558
- const resolved = await Promise.all(configs2);
559
- return resolved.flat();
560
- }
561
- function renameRules(rules, map) {
562
- return Object.fromEntries(
563
- Object.entries(rules).map(([key, value]) => {
564
- for (const [from, to] of Object.entries(map)) {
565
- if (key.startsWith(`${from}/`))
566
- return [to + key.slice(from.length), value];
567
- }
568
- return [key, value];
569
- })
570
- );
571
- }
572
- function renamePluginInConfigs(configs2, map) {
573
- return configs2.map((i) => {
574
- const clone = { ...i };
575
- if (clone.rules) clone.rules = renameRules(clone.rules, map);
576
- if (clone.plugins) {
577
- clone.plugins = Object.fromEntries(
578
- Object.entries(clone.plugins).map(([key, value]) => {
579
- if (key in map) return [map[key], value];
580
- return [key, value];
581
- })
582
- );
583
- }
584
- return clone;
585
- });
586
- }
587
- function toArray(value) {
588
- return Array.isArray(value) ? value : [value];
589
- }
590
- async function interopDefault(m) {
591
- const resolved = await m;
592
- return resolved.default || resolved;
593
- }
594
- function isPackageInScope(name) {
595
- return (0, import_local_pkg.isPackageExists)(name, { paths: [scopeUrl] });
596
- }
597
- async function ensurePackages(packages) {
598
- if (import_node_process.default.env.CI || import_node_process.default.stdout.isTTY === false || isCwdInScope === false)
599
- return;
600
- const nonExistingPackages = packages.filter(
601
- (i) => i && !isPackageInScope(i)
602
- );
603
- if (nonExistingPackages.length === 0) return;
604
- const p = await import("@clack/prompts");
605
- const result = await p.confirm({
606
- message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
607
- });
608
- if (result)
609
- await import("@antfu/install-pkg").then(
610
- (i) => i.installPackage(nonExistingPackages, { dev: true })
611
- );
612
- }
613
- function isInEditorEnv() {
614
- if (import_node_process.default.env.CI) return false;
615
- if (isInGitHooksOrLintStaged()) return false;
616
- return !!(import_node_process.default.env.VSCODE_PID || import_node_process.default.env.VSCODE_CWD || import_node_process.default.env.JETBRAINS_IDE || import_node_process.default.env.VIM || import_node_process.default.env.NVIM);
617
- }
618
- function isInGitHooksOrLintStaged() {
619
- return !!(import_node_process.default.env.GIT_PARAMS || import_node_process.default.env.VSCODE_GIT_COMMAND || import_node_process.default.env.npm_lifecycle_script?.startsWith("lint-staged"));
620
- }
621
-
622
841
  // eslint-config/configs/jsdoc.ts
842
+ init_cjs_shims();
623
843
  async function jsdoc() {
624
844
  return [
625
845
  {
@@ -649,6 +869,7 @@ async function jsdoc() {
649
869
  }
650
870
 
651
871
  // eslint-config/configs/jsx.ts
872
+ init_cjs_shims();
652
873
  async function jsx() {
653
874
  return [
654
875
  {
@@ -666,6 +887,7 @@ async function jsx() {
666
887
  }
667
888
 
668
889
  // eslint-config/configs/markdown.ts
890
+ init_cjs_shims();
669
891
  var import_eslint_merge_processors = require("eslint-merge-processors");
670
892
  async function markdown(options = {}) {
671
893
  const {
@@ -715,7 +937,6 @@ async function markdown(options = {}) {
715
937
  name: "solvro/markdown/disables",
716
938
  rules: {
717
939
  "antfu/no-top-level-await": "off",
718
- "import/newline-after-import": "off",
719
940
  "no-alert": "off",
720
941
  "no-console": "off",
721
942
  "no-labels": "off",
@@ -726,16 +947,14 @@ async function markdown(options = {}) {
726
947
  "no-unused-labels": "off",
727
948
  "no-unused-vars": "off",
728
949
  "node/prefer-global/process": "off",
729
- "style/comma-dangle": "off",
730
- "style/eol-last": "off",
731
- "ts/consistent-type-imports": "off",
732
- "ts/explicit-function-return-type": "off",
733
- "ts/no-namespace": "off",
734
- "ts/no-redeclare": "off",
735
- "ts/no-require-imports": "off",
736
- "ts/no-unused-expressions": "off",
737
- "ts/no-unused-vars": "off",
738
- "ts/no-use-before-define": "off",
950
+ "@typescript-eslint/consistent-type-imports": "off",
951
+ "@typescript-eslint/explicit-function-return-type": "off",
952
+ "@typescript-eslint/no-namespace": "off",
953
+ "@typescript-eslint/no-redeclare": "off",
954
+ "@typescript-eslint/no-require-imports": "off",
955
+ "@typescript-eslint/no-unused-expressions": "off",
956
+ "@typescript-eslint/no-unused-vars": "off",
957
+ "@typescript-eslint/no-use-before-define": "off",
739
958
  "unicode-bom": "off",
740
959
  "unused-imports/no-unused-imports": "off",
741
960
  "unused-imports/no-unused-vars": "off",
@@ -746,6 +965,7 @@ async function markdown(options = {}) {
746
965
  }
747
966
 
748
967
  // eslint-config/configs/node.ts
968
+ init_cjs_shims();
749
969
  async function node() {
750
970
  return [
751
971
  {
@@ -768,6 +988,7 @@ async function node() {
768
988
  }
769
989
 
770
990
  // eslint-config/configs/react.ts
991
+ init_cjs_shims();
771
992
  var import_local_pkg2 = require("local-pkg");
772
993
  var ReactRefreshAllowConstantExportPackages = ["vite"];
773
994
  var NextJsPackages = ["next"];
@@ -780,17 +1001,17 @@ async function react(options = {}) {
780
1001
  tsconfigPath
781
1002
  } = options;
782
1003
  await ensurePackages([
783
- "@eslint-react/eslint-plugin",
1004
+ "eslint-plugin-react",
784
1005
  "eslint-plugin-react-hooks",
785
1006
  "eslint-plugin-react-refresh"
786
1007
  ]);
787
1008
  const isTypeAware = !!tsconfigPath;
788
1009
  const typeAwareRules = {
789
- "react/no-leaked-conditional-rendering": "warn"
1010
+ "react/jsx-no-leaked-render": "warn"
790
1011
  };
791
1012
  const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
792
1013
  [
793
- interopDefault(import("@eslint-react/eslint-plugin")),
1014
+ interopDefault(import("eslint-plugin-react")),
794
1015
  interopDefault(import("eslint-plugin-react-hooks")),
795
1016
  interopDefault(import("eslint-plugin-react-refresh"))
796
1017
  ]
@@ -799,19 +1020,28 @@ async function react(options = {}) {
799
1020
  (i) => (0, import_local_pkg2.isPackageExists)(i)
800
1021
  );
801
1022
  const isUsingNext = NextJsPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i));
802
- const plugins = pluginReact.configs.all.plugins;
1023
+ const nextjsConfig = [];
1024
+ if (isUsingNext) {
1025
+ await ensurePackages(["@next/eslint-plugin-next"]);
1026
+ const nextPlugin = await interopDefault(import("@next/eslint-plugin-next"));
1027
+ nextjsConfig.push({
1028
+ name: "solvro/next/setup",
1029
+ plugins: {
1030
+ "@next/next": nextPlugin
1031
+ },
1032
+ rules: nextPlugin.configs.recommended.rules
1033
+ });
1034
+ }
803
1035
  return [
804
1036
  {
805
1037
  name: "solvro/react/setup",
806
1038
  plugins: {
807
- react: plugins["@eslint-react"],
808
- "react-dom": plugins["@eslint-react/dom"],
1039
+ react: pluginReact,
809
1040
  "react-hooks": pluginReactHooks,
810
- "react-hooks-extra": plugins["@eslint-react/hooks-extra"],
811
- "react-naming-convention": plugins["@eslint-react/naming-convention"],
812
1041
  "react-refresh": pluginReactRefresh
813
1042
  }
814
1043
  },
1044
+ ...nextjsConfig,
815
1045
  {
816
1046
  files,
817
1047
  languageOptions: {
@@ -822,23 +1052,20 @@ async function react(options = {}) {
822
1052
  },
823
1053
  sourceType: "module"
824
1054
  },
1055
+ settings: {
1056
+ react: {
1057
+ version: "detect"
1058
+ }
1059
+ },
825
1060
  name: "solvro/react/rules",
826
1061
  rules: {
827
- // recommended rules from @eslint-react/dom
828
- "react-dom/no-children-in-void-dom-elements": "warn",
829
- "react-dom/no-dangerously-set-innerhtml": "warn",
830
- "react-dom/no-dangerously-set-innerhtml-with-children": "error",
831
- "react-dom/no-find-dom-node": "error",
832
- "react-dom/no-missing-button-type": "warn",
833
- "react-dom/no-missing-iframe-sandbox": "warn",
834
- "react-dom/no-namespace": "error",
835
- "react-dom/no-render-return-value": "error",
836
- "react-dom/no-script-url": "warn",
837
- "react-dom/no-unsafe-iframe-sandbox": "warn",
838
- "react-dom/no-unsafe-target-blank": "warn",
1062
+ ...pluginReact.configs.flat?.recommended.rules,
1063
+ ...pluginReact.configs.flat?.["jsx-runtime"].rules,
839
1064
  // recommended rules react-hooks
840
1065
  "react-hooks/exhaustive-deps": "warn",
841
1066
  "react-hooks/rules-of-hooks": "error",
1067
+ "react/jsx-no-useless-fragment": "error",
1068
+ "react/jsx-no-leaked-render": "warn",
842
1069
  // react refresh
843
1070
  "react-refresh/only-export-components": [
844
1071
  "warn",
@@ -863,43 +1090,6 @@ async function react(options = {}) {
863
1090
  ]
864
1091
  }
865
1092
  ],
866
- // recommended rules from @eslint-react
867
- "react/ensure-forward-ref-using-ref": "warn",
868
- "react/no-access-state-in-setstate": "error",
869
- "react/no-array-index-key": "warn",
870
- "react/no-children-count": "warn",
871
- "react/no-children-for-each": "warn",
872
- "react/no-children-map": "warn",
873
- "react/no-children-only": "warn",
874
- "react/no-children-prop": "warn",
875
- "react/no-children-to-array": "warn",
876
- "react/no-clone-element": "warn",
877
- "react/no-comment-textnodes": "warn",
878
- "react/no-component-will-mount": "error",
879
- "react/no-component-will-receive-props": "error",
880
- "react/no-component-will-update": "error",
881
- "react/no-create-ref": "error",
882
- "react/no-direct-mutation-state": "error",
883
- "react/no-duplicate-key": "error",
884
- "react/no-implicit-key": "error",
885
- "react/no-missing-key": "error",
886
- "react/no-nested-components": "warn",
887
- "react/no-redundant-should-component-update": "error",
888
- "react/no-set-state-in-component-did-mount": "warn",
889
- "react/no-set-state-in-component-did-update": "warn",
890
- "react/no-set-state-in-component-will-update": "warn",
891
- "react/no-string-refs": "error",
892
- "react/no-unsafe-component-will-mount": "warn",
893
- "react/no-unsafe-component-will-receive-props": "warn",
894
- "react/no-unsafe-component-will-update": "warn",
895
- "react/no-unstable-context-value": "error",
896
- "react/no-unstable-default-props": "error",
897
- "react/no-unused-class-component-members": "warn",
898
- "react/no-unused-state": "warn",
899
- "react/no-useless-fragment": "warn",
900
- "react/prefer-destructuring-assignment": "warn",
901
- "react/prefer-shorthand-boolean": "warn",
902
- "react/prefer-shorthand-fragment": "warn",
903
1093
  // overrides
904
1094
  ...overrides
905
1095
  }
@@ -918,6 +1108,7 @@ async function react(options = {}) {
918
1108
  }
919
1109
 
920
1110
  // eslint-config/configs/regexp.ts
1111
+ init_cjs_shims();
921
1112
  var import_eslint_plugin_regexp = require("eslint-plugin-regexp");
922
1113
  async function regexp(options = {}) {
923
1114
  const config = import_eslint_plugin_regexp.configs["flat/recommended"];
@@ -942,6 +1133,7 @@ async function regexp(options = {}) {
942
1133
  }
943
1134
 
944
1135
  // eslint-config/configs/test.ts
1136
+ init_cjs_shims();
945
1137
  var _pluginTest;
946
1138
  async function test(options = {}) {
947
1139
  const { files = GLOB_TESTS, isInEditor = false, overrides = {} } = options;
@@ -962,28 +1154,28 @@ async function test(options = {}) {
962
1154
  {
963
1155
  name: "solvro/test/setup",
964
1156
  plugins: {
965
- test: _pluginTest
1157
+ "no-only-tests": _pluginTest
966
1158
  }
967
1159
  },
968
1160
  {
969
1161
  files,
970
1162
  name: "solvro/test/rules",
971
1163
  rules: {
972
- "test/consistent-test-it": [
1164
+ "no-only-tests/consistent-test-it": [
973
1165
  "error",
974
1166
  { fn: "it", withinDescribe: "it" }
975
1167
  ],
976
- "test/no-identical-title": "error",
977
- "test/no-import-node-test": "error",
978
- "test/no-only-tests": isInEditor ? "off" : "error",
979
- "test/prefer-hooks-in-order": "error",
980
- "test/prefer-lowercase-title": "error",
1168
+ "no-only-tests/no-identical-title": "error",
1169
+ "no-only-tests/no-import-node-test": "error",
1170
+ "no-only-tests/no-only-tests": isInEditor ? "off" : "error",
1171
+ "no-only-tests/prefer-hooks-in-order": "error",
1172
+ "no-only-tests/prefer-lowercase-title": "error",
981
1173
  // Disables
982
1174
  ...{
983
1175
  "antfu/no-top-level-await": "off",
984
1176
  "no-unused-expressions": "off",
985
1177
  "node/prefer-global/process": "off",
986
- "ts/explicit-function-return-type": "off"
1178
+ "@typescript-eslint/explicit-function-return-type": "off"
987
1179
  },
988
1180
  ...overrides
989
1181
  }
@@ -992,6 +1184,7 @@ async function test(options = {}) {
992
1184
  }
993
1185
 
994
1186
  // eslint-config/configs/typescript.ts
1187
+ init_cjs_shims();
995
1188
  var import_node_process2 = __toESM(require("process"), 1);
996
1189
  async function typescript(options = {}) {
997
1190
  const {
@@ -1013,28 +1206,28 @@ async function typescript(options = {}) {
1013
1206
  const typeAwareRules = {
1014
1207
  "dot-notation": "off",
1015
1208
  "no-implied-eval": "off",
1016
- "ts/await-thenable": "error",
1017
- "ts/dot-notation": ["error", { allowKeywords: true }],
1018
- "ts/no-floating-promises": "error",
1019
- "ts/no-for-in-array": "error",
1020
- "ts/no-implied-eval": "error",
1021
- "ts/no-misused-promises": "error",
1022
- "ts/no-unnecessary-type-assertion": "error",
1023
- "ts/no-unsafe-argument": "error",
1024
- "ts/no-unsafe-assignment": "error",
1025
- "ts/no-unsafe-call": "error",
1026
- "ts/no-unsafe-member-access": "error",
1027
- "ts/no-unsafe-return": "error",
1028
- "ts/promise-function-async": "error",
1029
- "ts/restrict-plus-operands": "error",
1030
- "ts/restrict-template-expressions": "error",
1031
- "ts/return-await": ["error", "in-try-catch"],
1032
- "ts/strict-boolean-expressions": [
1209
+ "@typescript-eslint/await-thenable": "error",
1210
+ "@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
1211
+ "@typescript-eslint/no-floating-promises": "error",
1212
+ "@typescript-eslint/no-for-in-array": "error",
1213
+ "@typescript-eslint/no-implied-eval": "error",
1214
+ "@typescript-eslint/no-misused-promises": "error",
1215
+ "@typescript-eslint/no-unnecessary-type-assertion": "error",
1216
+ "@typescript-eslint/no-unsafe-argument": "error",
1217
+ "@typescript-eslint/no-unsafe-assignment": "error",
1218
+ "@typescript-eslint/no-unsafe-call": "error",
1219
+ "@typescript-eslint/no-unsafe-member-access": "error",
1220
+ "@typescript-eslint/no-unsafe-return": "error",
1221
+ "@typescript-eslint/promise-function-async": "error",
1222
+ "@typescript-eslint/restrict-plus-operands": "error",
1223
+ "@typescript-eslint/restrict-template-expressions": "error",
1224
+ "@typescript-eslint/return-await": ["error", "in-try-catch"],
1225
+ "@typescript-eslint/strict-boolean-expressions": [
1033
1226
  "error",
1034
1227
  { allowNullableBoolean: true, allowNullableObject: true }
1035
1228
  ],
1036
- "ts/switch-exhaustiveness-check": "error",
1037
- "ts/unbound-method": "error"
1229
+ "@typescript-eslint/switch-exhaustiveness-check": "error",
1230
+ "@typescript-eslint/unbound-method": "error"
1038
1231
  };
1039
1232
  const [pluginTs, parserTs] = await Promise.all([
1040
1233
  interopDefault(import("@typescript-eslint/eslint-plugin")),
@@ -1068,7 +1261,7 @@ async function typescript(options = {}) {
1068
1261
  name: "solvro/typescript/setup",
1069
1262
  plugins: {
1070
1263
  antfu: import_eslint_plugin_antfu.default,
1071
- ts: pluginTs
1264
+ "@typescript-eslint": pluginTs
1072
1265
  }
1073
1266
  },
1074
1267
  // assign type-aware parser for type-aware files and type-unaware parser for the rest
@@ -1080,42 +1273,43 @@ async function typescript(options = {}) {
1080
1273
  files,
1081
1274
  name: "solvro/typescript/rules",
1082
1275
  rules: {
1083
- ...renameRules(
1084
- pluginTs.configs["eslint-recommended"].overrides[0].rules,
1085
- { "@typescript-eslint": "ts" }
1086
- ),
1087
- ...renameRules(pluginTs.configs.strict.rules, {
1088
- "@typescript-eslint": "ts"
1089
- }),
1276
+ ...pluginTs.configs["eslint-recommended"].overrides[0].rules,
1277
+ ...pluginTs.configs.strict.rules,
1090
1278
  "no-dupe-class-members": "off",
1091
1279
  "no-redeclare": "off",
1092
1280
  "no-use-before-define": "off",
1093
1281
  "no-useless-constructor": "off",
1094
- "ts/ban-ts-comment": [
1282
+ "@typescript-eslint/ban-ts-comment": [
1095
1283
  "error",
1096
1284
  { "ts-expect-error": "allow-with-description" }
1097
1285
  ],
1098
- "ts/consistent-type-definitions": ["error", "interface"],
1099
- "ts/consistent-type-imports": [
1286
+ "@typescript-eslint/consistent-type-definitions": [
1287
+ "error",
1288
+ "interface"
1289
+ ],
1290
+ "@typescript-eslint/consistent-type-imports": [
1100
1291
  "error",
1101
1292
  {
1102
1293
  disallowTypeAnnotations: false,
1103
1294
  prefer: "type-imports"
1104
1295
  }
1105
1296
  ],
1106
- "ts/method-signature-style": ["error", "property"],
1297
+ "@typescript-eslint/method-signature-style": ["error", "property"],
1107
1298
  // https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
1108
- "ts/no-dupe-class-members": "error",
1109
- "ts/no-dynamic-delete": "off",
1110
- "ts/no-empty-object-type": ["error", { allowInterfaces: "always" }],
1111
- "ts/no-explicit-any": "off",
1112
- "ts/no-extraneous-class": "off",
1113
- "ts/no-import-type-side-effects": "error",
1114
- "ts/no-invalid-void-type": "off",
1115
- "ts/no-non-null-assertion": "off",
1116
- "ts/no-redeclare": ["error", { builtinGlobals: false }],
1117
- "ts/no-require-imports": "error",
1118
- "ts/no-unused-expressions": [
1299
+ "@typescript-eslint/no-dupe-class-members": "error",
1300
+ "@typescript-eslint/no-dynamic-delete": "off",
1301
+ "@typescript-eslint/no-empty-object-type": [
1302
+ "error",
1303
+ { allowInterfaces: "always" }
1304
+ ],
1305
+ "@typescript-eslint/no-explicit-any": "off",
1306
+ "@typescript-eslint/no-extraneous-class": "off",
1307
+ "@typescript-eslint/no-import-type-side-effects": "error",
1308
+ "@typescript-eslint/no-invalid-void-type": "off",
1309
+ "@typescript-eslint/no-non-null-assertion": "off",
1310
+ "@typescript-eslint/no-redeclare": ["error", { builtinGlobals: false }],
1311
+ "@typescript-eslint/no-require-imports": "error",
1312
+ "@typescript-eslint/no-unused-expressions": [
1119
1313
  "error",
1120
1314
  {
1121
1315
  allowShortCircuit: true,
@@ -1123,17 +1317,17 @@ async function typescript(options = {}) {
1123
1317
  allowTernary: true
1124
1318
  }
1125
1319
  ],
1126
- "ts/no-unused-vars": "off",
1127
- "ts/no-use-before-define": [
1320
+ "@typescript-eslint/no-unused-vars": "off",
1321
+ "@typescript-eslint/no-use-before-define": [
1128
1322
  "error",
1129
1323
  { classes: false, functions: false, variables: true }
1130
1324
  ],
1131
- "ts/no-useless-constructor": "off",
1132
- "ts/no-wrapper-object-types": "error",
1133
- "ts/triple-slash-reference": "off",
1134
- "ts/unified-signatures": "off",
1325
+ "@typescript-eslint/no-useless-constructor": "off",
1326
+ "@typescript-eslint/no-wrapper-object-types": "error",
1327
+ "@typescript-eslint/triple-slash-reference": "off",
1328
+ "@typescript-eslint/unified-signatures": "off",
1135
1329
  ...type === "lib" ? {
1136
- "ts/explicit-function-return-type": [
1330
+ "@typescript-eslint/explicit-function-return-type": [
1137
1331
  "error",
1138
1332
  {
1139
1333
  allowExpressions: true,
@@ -1160,6 +1354,7 @@ async function typescript(options = {}) {
1160
1354
  }
1161
1355
 
1162
1356
  // eslint-config/configs/unicorn.ts
1357
+ init_cjs_shims();
1163
1358
  async function unicorn(options = {}) {
1164
1359
  return [
1165
1360
  {
@@ -1200,20 +1395,8 @@ var flatConfigProps = [
1200
1395
  "rules",
1201
1396
  "settings"
1202
1397
  ];
1203
- var defaultPluginRenaming = {
1204
- "@eslint-react": "react",
1205
- "@eslint-react/dom": "react-dom",
1206
- "@eslint-react/hooks-extra": "react-hooks-extra",
1207
- "@eslint-react/naming-convention": "react-naming-convention",
1208
- "@typescript-eslint": "ts",
1209
- "import-x": "import",
1210
- n: "node",
1211
- vitest: "test",
1212
- yml: "yaml"
1213
- };
1214
1398
  function solvro(options = {}, ...userConfigs) {
1215
1399
  const {
1216
- autoRenamePlugins = true,
1217
1400
  componentExts = [],
1218
1401
  gitignore: enableGitignore = true,
1219
1402
  jsx: enableJsx = true,
@@ -1326,9 +1509,6 @@ function solvro(options = {}, ...userConfigs) {
1326
1509
  if (Object.keys(fusedConfig).length) configs2.push([fusedConfig]);
1327
1510
  let composer = new import_eslint_flat_config_utils.FlatConfigComposer();
1328
1511
  composer = composer.append(...configs2, ...userConfigs);
1329
- if (autoRenamePlugins) {
1330
- composer = composer.renamePlugins(defaultPluginRenaming);
1331
- }
1332
1512
  return composer;
1333
1513
  }
1334
1514
  function resolveSubOptions(options, key) {
@@ -1342,6 +1522,9 @@ function getOverrides(options, key) {
1342
1522
  };
1343
1523
  }
1344
1524
 
1525
+ // eslint-config/types.ts
1526
+ init_cjs_shims();
1527
+
1345
1528
  // eslint-config/index.ts
1346
1529
  var eslint_config_default = solvro;
1347
1530
  // Annotate the CommonJS export names for ESM import in node:
@@ -1368,7 +1551,6 @@ var eslint_config_default = solvro;
1368
1551
  combine,
1369
1552
  command,
1370
1553
  comments,
1371
- defaultPluginRenaming,
1372
1554
  disables,
1373
1555
  ensurePackages,
1374
1556
  formatters,
@@ -1387,8 +1569,6 @@ var eslint_config_default = solvro;
1387
1569
  parserPlain,
1388
1570
  react,
1389
1571
  regexp,
1390
- renamePluginInConfigs,
1391
- renameRules,
1392
1572
  resolveSubOptions,
1393
1573
  solvro,
1394
1574
  test,