@vinicunca/eslint-config 2.1.3 → 2.1.5

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.cjs CHANGED
@@ -2247,6 +2247,8 @@ async function typescript(options = {}) {
2247
2247
  ...componentExts.map((ext) => `**/*.${ext}`)
2248
2248
  ];
2249
2249
  const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
2250
+ const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
2251
+ const isTypeAware = !!tsconfigPath;
2250
2252
  const typeAwareRules = {
2251
2253
  "dot-notation": OFF,
2252
2254
  "no-implied-eval": OFF,
@@ -2262,7 +2264,6 @@ async function typescript(options = {}) {
2262
2264
  "ts/restrict-plus-operands": ERROR,
2263
2265
  "ts/restrict-template-expressions": ERROR
2264
2266
  };
2265
- const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
2266
2267
  const [
2267
2268
  pluginTs,
2268
2269
  parserTs
@@ -2270,29 +2271,41 @@ async function typescript(options = {}) {
2270
2271
  interopDefault(import("@typescript-eslint/eslint-plugin")),
2271
2272
  interopDefault(import("@typescript-eslint/parser"))
2272
2273
  ]);
2273
- return [
2274
- {
2275
- // Install the plugins without globs, so they can be configured separately.
2276
- name: "vinicunca:typescript:setup",
2277
- plugins: {
2278
- ts: pluginTs,
2279
- vinicunca: import_eslint_plugin_vinicunca.default
2280
- }
2281
- },
2282
- {
2283
- files,
2274
+ function makeParser({ files: files2, ignores: ignores2, typeAware }) {
2275
+ return {
2276
+ files: files2,
2277
+ ...ignores2 ? { ignores: ignores2 } : {},
2284
2278
  languageOptions: {
2285
2279
  parser: parserTs,
2286
2280
  parserOptions: {
2287
2281
  extraFileExtensions: componentExts.map((ext) => `.${ext}`),
2288
2282
  sourceType: "module",
2289
- ...tsconfigPath ? {
2283
+ ...typeAware ? {
2290
2284
  project: tsconfigPath,
2291
2285
  tsconfigRootDir: import_node_process.default.cwd()
2292
2286
  } : {},
2293
2287
  ...parserOptions
2294
2288
  }
2295
2289
  },
2290
+ name: `vinicunca:typescript:${typeAware ? "type-aware-parser" : "parser"}`
2291
+ };
2292
+ }
2293
+ return [
2294
+ {
2295
+ // Install the plugins without globs, so they can be configured separately.
2296
+ name: "vinicunca:typescript:setup",
2297
+ plugins: {
2298
+ ts: pluginTs,
2299
+ vinicunca: import_eslint_plugin_vinicunca.default
2300
+ }
2301
+ },
2302
+ // assign type-aware parser for type-aware files and type-unaware parser for the rest
2303
+ ...isTypeAware ? [
2304
+ makeParser({ files: filesTypeAware, typeAware: true }),
2305
+ makeParser({ files, ignores: filesTypeAware, typeAware: false })
2306
+ ] : [makeParser({ files, typeAware: false })],
2307
+ {
2308
+ files,
2296
2309
  name: "vinicunca:typescript:rules",
2297
2310
  rules: {
2298
2311
  ...renameRules(
package/dist/index.d.cts CHANGED
@@ -314,7 +314,7 @@ interface OptionsConfig extends OptionsComponentExts {
314
314
  *
315
315
  * @default true
316
316
  */
317
- stylistic?: StylisticConfig | boolean;
317
+ stylistic?: (StylisticConfig & OptionsOverrides) | boolean;
318
318
  /**
319
319
  * Enable test support.
320
320
  *
package/dist/index.d.ts CHANGED
@@ -314,7 +314,7 @@ interface OptionsConfig extends OptionsComponentExts {
314
314
  *
315
315
  * @default true
316
316
  */
317
- stylistic?: StylisticConfig | boolean;
317
+ stylistic?: (StylisticConfig & OptionsOverrides) | boolean;
318
318
  /**
319
319
  * Enable test support.
320
320
  *
package/dist/index.js CHANGED
@@ -2157,6 +2157,8 @@ async function typescript(options = {}) {
2157
2157
  ...componentExts.map((ext) => `**/*.${ext}`)
2158
2158
  ];
2159
2159
  const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
2160
+ const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
2161
+ const isTypeAware = !!tsconfigPath;
2160
2162
  const typeAwareRules = {
2161
2163
  "dot-notation": OFF,
2162
2164
  "no-implied-eval": OFF,
@@ -2172,7 +2174,6 @@ async function typescript(options = {}) {
2172
2174
  "ts/restrict-plus-operands": ERROR,
2173
2175
  "ts/restrict-template-expressions": ERROR
2174
2176
  };
2175
- const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
2176
2177
  const [
2177
2178
  pluginTs,
2178
2179
  parserTs
@@ -2180,29 +2181,41 @@ async function typescript(options = {}) {
2180
2181
  interopDefault(import("@typescript-eslint/eslint-plugin")),
2181
2182
  interopDefault(import("@typescript-eslint/parser"))
2182
2183
  ]);
2183
- return [
2184
- {
2185
- // Install the plugins without globs, so they can be configured separately.
2186
- name: "vinicunca:typescript:setup",
2187
- plugins: {
2188
- ts: pluginTs,
2189
- vinicunca: default2
2190
- }
2191
- },
2192
- {
2193
- files,
2184
+ function makeParser({ files: files2, ignores: ignores2, typeAware }) {
2185
+ return {
2186
+ files: files2,
2187
+ ...ignores2 ? { ignores: ignores2 } : {},
2194
2188
  languageOptions: {
2195
2189
  parser: parserTs,
2196
2190
  parserOptions: {
2197
2191
  extraFileExtensions: componentExts.map((ext) => `.${ext}`),
2198
2192
  sourceType: "module",
2199
- ...tsconfigPath ? {
2193
+ ...typeAware ? {
2200
2194
  project: tsconfigPath,
2201
2195
  tsconfigRootDir: process.cwd()
2202
2196
  } : {},
2203
2197
  ...parserOptions
2204
2198
  }
2205
2199
  },
2200
+ name: `vinicunca:typescript:${typeAware ? "type-aware-parser" : "parser"}`
2201
+ };
2202
+ }
2203
+ return [
2204
+ {
2205
+ // Install the plugins without globs, so they can be configured separately.
2206
+ name: "vinicunca:typescript:setup",
2207
+ plugins: {
2208
+ ts: pluginTs,
2209
+ vinicunca: default2
2210
+ }
2211
+ },
2212
+ // assign type-aware parser for type-aware files and type-unaware parser for the rest
2213
+ ...isTypeAware ? [
2214
+ makeParser({ files: filesTypeAware, typeAware: true }),
2215
+ makeParser({ files, ignores: filesTypeAware, typeAware: false })
2216
+ ] : [makeParser({ files, typeAware: false })],
2217
+ {
2218
+ files,
2206
2219
  name: "vinicunca:typescript:rules",
2207
2220
  rules: {
2208
2221
  ...renameRules(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vinicunca/eslint-config",
3
3
  "type": "module",
4
- "version": "2.1.3",
4
+ "version": "2.1.5",
5
5
  "description": "Vinicunca ESLint config",
6
6
  "author": {
7
7
  "name": "praburangki",
@@ -60,11 +60,11 @@
60
60
  "dependencies": {
61
61
  "@antfu/eslint-define-config": "1.23.0-2",
62
62
  "@eslint-types/jsdoc": "^46.9.1",
63
- "@eslint-types/typescript-eslint": "^6.17.0",
63
+ "@eslint-types/typescript-eslint": "^6.18.1",
64
64
  "@eslint-types/unicorn": "^50.0.1",
65
- "@stylistic/eslint-plugin": "^1.5.3",
66
- "@typescript-eslint/eslint-plugin": "^6.18.1",
67
- "@typescript-eslint/parser": "^6.18.1",
65
+ "@stylistic/eslint-plugin": "^1.5.4",
66
+ "@typescript-eslint/eslint-plugin": "^6.19.0",
67
+ "@typescript-eslint/parser": "^6.19.0",
68
68
  "@unocss/eslint-plugin": "^0.58.3",
69
69
  "@vinicunca/eslint-plugin-vinicunca": "^1.0.10",
70
70
  "eslint-merge-processors": "^0.1.0",
@@ -72,7 +72,7 @@
72
72
  "eslint-plugin-format": "^0.1.0",
73
73
  "eslint-plugin-i": "^2.29.1",
74
74
  "eslint-plugin-jsdoc": "^48.0.2",
75
- "eslint-plugin-jsonc": "^2.11.2",
75
+ "eslint-plugin-jsonc": "^2.12.2",
76
76
  "eslint-plugin-markdown": "^3.0.1",
77
77
  "eslint-plugin-n": "^16.6.2",
78
78
  "eslint-plugin-no-only-tests": "^3.1.0",
@@ -82,8 +82,8 @@
82
82
  "eslint-plugin-unicorn": "^50.0.1",
83
83
  "eslint-plugin-unused-imports": "^3.0.0",
84
84
  "eslint-plugin-vitest": "^0.3.20",
85
- "eslint-plugin-vue": "^9.19.2",
86
- "eslint-plugin-yml": "^1.11.0",
85
+ "eslint-plugin-vue": "^9.20.1",
86
+ "eslint-plugin-yml": "^1.12.2",
87
87
  "eslint-processor-vue-blocks": "^0.1.1",
88
88
  "globals": "^13.24.0",
89
89
  "jsonc-eslint-parser": "^2.4.0",
@@ -93,15 +93,15 @@
93
93
  "yaml-eslint-parser": "^1.2.2"
94
94
  },
95
95
  "devDependencies": {
96
- "@eslint-stylistic/metadata": "^1.5.3",
97
- "@types/eslint": "^8.56.0",
96
+ "@eslint-stylistic/metadata": "^1.5.4",
97
+ "@types/eslint": "^8.56.2",
98
98
  "@types/fs-extra": "^11.0.4",
99
99
  "execa": "^8.0.1",
100
100
  "fast-glob": "^3.3.2",
101
101
  "fs-extra": "^11.2.0",
102
102
  "react": "^18.2.0",
103
103
  "tsup": "^8.0.1",
104
- "vue": "^3.4.7"
104
+ "vue": "^3.4.14"
105
105
  },
106
106
  "scripts": {
107
107
  "lint": "eslint -v",