@vinicunca/eslint-config 2.7.0 → 2.7.2

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.js CHANGED
@@ -13,8 +13,6 @@ function e(o) {
13
13
  // src/base.ts
14
14
  import { FlatConfigComposer } from "eslint-flat-config-utils";
15
15
  import { isPackageExists } from "local-pkg";
16
- import fs from "node:fs";
17
- import process2 from "node:process";
18
16
 
19
17
  // src/flags.ts
20
18
  var ERROR = "error";
@@ -124,6 +122,7 @@ var GLOB_EXCLUDE = [
124
122
  ];
125
123
 
126
124
  // src/utils.ts
125
+ import process from "node:process";
127
126
  async function combineConfigs(...configs2) {
128
127
  const resolved = await Promise.all(configs2);
129
128
  return resolved.flat();
@@ -183,8 +182,8 @@ var parserPlain = {
183
182
  }
184
183
  })
185
184
  };
186
- function toArray(value) {
187
- return Array.isArray(value) ? value : [value];
185
+ function isInEditorEnv() {
186
+ return !!((process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM) && !process.env.CI);
188
187
  }
189
188
 
190
189
  // src/configs/stylistic.ts
@@ -1035,18 +1034,21 @@ async function react(options = {}) {
1035
1034
  } = options;
1036
1035
  const [
1037
1036
  pluginReact,
1038
- pluginReactHooks
1037
+ pluginReactHooks,
1038
+ parserTs
1039
1039
  ] = await Promise.all([
1040
+ interopDefault(import("@eslint-react/eslint-plugin")),
1040
1041
  // @ts-expect-error missing types
1041
- interopDefault(import("eslint-plugin-react")),
1042
- // @ts-expect-error missing types
1043
- interopDefault(import("eslint-plugin-react-hooks"))
1042
+ interopDefault(import("eslint-plugin-react-hooks")),
1043
+ interopDefault(import("@typescript-eslint/parser"))
1044
1044
  ]);
1045
+ const plugins = pluginReact.configs.all.plugins;
1045
1046
  return [
1046
1047
  {
1047
1048
  name: "vinicunca/react/setup",
1048
1049
  plugins: {
1049
- "react": pluginReact,
1050
+ "react": plugins["@eslint-react"],
1051
+ "react-dom": plugins["@eslint-react/dom"],
1050
1052
  "react-hooks": pluginReactHooks
1051
1053
  },
1052
1054
  settings: {
@@ -1058,11 +1060,13 @@ async function react(options = {}) {
1058
1060
  {
1059
1061
  files,
1060
1062
  languageOptions: {
1063
+ parser: parserTs,
1061
1064
  parserOptions: {
1062
1065
  ecmaFeatures: {
1063
1066
  jsx: true
1064
1067
  }
1065
- }
1068
+ },
1069
+ sourceType: "module"
1066
1070
  },
1067
1071
  name: "vinicunca/react/rules",
1068
1072
  rules: {
@@ -1420,7 +1424,7 @@ async function test(options = {}) {
1420
1424
  }
1421
1425
 
1422
1426
  // src/configs/typescript.ts
1423
- import process from "node:process";
1427
+ import process2 from "node:process";
1424
1428
  async function typescript(options = {}) {
1425
1429
  const {
1426
1430
  componentExts = [],
@@ -1435,7 +1439,7 @@ async function typescript(options = {}) {
1435
1439
  const ignoresTypeAware = options.ignoresTypeAware ?? [
1436
1440
  `${GLOB_MARKDOWN}/**`
1437
1441
  ];
1438
- const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
1442
+ const tsconfigPath = options?.tsconfigPath ? options.tsconfigPath : void 0;
1439
1443
  const isTypeAware = !!tsconfigPath;
1440
1444
  const typeAwareRules = {
1441
1445
  "dot-notation": OFF,
@@ -1482,7 +1486,7 @@ async function typescript(options = {}) {
1482
1486
  allowDefaultProject: ["./*.js"],
1483
1487
  defaultProject: tsconfigPath
1484
1488
  },
1485
- tsconfigRootDir: process.cwd()
1489
+ tsconfigRootDir: process2.cwd()
1486
1490
  } : {},
1487
1491
  ...parserOptions
1488
1492
  }
@@ -1902,7 +1906,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
1902
1906
  autoRenamePlugins = true,
1903
1907
  componentExts = [],
1904
1908
  gitignore: enableGitignore = true,
1905
- isInEditor = !!((process2.env.VSCODE_PID || process2.env.VSCODE_CWD || process2.env.JETBRAINS_IDE || process2.env.VIM || process2.env.NVIM) && !process2.env.CI),
1909
+ isInEditor = isInEditorEnv(),
1906
1910
  jsx: enableJsx = true,
1907
1911
  react: enableReact = false,
1908
1912
  regexp: enableRegexp = true,
@@ -1927,9 +1931,7 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
1927
1931
  if (typeof enableGitignore !== "boolean") {
1928
1932
  configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r2) => [r2(enableGitignore)]));
1929
1933
  } else {
1930
- if (fs.existsSync(".gitignore")) {
1931
- configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r2) => [r2()]));
1932
- }
1934
+ configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r2) => [r2()]));
1933
1935
  }
