@html-validate/eslint-config 5.27.0 → 5.28.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.
package/dist/cli.js CHANGED
@@ -8895,7 +8895,7 @@ var require_package = __commonJS({
8895
8895
  "package.json"(exports2, module2) {
8896
8896
  module2.exports = {
8897
8897
  name: "@html-validate/eslint-config",
8898
- version: "5.26.6",
8898
+ version: "5.27.0",
8899
8899
  description: "Eslint sharable config used by the various HTML-validate packages",
8900
8900
  keywords: [
8901
8901
  "eslint"
@@ -8911,7 +8911,7 @@ var require_package = __commonJS({
8911
8911
  },
8912
8912
  license: "MIT",
8913
8913
  author: "David Sveningsson <ext@sidvind.com>",
8914
- main: "index.js",
8914
+ main: "index.mjs",
8915
8915
  bin: {
8916
8916
  eslint: "eslint.js",
8917
8917
  "eslint-config": "cli.js"
@@ -8921,6 +8921,8 @@ var require_package = __commonJS({
8921
8921
  "patch",
8922
8922
  "template",
8923
8923
  "*.js",
8924
+ "*.cjs",
8925
+ "*.mjs",
8924
8926
  "!*.spec.js"
8925
8927
  ],
8926
8928
  scripts: {
@@ -8931,6 +8933,8 @@ var require_package = __commonJS({
8931
8933
  prepublishOnly: "release-prepublish --retain-scripts"
8932
8934
  },
8933
8935
  dependencies: {
8936
+ "@eslint/eslintrc": "3.3.0",
8937
+ "@eslint/js": "9.21.0",
8934
8938
  "@rushstack/eslint-patch": "1.10.5",
8935
8939
  eslint: "8.57.1",
8936
8940
  "eslint-config-prettier": "10.1.1",
@@ -8949,7 +8953,7 @@ var require_package = __commonJS({
8949
8953
  devDependencies: {
8950
8954
  argparse: "2.0.1",
8951
8955
  "find-up": "7.0.0",
8952
- "internal-prettier": "5.26.6",
8956
+ "internal-prettier": "5.27.0",
8953
8957
  nunjucks: "3.2.4"
8954
8958
  },
8955
8959
  peerDependencies: {
@@ -9038,6 +9042,12 @@ var Queue = class {
9038
9042
  current = current.next;
9039
9043
  }
9040
9044
  }
9045
+ *drain() {
9046
+ let current;
9047
+ while ((current = this.dequeue()) !== void 0) {
9048
+ yield current;
9049
+ }
9050
+ }
9041
9051
  };
9042
9052
 
9043
9053
  // node_modules/p-limit/index.js
@@ -9354,13 +9364,22 @@ async function ensurePkgScript(script, command, options) {
9354
9364
  }
9355
9365
  async function writeConfig(options, features) {
9356
9366
  await ensureFileRemoved(".eslintrc.json", options);
9357
- if (import_fs2.default.existsSync(import_path2.default.join(options.rootDir, ".eslintrc.js"))) {
9358
- console.log(`Deprecated: project uses ".eslintrc.js" instead of ".eslintrc.cjs".`);
9359
- await ensureFileExists(".eslintrc.js", options, features);
9367
+ if (options.flat) {
9368
+ await ensureFileRemoved(".eslintrc.js", options);
9369
+ await ensureFileRemoved(".eslintrc.cjs", options);
9370
+ await ensureFileRemoved(".eslintignore", options);
9371
+ await ensureFileExists("eslint.config.mjs", options, features);
9360
9372
  } else {
9361
- await ensureFileExists(".eslintrc.cjs", options, features);
9373
+ await ensureFileRemoved("eslint.config.js", options);
9374
+ await ensureFileRemoved("eslint.config.mjs", options);
9375
+ if (import_fs2.default.existsSync(import_path2.default.join(options.rootDir, ".eslintrc.js"))) {
9376
+ console.log(`Deprecated: project uses ".eslintrc.js" instead of ".eslintrc.cjs".`);
9377
+ await ensureFileExists(".eslintrc.js", options, features);
9378
+ } else {
9379
+ await ensureFileExists(".eslintrc.cjs", options, features);
9380
+ }
9381
+ await ensureFileExists(".eslintignore", options, features);
9362
9382
  }
9363
- await ensureFileExists(".eslintignore", options, features);
9364
9383
  await ensurePkgScript("eslint", "eslint --cache .", options);
9365
9384
  await ensurePkgScript("eslint:fix", "eslint --cache --fix .", options);
9366
9385
  await ensureDependencyRemoved("eslint", options);
@@ -9413,6 +9432,7 @@ async function run(args2) {
9413
9432
  const rootDir = await getRootDir();
9414
9433
  const options = {
9415
9434
  rootDir,
9435
+ flat: args2.flat,
9416
9436
  dryRun: args2.mode === "check",
9417
9437
  changes: 0
9418
9438
  };
@@ -9440,6 +9460,11 @@ parser.add_argument("-c", "--check", {
9440
9460
  dest: "mode",
9441
9461
  help: "Check if configuration is up-to-date"
9442
9462
  });
9463
+ parser.add_argument("--flat-config", {
9464
+ action: "store_true",
9465
+ dest: "flat",
9466
+ help: "Enable experimental support for ESLint flat configuration"
9467
+ });
9443
9468
  parser.add_argument("--disable-cypress", {
9444
9469
  action: "store_const",
9445
9470
  const: false,