@vinicunca/eslint-config 5.1.0 → 5.3.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/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { FlatConfigComposer } from "eslint-flat-config-utils";
2
2
  import process from "node:process";
3
- import fs from "node:fs/promises";
3
+ import fsPromises from "node:fs/promises";
4
4
  import { fileURLToPath } from "node:url";
5
- import fs$1 from "node:fs";
5
+ import fs from "node:fs";
6
6
  import path from "node:path";
7
7
  import { isPackageExists } from "local-pkg";
8
8
  import createCommand from "eslint-plugin-command/config";
@@ -18,17 +18,17 @@ import pluginUnusedImports from "eslint-plugin-unused-imports";
18
18
  import globals from "globals";
19
19
  import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
20
20
  import { configs } from "eslint-plugin-regexp";
21
- //#region node_modules/.pnpm/@vinicunca+perkakas@1.13.2/node_modules/@vinicunca/perkakas/dist/is-boolean.js
21
+ //#region node_modules/.pnpm/@vinicunca+perkakas@1.16.0/node_modules/@vinicunca/perkakas/dist/is-boolean.js
22
22
  function e$2(e) {
23
23
  return typeof e == `boolean`;
24
24
  }
25
25
  //#endregion
26
- //#region node_modules/.pnpm/@vinicunca+perkakas@1.13.2/node_modules/@vinicunca/perkakas/dist/is-function.js
26
+ //#region node_modules/.pnpm/@vinicunca+perkakas@1.16.0/node_modules/@vinicunca/perkakas/dist/is-function.js
27
27
  function e$1(e) {
28
28
  return typeof e == `function`;
29
29
  }
30
30
  //#endregion
31
- //#region node_modules/.pnpm/@vinicunca+perkakas@1.13.2/node_modules/@vinicunca/perkakas/dist/is-number.js
31
+ //#region node_modules/.pnpm/@vinicunca+perkakas@1.16.0/node_modules/@vinicunca/perkakas/dist/is-number.js
32
32
  function e(e) {
33
33
  return typeof e == `number` && !Number.isNaN(e);
34
34
  }
@@ -43,7 +43,7 @@ async function findUp(name, { cwd = process.cwd(), type = "file", stopAt } = {})
43
43
  while (directory) {
44
44
  const filePath = isAbsoluteName ? name : path.join(directory, name);
45
45
  try {
46
- const stats = await fs.stat(filePath);
46
+ const stats = await fsPromises.stat(filePath);
47
47
  if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) return filePath;
48
48
  } catch {}
49
49
  if (directory === stopAt || directory === root) break;
@@ -58,7 +58,7 @@ function findUpSync(name, { cwd = process.cwd(), type = "file", stopAt } = {}) {
58
58
  while (directory) {
59
59
  const filePath = isAbsoluteName ? name : path.join(directory, name);
60
60
  try {
61
- const stats = fs$1.statSync(filePath, { throwIfNoEntry: false });
61
+ const stats = fs.statSync(filePath, { throwIfNoEntry: false });
62
62
  if (type === "file" && stats?.isFile() || type === "directory" && stats?.isDirectory()) return filePath;
63
63
  } catch {}
64
64
  if (directory === stopAt || directory === root) break;
@@ -1249,7 +1249,7 @@ async function perfectionist(options) {
1249
1249
  async function detectCatalogUsage() {
1250
1250
  const workspaceFile = await findUp("pnpm-workspace.yaml");
1251
1251
  if (!workspaceFile) return false;
1252
- const yaml = await fs.readFile(workspaceFile, "utf-8");
1252
+ const yaml = await fsPromises.readFile(workspaceFile, "utf-8");
1253
1253
  return yaml.includes("catalog:") || yaml.includes("catalogs:");
1254
1254
  }
1255
1255
  async function pnpm(options) {
@@ -2084,7 +2084,7 @@ async function typescript(options = {}) {
2084
2084
  }] : [],
2085
2085
  ...erasableOnly ? [{
2086
2086
  name: "antfu/typescript/erasable-syntax-only",
2087
- plugins: { "erasable-syntax-only": await interopDefault(import("./lib-BXrNxJq9.mjs")) },
2087
+ plugins: { "erasable-syntax-only": await interopDefault(import("./lib-CfwQEgoO.mjs")) },
2088
2088
  rules: {
2089
2089
  "erasable-syntax-only/enums": ERROR,
2090
2090
  "erasable-syntax-only/import-aliases": ERROR,
@@ -2098,8 +2098,11 @@ async function typescript(options = {}) {
2098
2098
  //#region src/configs/unicorn.ts
2099
2099
  async function unicorn(options = {}) {
2100
2100
  return [{
2101
+ name: "vinicunca/unicorn/setup",
2102
+ plugins: { unicorn: pluginUnicorn }
2103
+ }, {
2104
+ files: [GLOB_SRC],
2101
2105
  name: "vinicunca/unicorn/rules",
2102
- plugins: { unicorn: pluginUnicorn },
2103
2106
  rules: { ...options.allRecommended ? pluginUnicorn.configs.recommended.rules : {
2104
2107
  "unicorn/consistent-empty-array-spread": ERROR,
2105
2108
  "unicorn/error-message": ERROR,