@infernodesign/eslint-config 2.13.1 → 2.14.0

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/README.md CHANGED
@@ -62,12 +62,12 @@ export default config(
62
62
  },
63
63
 
64
64
  // Legacy config
65
- ...compat.config( {
65
+ ...compat.config({
66
66
  extends: [
67
67
  'eslint:recommended',
68
68
  // Other extends...
69
69
  ],
70
- } )
70
+ })
71
71
 
72
72
  // Other flat configs...
73
73
  )
@@ -170,7 +170,7 @@ And that's it! Or you can configure each integration individually, for example:
170
170
  // eslint.config.js
171
171
  import { config } from '@infernodesign/eslint-config'
172
172
 
173
- export default config( {
173
+ export default config({
174
174
  // Type of the project. 'lib' for libraries, the default is 'app'
175
175
  type: 'lib',
176
176
 
@@ -212,7 +212,7 @@ export default config( {
212
212
  '**/fixtures',
213
213
  // ...globs
214
214
  ]
215
- } )
215
+ })
216
216
  ```
217
217
 
218
218
  The `antfu` factory function also accepts any number of arbitrary custom config overrides:
@@ -229,7 +229,7 @@ export default config(
229
229
  // From the second arguments they are ESLint Flat Configs
230
230
  // you can have multiple configs
231
231
  {
232
- files: [ '**/*.ts' ],
232
+ files: ['**/*.ts'],
233
233
  rules: {},
234
234
  },
235
235
  {
@@ -271,7 +271,7 @@ import {
271
271
 
272
272
  export default combine(
273
273
  ignores(),
274
- javascript( /* Options */ ),
274
+ javascript(/* Options */),
275
275
  comments(),
276
276
  node(),
277
277
  jsdoc(),
@@ -279,7 +279,7 @@ export default combine(
279
279
  nextjs(),
280
280
  storybook(),
281
281
  unicorn(),
282
- typescript( /* Options */ ),
282
+ typescript(/* Options */),
283
283
  stylistic(),
284
284
  vue(),
285
285
  jsonc(),
@@ -330,12 +330,12 @@ If you really want to use the original prefix, you can revert the plugin renamin
330
330
  import { config } from '@infernodesign/eslint-config'
331
331
 
332
332
  export default config()
333
- .renamePlugins( {
333
+ .renamePlugins({
334
334
  node: 'n',
335
335
  ts: '@typescript-eslint',
336
336
  yaml: 'yml'
337
337
  // ...
338
- } )
338
+ })
339
339
  ```
340
340
 
341
341
  ### Rules Overrides
@@ -353,15 +353,15 @@ export default config(
353
353
  },
354
354
  {
355
355
  // Remember to specify the file glob here, otherwise it might cause the vue plugin to handle non-vue files
356
- files: [ '**/*.vue' ],
356
+ files: ['**/*.vue'],
357
357
  rules: {
358
- 'vue/operator-linebreak': [ 'error', 'before' ],
358
+ 'vue/operator-linebreak': ['error', 'before'],
359
359
  },
360
360
  },
361
361
  {
362
362
  // Without `files`, they are general rules for all files
363
363
  rules: {
364
- 'style/semi': [ 'error', 'never' ],
364
+ 'style/semi': ['error', 'never'],
365
365
  },
366
366
  }
367
367
  )
@@ -373,15 +373,15 @@ We also provided the `overrides` options in each integration to make it easier:
373
373
  // eslint.config.js
374
374
  import { config } from '@infernodesign/eslint-config'
375
375
 
