@kouts/eslint-config 1.3.7 → 1.3.9

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
@@ -422,6 +422,19 @@ const vue = (options) => {
422
422
  return config;
423
423
  };
424
424
 
425
+ const pluginImportTypescript = Object.keys(pluginImport.flatConfigs.typescript).reduce(
426
+ (acc, key) => ({
427
+ ...acc,
428
+ [key]: Object.keys(pluginImport.flatConfigs.typescript[key]).reduce(
429
+ (innerAcc, curr) => ({
430
+ ...innerAcc,
431
+ [curr.replace("import-x", "import")]: pluginImport.flatConfigs.typescript[key][curr]
432
+ }),
433
+ {}
434
+ )
435
+ }),
436
+ {}
437
+ );
425
438
  const config = (options) => {
426
439
  const opts = {
427
440
  noJsx: true,
@@ -478,7 +491,10 @@ const config = (options) => {
478
491
  plugins: {
479
492
  import: pluginImport
480
493
  },
494
+ ...opts.ts ? pluginImportTypescript : {},
481
495
  rules: {
496
+ // TypeScript compilation already ensures that named imports exist in the referenced module
497
+ ...opts.ts ? { "import/named": "off" } : {},
482
498
  "import/export": "error",
483
499
  "import/first": "error",
484
500
  "import/no-duplicates": "error",
package/dist/index.js CHANGED
@@ -421,6 +421,19 @@ const vue = (options) => {
421
421
  return config;
422
422
  };
423
423
 
424
+ const pluginImportTypescript = Object.keys(pluginImport.flatConfigs.typescript).reduce(
425
+ (acc, key) => ({
426
+ ...acc,
427
+ [key]: Object.keys(pluginImport.flatConfigs.typescript[key]).reduce(
428
+ (innerAcc, curr) => ({
429
+ ...innerAcc,
430
+ [curr.replace("import-x", "import")]: pluginImport.flatConfigs.typescript[key][curr]
431
+ }),
432
+ {}
433
+ )
434
+ }),
435
+ {}
436
+ );
424
437
  const config = (options) => {
425
438
  const opts = {
426
439
  noJsx: true,
@@ -477,7 +490,10 @@ const config = (options) => {
477
490
  plugins: {
478
491
  import: pluginImport
479
492
  },
493
+ ...opts.ts ? pluginImportTypescript : {},
480
494
  rules: {
495
+ // TypeScript compilation already ensures that named imports exist in the referenced module
496
+ ...opts.ts ? { "import/named": "off" } : {},
481
497
  "import/export": "error",
482
498
  "import/first": "error",
483
499
  "import/no-duplicates": "error",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kouts/eslint-config",
3
3
  "type": "module",
4
- "version": "1.3.7",
4
+ "version": "1.3.9",
5
5
  "packageManager": "pnpm@9.9.0",
6
6
  "engines": {
7
7
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"