1934
1936
  }
1935
1937
  const typescriptOptions = resolveSubOptions(options, "typescript");
@@ -2092,6 +2094,7 @@ export {
2092
2094
  ignores,
2093
2095
  imports,
2094
2096
  interopDefault,
2097
+ isInEditorEnv,
2095
2098
  javascript,
2096
2099
  jsdoc,
2097
2100
  jsonc,
@@ -2117,7 +2120,6 @@ export {
2117
2120
  sortTsconfig,
2118
2121
  stylistic,
2119
2122
  test,
2120
- toArray,
2121
2123
  typescript,
2122
2124
  unicorn,
2123
2125
  unocss,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vinicunca/eslint-config",
3
3
  "type": "module",
4
- "version": "2.7.0",
4
+ "version": "2.7.2",
5
5
  "description": "Vinicunca ESLint config",
6
6
  "author": {
7
7
  "name": "praburangki",
@@ -58,29 +58,29 @@
58
58
  "eslint": ">=8.57.0"
59
59
  },
60
60
  "dependencies": {
61
+ "@eslint-react/eslint-plugin": "^1.6.0",
61
62
  "@stylistic/eslint-plugin": "^2.6.0-beta.0",
62
63
  "@typescript-eslint/eslint-plugin": "8.0.0-alpha.40",
63
64
  "@typescript-eslint/parser": "8.0.0-alpha.40",
64
- "@unocss/eslint-plugin": "^0.61.2",
65
- "eslint-config-flat-gitignore": "^0.1.7",
66
- "eslint-flat-config-utils": "^0.2.5",
65
+ "@unocss/eslint-plugin": "^0.61.6",
66
+ "eslint-config-flat-gitignore": "^0.1.8",
67
+ "eslint-flat-config-utils": "^0.3.0",
67
68
  "eslint-merge-processors": "^0.1.0",
68
69
  "eslint-plugin-antfu": "^2.3.4",
69
70
  "eslint-plugin-eslint-comments": "^3.2.0",
70
71
  "eslint-plugin-format": "^0.1.2",
71
- "eslint-plugin-import-x": "^3.0.1",
72
- "eslint-plugin-jsdoc": "^48.7.0",
72
+ "eslint-plugin-import-x": "^3.1.0",
73
+ "eslint-plugin-jsdoc": "^48.8.3",
73
74
  "eslint-plugin-jsonc": "^2.16.0",
74
75
  "eslint-plugin-markdown": "^5.1.0",
75
- "eslint-plugin-n": "^17.9.0",
76
+ "eslint-plugin-n": "^17.10.1",
76
77
  "eslint-plugin-no-only-tests": "^3.1.0",
77
- "eslint-plugin-perfectionist": "^2.11.0",
78
- "eslint-plugin-react": "^7.34.4",
78
+ "eslint-plugin-perfectionist": "^3.0.0",
79
79
  "eslint-plugin-react-hooks": "^4.6.2",
80
80
  "eslint-plugin-regexp": "^2.6.0",
81
- "eslint-plugin-sonarjs": "^1.0.3",
82
- "eslint-plugin-unicorn": "^54.0.0",
83
- "eslint-plugin-unused-imports": "^4.0.0",
81
+ "eslint-plugin-sonarjs": "^1.0.4",
82
+ "eslint-plugin-unicorn": "^55.0.0",
83
+ "eslint-plugin-unused-imports": "^4.0.1",
84
84
  "eslint-plugin-vitest": "^0.5.4",
85
85
  "eslint-plugin-vue": "^9.27.0",
86
86
  "eslint-plugin-yml": "^1.14.0",
@@ -92,15 +92,15 @@
92
92
  "yaml-eslint-parser": "^1.2.3"
93
93
  },
94
94
  "devDependencies": {
95
- "@types/eslint": "^8.56.10",
95
+ "@types/eslint": "^9.6.0",
96
96
  "@types/fs-extra": "^11.0.4",
97
- "eslint-typegen": "^0.2.4",
97
+ "eslint-typegen": "^0.3.0",
98
98
  "execa": "^9.3.0",
99
99
  "fast-glob": "^3.3.2",
100
100
  "fs-extra": "^11.2.0",
101
101
  "react": "^18.3.1",
102
- "tsup": "^8.1.0",
103
- "vue": "^3.4.31"
102
+ "tsup": "^8.2.3",
103
+ "vue": "^3.4.34"
104
104
  },
105
105
  "scripts": {
106
106
  "lint": "eslint -v",