376
- export default config( {
376
+ export default config({
377
377
  typescript: {
378
378
  overrides: {
379
- 'ts/consistent-type-definitions': [ 'error', 'interface' ],
379
+ 'ts/consistent-type-definitions': ['error', 'interface'],
380
380
  },
381
381
  },
382
382
  vue: {
383
383
  overrides: {
384
- 'vue/operator-linebreak': [ 'error', 'before' ],
384
+ 'vue/operator-linebreak': ['error', 'before'],
385
385
  },
386
386
  },
387
387
  yaml: {
@@ -389,7 +389,7 @@ export default config( {
389
389
  // ...
390
390
  },
391
391
  },
392
- } )
392
+ })
393
393
  ```
394
394
 
395
395
  ### Config Composer
@@ -409,15 +409,15 @@ export default config()
409
409
  'config/stylistic/rules',
410
410
  {
411
411
  rules: {
412
- 'style/generator-star-spacing': [ 'error', { after: true, before: false } ],
412
+ 'style/generator-star-spacing': ['error', { after: true, before: false }],
413
413
  }
414
414
  }
415
415
  )
416
416
  // rename plugin prefixes
417
- .renamePlugins( {
417
+ .renamePlugins({
418
418
  'old-prefix': 'new-prefix',
419
419
  // ...
420
- } )
420
+ })
421
421
  // ...
422
422
  ```
423
423
 
@@ -433,9 +433,9 @@ To enable astro support, you need to explicitly turn it on:
433
433
  // eslint.config.js
434
434
  import { config } from '@infernodesign/eslint-config'
435
435
 
436
- export default config( {
436
+ export default config({
437
437
  astro: true,
438
- } )
438
+ })
439
439
  ```
440
440
 
441
441
  Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
@@ -452,7 +452,7 @@ Use external formatters to format files that ESLint cannot handle yet (`.css`, `
452
452
  // eslint.config.js
453
453
  import { config } from '@infernodesign/eslint-config'
454
454
 
455
- export default config( {
455
+ export default config({
456
456
  formatters: {
457
457
  /**
458
458
  * Format CSS, LESS, SCSS files, also the `<style>` blocks in Vue
@@ -471,7 +471,7 @@ export default config( {
471
471
  */
472
472
  markdown: 'prettier'
473
473
  }
474
- } )
474
+ })
475
475
  ```
476
476
 
477
477
  Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
@@ -488,9 +488,9 @@ To enable React support, you need to explicitly turn it on:
488
488
  // eslint.config.js
489
489
  import { config } from '@infernodesign/eslint-config'
490
490
 
491
- export default config( {
491
+ export default config({
492
492
  react: true,
493
- } )
493
+ })
494
494
  ```
495
495
 
496
496
  Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
@@ -507,9 +507,9 @@ To enable linting for Medusa applications with the default recommended rules, ex
507
507
  // eslint.config.js
508
508
  import { config } from '@infernodesign/eslint-config'
509
509
 
510
- export default config( {
510
+ export default config({
511
511
  medusa: true,
512
- } )
512
+ })
513
513
  ```
514
514
 
515
515
  Medusa support is powered by [`@medusajs/eslint-plugin`](https://docs.medusajs.com/resources/lint). It is an optional peer dependency, so projects that enable `medusa` must install it:
@@ -524,7 +524,7 @@ The integration exposes all three official presets:
524
524
  // eslint.config.js
525
525
  import { config } from '@infernodesign/eslint-config'
526
526
 
527
- export default config( {
527
+ export default config({
528
528
  medusa: {
529
529
  // Use preset 'recommended' for applications, 'modules' for standalone module packages, or 'strict' for type-aware and cross-file rules
530
530
  preset: 'strict',
@@ -532,7 +532,7 @@ export default config( {
532
532
  typescript: {
533
533
  tsconfigPath: 'tsconfig.json',
534
534
  },
535
- } )
535
+ })
536
536
  ```
537
537
 
538
538
  The `strict` preset requires a TypeScript config that includes every linted TypeScript file. Rule overrides retain the file scopes defined by the selected Medusa preset:
@@ -541,13 +541,13 @@ The `strict` preset requires a TypeScript config that includes every linted Type
541
541
  // eslint.config.js
542
542
  import { config } from '@infernodesign/eslint-config'
543
543
 
544
- export default config( {
544
+ export default config({
545
545
  medusa: {
546
546
  overrides: {
547
547
  'medusa/no-console-log-in-workflow': 'off',
548
548
  },
549
549
  },
550
- } )
550
+ })
551
551
  ```
552
552
 
553
553
  #### Next.js
@@ -558,9 +558,9 @@ To enable Next.js support, you need to explicitly turn it on:
558
558
  // eslint.config.js
559
559
  import { config } from '@infernodesign/eslint-config'
560
560
 
561
- export default config( {
561
+ export default config({
562
562
  nextjs: true,
563
- } )
563
+ })
564
564
  ```
565
565
 
566
566
  To configure Next.js, you can pass an object with the following options:
@@ -569,12 +569,12 @@ To configure Next.js, you can pass an object with the following options:
569
569
  // eslint.config.js
570
570
  import { config } from '@infernodesign/eslint-config'
571
571
 
572
- export default config( {
572
+ export default config({
573
573
  nextjs: {
574
574
  // Specify the root directory for Next.js. Defaults to the cwd() of the Node.js process.
575
575
  rootDir: 'src',
576
576
  },
577
- } )
577
+ })
578
578
  ```
579
579
 
580
580
  Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
@@ -591,9 +591,9 @@ To enable Sanity linting with the default recommended rules, explicitly turn it
591
591
  // eslint.config.js
592
592
  import { config } from '@infernodesign/eslint-config'
593
593
 
594
- export default config( {
594
+ export default config({
595
595
  sanity: true,
596
- } )
596
+ })
597
597
  ```
598
598
 
599
599
  Sanity support is powered by [`@sanity-labs/eslint-plugin`](https://github.com/sanity-labs/sanity-lint/tree/main/packages/eslint-plugin). It is an optional peer dependency, so projects that enable `sanity` must install it:
@@ -608,36 +608,36 @@ You can choose a narrower preset for different Sanity project shapes:
608
608
  // eslint.config.js
609
609
  import { config } from '@infernodesign/eslint-config'
610
610
 
611
- export default config( {
611
+ export default config({
612
612
  // Recommended GROQ and schema rules for combined apps
613
613
  sanity: {
614
614
  preset: 'recommended',
615
615
  },
616
- } )
616
+ })
617
617
  ```
618
618
 
619
619
  ```js
620
620
  // eslint.config.js
621
621
  import { config } from '@infernodesign/eslint-config'
622
622
 
623
- export default config( {
623
+ export default config({
624
624
  // GROQ rules only for web apps, frontends, or functions
625
625
  sanity: {
626
626
  preset: 'groq',
627
627
  },
628
- } )
628
+ })
629
629
  ```
630
630
 
631
631
  ```js
632
632
  // eslint.config.js
633
633
  import { config } from '@infernodesign/eslint-config'
634
634
 
635
- export default config( {
635
+ export default config({
636
636
  // Schema rules only for a standalone Sanity Studio
637
637
  sanity: {
638
638
  preset: 'schema',
639
639
  },
640
- } )
640
+ })
641
641
  ```
642
642
 
643
643
  Other available presets are `performance` for performance-focused GROQ rules and `strict` for enabling every Sanity rule as an error.
@@ -648,13 +648,13 @@ For schema-aware GROQ rules like `sanity/groq-invalid-type-filter` and `sanity/g
648
648
  // eslint.config.js
649
649
  import { config } from '@infernodesign/eslint-config'
650
650
 
651
- export default config( {
651
+ export default config({
652
652
  sanity: {
653
653
  cwd: 'apps/studio',
654
654
  preset: 'recommended',
655
655
  schemaPath: 'schema.json',
656
656
  },
657
- } )
657
+ })
658
658
  ```
659
659
 
660
660
  Generate `schema.json` with the Sanity CLI:
@@ -671,9 +671,9 @@ To enable storybook support, you need to explicitly turn it on:
671
671
  // eslint.config.js
672
672
  import { config } from '@infernodesign/eslint-config'
673
673
 
674
- export default config( {
674
+ export default config({
675
675
  storybook: true,
676
- } )
676
+ })
677
677
  ```
678
678
 
679
679
  Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
@@ -690,9 +690,9 @@ To enable svelte support, you need to explicitly turn it on:
690
690
  // eslint.config.js
691
691
  import { config } from '@infernodesign/eslint-config'
692
692
 
693
- export default config( {
693
+ export default config({
694
694
  svelte: true,
695
- } )
695
+ })
696
696
  ```
697
697
 
698
698
  Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
@@ -709,9 +709,9 @@ To enable Solid support, you need to explicitly turn it on:
709
709
  // eslint.config.js
710
710
  import { config } from '@infernodesign/eslint-config'
711
711
 
712
- export default config( {
712
+ export default config({
713
713
  solid: true,
714
- } )
714
+ })
715
715
  ```
716
716
 
717
717
  Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
@@ -728,9 +728,9 @@ To enable TailwindCSS support, you need to explicitly turn it on:
728
728
  // eslint.config.js
729
729
  import { config } from '@infernodesign/eslint-config'
730
730
 
731
- export default config( {
731
+ export default config({
732
732
  tailwindcss: true,
733
- } )
733
+ })
734
734
  ```
735
735
 
736
736
  To configure the TailwindCSS support, you can pass an object with the following options:
@@ -739,7 +739,7 @@ To configure the TailwindCSS support, you can pass an object with the following
739
739
  // eslint.config.js
740
740
  import { config } from '@infernodesign/eslint-config'
741
741
 
742
- export default config( {
742
+ export default config({
743
743
  tailwindcss: {
744
744
  // Enable component class detection
745
745
  detectComponentClasses: true,
@@ -750,7 +750,7 @@ export default config( {
750
750
  // like `global.css`, `globals.css`, `app.css`, `index.css`, or `style.css`.
751
751
  entryPoint: 'src/styles/globals.css',
752
752
  },
753
- } )
753
+ })
754
754
  ```
755
755
 
756
756
  Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
@@ -767,9 +767,9 @@ To enable UnoCSS support, you need to explicitly turn it on:
767
767
  // eslint.config.js
768
768
  import { config } from '@infernodesign/eslint-config'
769
769
 
770
- export default config( {
770
+ export default config({
771
771
  unocss: true,
772
- } )
772
+ })
773
773
  ```
774
774
 
775
775
  Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
@@ -786,9 +786,9 @@ Vue support is detected automatically by checking if `vue` is installed in your
786
786
  // eslint.config.js
787
787
  import { config } from '@infernodesign/eslint-config'
788
788
 
789
- export default config( {
789
+ export default config({
790
790
  vue: true
791
- } )
791
+ })
792
792
  ```
793
793
 
794
794
  #### Vue 2
@@ -799,11 +799,11 @@ We have limited support for Vue 2 (as it's already [reached EOL](https://v2.vuej
799
799
  // eslint.config.js
800
800
  import { config } from '@infernodesign/eslint-config'
801
801
 
802
- export default config( {
802
+ export default config({
803
803
  vue: {
804
804
  vueVersion: 2
805
805
  },
806
- } )
806
+ })
807
807
  ```
808
808
 
809
809
  As it's in maintenance mode, we only accept bug fixes for Vue 2. It might also be removed in the future when `eslint-plugin-vue` drops support for Vue 2. We recommend upgrading to Vue 3 if possible.
@@ -816,11 +816,11 @@ To enable Vue accessibility support, you need to explicitly turn it on:
816
816
  // eslint.config.js
817
817
  import { config } from '@infernodesign/eslint-config'
818
818
 
819
- export default config( {
819
+ export default config({
820
820
  vue: {
821
821
  a11y: true
822
822
  },
823
- } )
823
+ })
824
824
  ```
825
825
 
826
826
  Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
@@ -860,8 +860,8 @@ const foo = async (msg: string): void => {
860
860
  Will be transformed to this when you hit save with your editor or run `eslint --fix`:
861
861
 
862
862
  ```ts
863
- async function foo( msg: string ): void {
864
- console.log( msg )
863
+ async function foo(msg: string): void {
864
+ console.log(msg)
865
865
  }
866
866
  ```
867
867
 
@@ -875,11 +875,11 @@ You can optionally enable the [type aware rules](https://typescript-eslint.io/li
875
875
  // eslint.config.js
876
876
  import { config } from '@infernodesign/eslint-config'
877
877
 
878
- export default config( {
878
+ export default config({
879
879
  typescript: {
880
880
  tsconfigPath: 'tsconfig.json',
881
881
  },
882
- } )
882
+ })
883
883
  ```
884
884
 
885
885
  ### Editor Specific Disables
@@ -898,9 +898,9 @@ This is to prevent unused imports from getting removed by the editor during refa
898
898
  // eslint.config.js
899
899
  import { config } from '@infernodesign/eslint-config'
900
900
 
901
- export default config( {
901
+ export default config({
902
902
  isInEditor: false
903
- } )
903
+ })
904
904
  ```
905
905
 
906
906
  ### Lint Staged
package/dist/cli.js CHANGED
@@ -8,7 +8,7 @@ import { cac } from "cac";
8
8
  import parse from "parse-gitignore";
9
9
  import { execSync } from "node:child_process";
10
10
  //#region package.json
11
- var version = "2.13.1";
11
+ var version = "2.14.0";
12
12
  //#endregion
13
13
  //#region src/cli/constants.ts
14
14
  const vscodeSettingsString = `
@@ -196,21 +196,21 @@ async function updateEslintFiles(result) {
196
196
  //#endregion
197
197
  //#region src/cli/constants-generated.ts
198
198
  const versionsMap = {
199
- "@eslint-react/eslint-plugin": "^5.18.6",
200
- "@medusajs/eslint-plugin": "^2.19.0",
201
- "@next/eslint-plugin-next": "^16.3.1",
202
- "@sanity-labs/eslint-plugin": "^1.0.0",
203
- "@unocss/eslint-plugin": "^66.7.5",
204
- "astro-eslint-parser": "^3.1.0",
205
- "eslint": "^10.8.1",
206
- "eslint-plugin-astro": "^3.1.0",
207
- "eslint-plugin-better-tailwindcss": "^4.7.0",
199
+ "@eslint-react/eslint-plugin": "^5.24.4",
200
+ "@medusajs/eslint-plugin": "^2.21.2",
201
+ "@next/eslint-plugin-next": "^16.3.8",
202
+ "@sanity-labs/eslint-plugin": "^1.0.1",
203
+ "@unocss/eslint-plugin": "^66.10.5",
204
+ "astro-eslint-parser": "^3.2.0",
205
+ "eslint": "^10.12.0",
206
+ "eslint-plugin-astro": "^3.2.1",
207
+ "eslint-plugin-better-tailwindcss": "^4.8.0",
208
208
  "eslint-plugin-format": "^2.0.1",
209
- "eslint-plugin-react-refresh": "^0.5.4",
210
- "eslint-plugin-solid": "^0.15.0",
211
- "eslint-plugin-storybook": "^10.5.9",
209
+ "eslint-plugin-react-refresh": "^0.5.7",
210
+ "eslint-plugin-solid": "^0.18.1",
211
+ "eslint-plugin-storybook": "^10.6.1",
212
212
  "eslint-plugin-svelte": "^3.23.0",
213
- "prettier-plugin-astro": "^0.14.1",
213
+ "prettier-plugin-astro": "^1.1.0",
214
214
  "prettier-plugin-slidev": "^1.0.5",
215
215
  "svelte-eslint-parser": "^1.8.1"
216
216
  };