@so1ve/eslint-config 4.1.2 → 4.1.4

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/dist/index.mjs +3 -33
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -12,7 +12,6 @@ import * as pluginRegexp from "eslint-plugin-regexp";
12
12
  import pluginUnicorn from "eslint-plugin-unicorn";
13
13
  import pluginUnusedImports from "eslint-plugin-unused-imports";
14
14
  import globals from "globals";
15
- import fsPromises from "node:fs/promises";
16
15
  import process$1 from "node:process";
17
16
  import { fileURLToPath } from "node:url";
18
17
  import fs from "node:fs";
@@ -1505,21 +1504,6 @@ async function perfectionist() {
1505
1504
  //#endregion
1506
1505
  //#region ../../node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.js
1507
1506
  const toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
1508
- async function findUp(name$1, { cwd = process$1.cwd(), type = "file", stopAt } = {}) {
1509
- let directory = path.resolve(toPath(cwd) ?? "");
1510
- const { root } = path.parse(directory);
1511
- stopAt = path.resolve(directory, toPath(stopAt ?? root));
1512
- const isAbsoluteName = path.isAbsolute(name$1);
1513
- while (directory) {
1514
- const filePath = isAbsoluteName ? name$1 : path.join(directory, name$1);
1515
- try {
1516
- const stats = await fsPromises.stat(filePath);
1517
- if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) return filePath;
1518
- } catch {}
1519
- if (directory === stopAt || directory === root) break;
1520
- directory = path.dirname(directory);
1521
- }
1522
- }
1523
1507
  function findUpSync(name$1, { cwd = process$1.cwd(), type = "file", stopAt } = {}) {
1524
1508
  let directory = path.resolve(toPath(cwd) ?? "");
1525
1509
  const { root } = path.parse(directory);
@@ -1538,14 +1522,8 @@ function findUpSync(name$1, { cwd = process$1.cwd(), type = "file", stopAt } = {
1538
1522
 
1539
1523
  //#endregion
1540
1524
  //#region src/configs/pnpm.ts
1541
- async function detectCatalogUsage() {
1542
- const workspaceFile = await findUp("pnpm-workspace.yaml");
1543
- if (!workspaceFile) return false;
1544
- const yaml$1 = await fsPromises.readFile(workspaceFile, "utf-8");
1545
- return yaml$1.includes("catalog:") || yaml$1.includes("catalogs:");
1546
- }
1547
1525
  async function pnpm(options) {
1548
- const { catalogs = await detectCatalogUsage(), json = true, yaml: yaml$1 = true } = options;
1526
+ const { json = true, yaml: yaml$1 = true } = options;
1549
1527
  const [pluginPnpm, yamlParser, jsoncParser] = await Promise.all([
1550
1528
  interopDefault(import("eslint-plugin-pnpm")),
1551
1529
  yaml$1 ? interopDefault(import("yaml-eslint-parser")) : void 0,
@@ -1557,21 +1535,14 @@ async function pnpm(options) {
1557
1535
  languageOptions: { parser: jsoncParser },
1558
1536
  name: "so1ve/pnpm/package-json",
1559
1537
  plugins: { pnpm: pluginPnpm },
1560
- rules: {
1561
- ...catalogs && { "pnpm/json-enforce-catalog": ["error", { ignores: ["@types/vscode"] }] },
1562
- "pnpm/json-prefer-workspace-settings": "error",
1563
- "pnpm/json-valid-catalog": "error"
1564
- }
1538
+ rules: { "pnpm/json-prefer-workspace-settings": "error" }
1565
1539
  });
1566
1540
  if (yaml$1) configs$1.push({
1567
1541
  files: ["pnpm-workspace.yaml"],
1568
1542
  languageOptions: { parser: yamlParser },
1569
1543
  name: "so1ve/pnpm/pnpm-workspace-yaml",
1570
1544
  plugins: { pnpm: pluginPnpm },
1571
- rules: {
1572
- "pnpm/yaml-enforce-settings": ["error", { settings: { shellEmulator: true } }],
1573
- "pnpm/yaml-no-unused-catalog-item": "error"
1574
- }
1545
+ rules: { "pnpm/yaml-enforce-settings": ["error", { settings: { shellEmulator: true } }] }
1575
1546
  }, {
1576
1547
  files: ["pnpm-workspace.yaml"],
1577
1548
  name: "so1ve/yaml/pnpm-workspace-yaml-sort",
@@ -1997,7 +1968,6 @@ const unicorn = () => [{
1997
1968
  "unicorn/explicit-length-check": "error",
1998
1969
  "unicorn/new-for-builtins": "error",
1999
1970
  "unicorn/no-array-for-each": "error",
2000
- "unicorn/no-array-method-this-argument": "error",
2001
1971
  "unicorn/no-await-expression-member": "error",
2002
1972
  "unicorn/no-await-in-promise-methods": "error",
2003
1973
  "unicorn/no-for-loop": "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@so1ve/eslint-config",
3
- "version": "4.1.2",
3
+ "version": "4.1.4",
4
4
  "author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
5
5
  "type": "module",
6
6
  "description": "Ray's eslint config.",
@@ -76,7 +76,7 @@
76
76
  "typescript-eslint": "^8.50.1",
77
77
  "vue-eslint-parser": "^10.2.0",
78
78
  "yaml-eslint-parser": "^1.3.2",
79
- "@so1ve/eslint-plugin": "4.1.2"
79
+ "@so1ve/eslint-plugin": "4.1.4"
80
80
  },
81
81
  "devDependencies": {
82
82
  "eslint-plugin-de-morgan": "^2.0.0",