@so1ve/eslint-config 4.1.0 → 4.1.1

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 +6 -7
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -12,10 +12,10 @@ 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";
15
+ import fs from "node:fs/promises";
16
16
  import process$1 from "node:process";
17
17
  import { fileURLToPath } from "node:url";
18
- import fs from "node:fs";
18
+ import fs$1 from "node:fs";
19
19
  import path from "node:path";
20
20
  import tseslint from "typescript-eslint";
21
21
  import { FlatConfigComposer } from "eslint-flat-config-utils";
@@ -1513,7 +1513,7 @@ async function findUp(name$1, { cwd = process$1.cwd(), type = "file", stopAt } =
1513
1513
  while (directory) {
1514
1514
  const filePath = isAbsoluteName ? name$1 : path.join(directory, name$1);
1515
1515
  try {
1516
- const stats = await fsPromises.stat(filePath);
1516
+ const stats = await fs.stat(filePath);
1517
1517
  if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) return filePath;
1518
1518
  } catch {}
1519
1519
  if (directory === stopAt || directory === root) break;
@@ -1528,7 +1528,7 @@ function findUpSync(name$1, { cwd = process$1.cwd(), type = "file", stopAt } = {
1528
1528
  while (directory) {
1529
1529
  const filePath = isAbsoluteName ? name$1 : path.join(directory, name$1);
1530
1530
  try {
1531
- const stats = fs.statSync(filePath, { throwIfNoEntry: false });
1531
+ const stats = fs$1.statSync(filePath, { throwIfNoEntry: false });
1532
1532
  if (type === "file" && stats?.isFile() || type === "directory" && stats?.isDirectory()) return filePath;
1533
1533
  } catch {}
1534
1534
  if (directory === stopAt || directory === root) break;
@@ -1541,7 +1541,7 @@ function findUpSync(name$1, { cwd = process$1.cwd(), type = "file", stopAt } = {
1541
1541
  async function detectCatalogUsage() {
1542
1542
  const workspaceFile = await findUp("pnpm-workspace.yaml");
1543
1543
  if (!workspaceFile) return false;
1544
- const yaml$1 = await fsPromises.readFile(workspaceFile, "utf-8");
1544
+ const yaml$1 = await fs.readFile(workspaceFile, "utf-8");
1545
1545
  return yaml$1.includes("catalog:") || yaml$1.includes("catalogs:");
1546
1546
  }
1547
1547
  async function pnpm(options) {
@@ -2033,7 +2033,6 @@ const unicorn = () => [{
2033
2033
  "unicorn/prefer-spread": "error",
2034
2034
  "unicorn/prefer-string-slice": "error",
2035
2035
  "unicorn/prefer-string-starts-ends-with": "error",
2036
- "unicorn/prefer-ternary": "error",
2037
2036
  "unicorn/prefer-type-error": "error",
2038
2037
  "unicorn/relative-url-style": ["error", "always"],
2039
2038
  "unicorn/require-module-specifiers": "error",
@@ -2285,7 +2284,7 @@ function so1ve(options = {}, ...userConfigs) {
2285
2284
  const { astro: enableAstro = isPackageExists("astro"), componentExts = [], gitignore: enableGitignore = true, ignores: userIgnores = [], pnpm: enablePnpm = !!findUpSync("pnpm-workspace.yaml"), solid: enableSolid = isPackageExists("solid-js"), typescript: enableTypeScript = isPackageExists("typescript"), vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
2286
2285
  const configs$1 = [];
2287
2286
  if (enableGitignore) if (typeof enableGitignore === "boolean") {
2288
- if (fs.existsSync(".gitignore")) configs$1.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r()]));
2287
+ if (fs$1.existsSync(".gitignore")) configs$1.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r()]));
2289
2288
  } else configs$1.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r(enableGitignore)]));
2290
2289
  configs$1.push(ignores(userIgnores), javascript({ overrides: getOverrides(options, "javascript") }), comments(), node(), onlyError(), promise(), sortImports(), imports(), unicorn(), command(), deMorgan());
2291
2290
  if (enablePnpm) configs$1.push(pnpm({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@so1ve/eslint-config",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
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.0"
79
+ "@so1ve/eslint-plugin": "4.1.1"
80
80
  },
81
81
  "devDependencies": {
82
82
  "eslint-plugin-de-morgan": "^2.0.0",