@vinicunca/eslint-config 3.8.0 → 3.9.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +88 -49
  2. package/dist/index.js +112 -48
  3. package/package.json +13 -9
package/dist/index.d.ts CHANGED
@@ -661,233 +661,233 @@ interface RuleOptions {
661
661
  'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>
662
662
  /**
663
663
  * Enforce or ban the use of inline type-only markers for named imports.
664
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/consistent-type-specifier-style.md
664
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/consistent-type-specifier-style.md
665
665
  */
666
666
  'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>
667
667
  /**
668
668
  * Ensure a default export is present, given a default import.
669
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/default.md
669
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/default.md
670
670
  */
671
671
  'import/default'?: Linter.RuleEntry<[]>
672
672
  /**
673
673
  * Enforce a leading comment with the webpackChunkName for dynamic imports.
674
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/dynamic-import-chunkname.md
674
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/dynamic-import-chunkname.md
675
675
  */
676
676
  'import/dynamic-import-chunkname'?: Linter.RuleEntry<ImportDynamicImportChunkname>
677
677
  /**
678
678
  * Forbid any invalid exports, i.e. re-export of the same name.
679
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/export.md
679
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/export.md
680
680
  */
681
681
  'import/export'?: Linter.RuleEntry<[]>
682
682
  /**
683
683
  * Ensure all exports appear after other statements.
684
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/exports-last.md
684
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/exports-last.md
685
685
  */
686
686
  'import/exports-last'?: Linter.RuleEntry<[]>
687
687
  /**
688
688
  * Ensure consistent use of file extension within the import path.
689
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/extensions.md
689
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/extensions.md
690
690
  */
691
691
  'import/extensions'?: Linter.RuleEntry<ImportExtensions>
692
692
  /**
693
693
  * Ensure all imports appear before other statements.
694
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/first.md
694
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/first.md
695
695
  */
696
696
  'import/first'?: Linter.RuleEntry<ImportFirst>
697
697
  /**
698
698
  * Prefer named exports to be grouped together in a single export declaration.
699
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/group-exports.md
699
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/group-exports.md
700
700
  */
701
701
  'import/group-exports'?: Linter.RuleEntry<[]>
702
702
  /**
703
703
  * Replaced by `import-x/first`.
704
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/imports-first.md
704
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/imports-first.md
705
705
  * @deprecated
706
706
  */
707
707
  'import/imports-first'?: Linter.RuleEntry<ImportImportsFirst>
708
708
  /**
709
709
  * Enforce the maximum number of dependencies a module can have.
710
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/max-dependencies.md
710
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/max-dependencies.md
711
711
  */
712
712
  'import/max-dependencies'?: Linter.RuleEntry<ImportMaxDependencies>
713
713
  /**
714
714
  * Ensure named imports correspond to a named export in the remote file.
715
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/named.md
715
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/named.md
716
716
  */
717
717
  'import/named'?: Linter.RuleEntry<ImportNamed>
718
718
  /**
719
719
  * Ensure imported namespaces contain dereferenced properties as they are dereferenced.
720
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/namespace.md
720
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/namespace.md
721
721
  */
722
722
  'import/namespace'?: Linter.RuleEntry<ImportNamespace>
723
723
  /**
724
724
  * Enforce a newline after import statements.
725
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/newline-after-import.md
725
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/newline-after-import.md
726
726
  */
727
727
  'import/newline-after-import'?: Linter.RuleEntry<ImportNewlineAfterImport>
728
728
  /**
729
729
  * Forbid import of modules using absolute paths.
730
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-absolute-path.md
730
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-absolute-path.md
731
731
  */
732
732
  'import/no-absolute-path'?: Linter.RuleEntry<ImportNoAbsolutePath>
733
733
  /**
734
734
  * Forbid AMD `require` and `define` calls.
735
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-amd.md
735
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-amd.md
736
736
  */
737
737
  'import/no-amd'?: Linter.RuleEntry<[]>
738
738
  /**
739
739
  * Forbid anonymous values as default exports.
740
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-anonymous-default-export.md
740
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-anonymous-default-export.md
741
741
  */
742
742
  'import/no-anonymous-default-export'?: Linter.RuleEntry<ImportNoAnonymousDefaultExport>
743
743
  /**
744
744
  * Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
745
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-commonjs.md
745
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-commonjs.md
746
746
  */
747
747
  'import/no-commonjs'?: Linter.RuleEntry<ImportNoCommonjs>
748
748
  /**
749
749
  * Forbid a module from importing a module with a dependency path back to itself.
750
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-cycle.md
750
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-cycle.md
751
751
  */
752
752
  'import/no-cycle'?: Linter.RuleEntry<ImportNoCycle>
753
753
  /**
754
754
  * Forbid default exports.
755
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-default-export.md
755
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-default-export.md
756
756
  */
757
757
  'import/no-default-export'?: Linter.RuleEntry<[]>
758
758
  /**
759
759
  * Forbid imported names marked with `@deprecated` documentation tag.
760
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-deprecated.md
760
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-deprecated.md
761
761
  */
762
762
  'import/no-deprecated'?: Linter.RuleEntry<[]>
763
763
  /**
764
764
  * Forbid repeated import of the same module in multiple places.
765
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-duplicates.md
765
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-duplicates.md
766
766
  */
767
767
  'import/no-duplicates'?: Linter.RuleEntry<ImportNoDuplicates>
768
768
  /**
769
769
  * Forbid `require()` calls with expressions.
770
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-dynamic-require.md
770
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-dynamic-require.md
771
771
  */
772
772
  'import/no-dynamic-require'?: Linter.RuleEntry<ImportNoDynamicRequire>
773
773
  /**
774
774
  * Forbid empty named import blocks.
775
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-empty-named-blocks.md
775
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-empty-named-blocks.md
776
776
  */
777
777
  'import/no-empty-named-blocks'?: Linter.RuleEntry<[]>
778
778
  /**
779
779
  * Forbid the use of extraneous packages.
780
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-extraneous-dependencies.md
780
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-extraneous-dependencies.md
781
781
  */
782
782
  'import/no-extraneous-dependencies'?: Linter.RuleEntry<ImportNoExtraneousDependencies>
783
783
  /**
784
784
  * Forbid import statements with CommonJS module.exports.
785
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-import-module-exports.md
785
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-import-module-exports.md
786
786
  */
787
787
  'import/no-import-module-exports'?: Linter.RuleEntry<ImportNoImportModuleExports>
788
788
  /**
789
789
  * Forbid importing the submodules of other modules.
790
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-internal-modules.md
790
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-internal-modules.md
791
791
  */
792
792
  'import/no-internal-modules'?: Linter.RuleEntry<ImportNoInternalModules>
793
793
  /**
794
794
  * Forbid the use of mutable exports with `var` or `let`.
795
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-mutable-exports.md
795
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-mutable-exports.md
796
796
  */
797
797
  'import/no-mutable-exports'?: Linter.RuleEntry<[]>
798
798
  /**
799
799
  * Forbid use of exported name as identifier of default export.
800
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-named-as-default.md
800
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-named-as-default.md
801
801
  */
802
802
  'import/no-named-as-default'?: Linter.RuleEntry<[]>
803
803
  /**
804
804
  * Forbid use of exported name as property of default export.
805
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-named-as-default-member.md
805
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-named-as-default-member.md
806
806
  */
807
807
  'import/no-named-as-default-member'?: Linter.RuleEntry<[]>
808
808
  /**
809
809
  * Forbid named default exports.
810
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-named-default.md
810
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-named-default.md
811
811
  */
812
812
  'import/no-named-default'?: Linter.RuleEntry<[]>
813
813
  /**
814
814
  * Forbid named exports.
815
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-named-export.md
815
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-named-export.md
816
816
  */
817
817
  'import/no-named-export'?: Linter.RuleEntry<[]>
818
818
  /**
819
819
  * Forbid namespace (a.k.a. "wildcard" `*`) imports.
820
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-namespace.md
820
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-namespace.md
821
821
  */
822
822
  'import/no-namespace'?: Linter.RuleEntry<ImportNoNamespace>
823
823
  /**
824
824
  * Forbid Node.js builtin modules.
825
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-nodejs-modules.md
825
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-nodejs-modules.md
826
826
  */
827
827
  'import/no-nodejs-modules'?: Linter.RuleEntry<ImportNoNodejsModules>
828
828
  /**
829
829
  * Forbid importing packages through relative paths.
830
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-relative-packages.md
830
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-relative-packages.md
831
831
  */
832
832
  'import/no-relative-packages'?: Linter.RuleEntry<ImportNoRelativePackages>
833
833
  /**
834
834
  * Forbid importing modules from parent directories.
835
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-relative-parent-imports.md
835
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-relative-parent-imports.md
836
836
  */
837
837
  'import/no-relative-parent-imports'?: Linter.RuleEntry<ImportNoRelativeParentImports>
838
838
  /**
839
839
  * Forbid importing a default export by a different name.
840
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-rename-default.md
840
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-rename-default.md
841
841
  */
842
842
  'import/no-rename-default'?: Linter.RuleEntry<ImportNoRenameDefault>
843
843
  /**
844
844
  * Enforce which files can be imported in a given folder.
845
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-restricted-paths.md
845
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-restricted-paths.md
846
846
  */
847
847
  'import/no-restricted-paths'?: Linter.RuleEntry<ImportNoRestrictedPaths>
848
848
  /**
849
849
  * Forbid a module from importing itself.
850
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-self-import.md
850
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-self-import.md
851
851
  */
852
852
  'import/no-self-import'?: Linter.RuleEntry<[]>
853
853
  /**
854
854
  * Forbid unassigned imports.
855
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-unassigned-import.md
855
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-unassigned-import.md
856
856
  */
857
857
  'import/no-unassigned-import'?: Linter.RuleEntry<ImportNoUnassignedImport>
858
858
  /**
859
859
  * Ensure imports point to a file/module that can be resolved.
860
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-unresolved.md
860
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-unresolved.md
861
861
  */
862
862
  'import/no-unresolved'?: Linter.RuleEntry<ImportNoUnresolved>
863
863
  /**
864
864
  * Forbid modules without exports, or exports without matching import in another module.
865
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-unused-modules.md
865
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-unused-modules.md
866
866
  */
867
867
  'import/no-unused-modules'?: Linter.RuleEntry<ImportNoUnusedModules>
868
868
  /**
869
869
  * Forbid unnecessary path segments in import and require statements.
870
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-useless-path-segments.md
870
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-useless-path-segments.md
871
871
  */
872
872
  'import/no-useless-path-segments'?: Linter.RuleEntry<ImportNoUselessPathSegments>
873
873
  /**
874
874
  * Forbid webpack loader syntax in imports.
875
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/no-webpack-loader-syntax.md
875
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/no-webpack-loader-syntax.md
876
876
  */
877
877
  'import/no-webpack-loader-syntax'?: Linter.RuleEntry<[]>
878
878
  /**
879
879
  * Enforce a convention in module import order.
880
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/order.md
880
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/order.md
881
881
  */
882
882
  'import/order'?: Linter.RuleEntry<ImportOrder>
883
883
  /**
884
884
  * Prefer a default export if module exports a single name or multiple names.
885
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/prefer-default-export.md
885
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/prefer-default-export.md
886
886
  */
887
887
  'import/prefer-default-export'?: Linter.RuleEntry<ImportPreferDefaultExport>
888
888
  /**
889
889
  * Forbid potentially ambiguous parse goal (`script` vs. `module`).
890
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.6.1/docs/rules/unambiguous.md
890
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.9.1/docs/rules/unambiguous.md
891
891
  */
892
892
  'import/unambiguous'?: Linter.RuleEntry<[]>
893
893
  /**
@@ -2981,6 +2981,26 @@ interface RuleOptions {
2981
2981
  */
2982
2982
  'react-naming-convention/use-state'?: Linter.RuleEntry<[]>
2983
2983
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>
2984
+ /**
2985
+ * enforce that every 'addEventListener' in a component or custom Hook has a corresponding 'removeEventListener'.
2986
+ * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
2987
+ */
2988
+ 'react-web-api/no-leaked-event-listener'?: Linter.RuleEntry<[]>
2989
+ /**
2990
+ * enforce that every 'setInterval' in a component or custom Hook has a corresponding 'clearInterval'.
2991
+ * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
2992
+ */
2993
+ 'react-web-api/no-leaked-interval'?: Linter.RuleEntry<[]>
2994
+ /**
2995
+ * enforce cleanup of 'ResizeObserver' instances in components and custom Hooks.
2996
+ * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer
2997
+ */
2998
+ 'react-web-api/no-leaked-resize-observer'?: Linter.RuleEntry<[]>
2999
+ /**
3000
+ * enforce that every 'setTimeout' in a component or custom Hook has a corresponding 'clearTimeout'.
3001
+ * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
3002
+ */
3003
+ 'react-web-api/no-leaked-timeout'?: Linter.RuleEntry<[]>
2984
3004
  /**
2985
3005
  * disallow using shorthand boolean attributes
2986
3006
  * @see https://eslint-react.xyz/docs/rules/avoid-shorthand-boolean
@@ -9516,7 +9536,7 @@ type IdMatch = []|[string]|[string, {
9516
9536
  // ----- implicit-arrow-linebreak -----
9517
9537
  type ImplicitArrowLinebreak = []|[("beside" | "below")]
9518
9538
  // ----- import/consistent-type-specifier-style -----
9519
- type ImportConsistentTypeSpecifierStyle = []|[("prefer-inline" | "prefer-top-level")]
9539
+ type ImportConsistentTypeSpecifierStyle = []|[("prefer-top-level" | "prefer-inline")]
9520
9540
  // ----- import/dynamic-import-chunkname -----
9521
9541
  type ImportDynamicImportChunkname = []|[{
9522
9542
  importFunctions?: string[]
@@ -9736,6 +9756,17 @@ type ImportOrder = []|[{
9736
9756
  position?: ("after" | "before")
9737
9757
  }[]
9738
9758
  "newlines-between"?: ("ignore" | "always" | "always-and-inside-groups" | "never")
9759
+ "newlines-between-types"?: ("ignore" | "always" | "always-and-inside-groups" | "never")
9760
+ consolidateIslands?: ("inside-groups" | "never")
9761
+ sortTypesGroup?: boolean
9762
+ named?: (boolean | {
9763
+ enabled?: boolean
9764
+ import?: boolean
9765
+ export?: boolean
9766
+ require?: boolean
9767
+ cjsExports?: boolean
9768
+ types?: ("mixed" | "types-first" | "types-last")
9769
+ })
9739
9770
  alphabetize?: {
9740
9771
  caseInsensitive?: boolean
9741
9772
  order?: ("ignore" | "asc" | "desc")
@@ -18798,7 +18829,8 @@ interface VendoredPrettierOptionsRequired {
18798
18829
  }
18799
18830
 
18800
18831
  type Awaitable<T> = Promise<T> | T;
18801
- type Rules = RuleOptions;
18832
+ interface Rules extends RuleOptions {
18833
+ }
18802
18834
 
18803
18835
  type TypedFlatConfigItem = {
18804
18836
  /**
@@ -18828,6 +18860,13 @@ interface OptionsVue extends OptionsOverrides {
18828
18860
  * @default 3
18829
18861
  */
18830
18862
  vueVersion?: 2 | 3;
18863
+ /**
18864
+ * Vue accessibility plugin. Help check a11y issue in `.vue` files upon enabled
18865
+ *
18866
+ * @see https://vue-a11y.github.io/eslint-plugin-vuejs-accessibility/
18867
+ * @default false
18868
+ */
18869
+ a11y?: boolean;
18831
18870
  }
18832
18871
  type OptionsTypescript = (OptionsOverrides & OptionsTypeScriptParserOptions) | (OptionsOverrides & OptionsTypeScriptWithTypes);
18833
18872
  interface OptionsFormatters {
@@ -19102,7 +19141,7 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
19102
19141
  * Currently it's disabled by default, as it's still experimental.
19103
19142
  * In the future it will be smartly enabled based on the project usage.
19104
19143
  *
19105
- * @see https://github.com/antfu/pnpm-workspace-utils
19144
+ * @see https://github.com/antfu/pnpm-workspace-utils
19106
19145
  * @experimental
19107
19146
  * @default false
19108
19147
  */
package/dist/index.js CHANGED
@@ -1314,6 +1314,12 @@ var RemixPackages = [
1314
1314
  "@remix-run/serve",
1315
1315
  "@remix-run/dev"
1316
1316
  ];
1317
+ var ReactRouterPackages = [
1318
+ "@react-router/node",
1319
+ "@react-router/react",
1320
+ "@react-router/serve",
1321
+ "@react-router/dev"
1322
+ ];
1317
1323
  var NextJsPackages = [
1318
1324
  "next"
1319
1325
  ];
@@ -1330,7 +1336,7 @@ async function react(options = {}) {
1330
1336
  } = options;
1331
1337
  const isTypeAware = !!tsconfigPath;
1332
1338
  const typeAwareRules = {
1333
- "react/no-leaked-conditional-rendering": "warn"
1339
+ "react/no-leaked-conditional-rendering": WARN
1334
1340
  };
1335
1341
  const [
1336
1342
  pluginReact,
@@ -1343,6 +1349,7 @@ async function react(options = {}) {
1343
1349
  ]);
1344
1350
  const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => isPackageExists3(i));
1345
1351
  const isUsingRemix = RemixPackages.some((i) => isPackageExists3(i));
1352
+ const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists3(i));
1346
1353
  const isUsingNext = NextJsPackages.some((i) => isPackageExists3(i));
1347
1354
  const plugins = pluginReact.configs.all.plugins;
1348
1355
  return [
@@ -1354,7 +1361,8 @@ async function react(options = {}) {
1354
1361
  "react-hooks": pluginReactHooks,
1355
1362
  "react-hooks-extra": plugins["@eslint-react/hooks-extra"],
1356
1363
  "react-naming-convention": plugins["@eslint-react/naming-convention"],
1357
- "react-refresh": pluginReactRefresh
1364
+ "react-refresh": pluginReactRefresh,
1365
+ "react-web-api": plugins["@eslint-react/web-api"]
1358
1366
  }
1359
1367
  },
1360
1368
  {
@@ -1369,28 +1377,86 @@ async function react(options = {}) {
1369
1377
  },
1370
1378
  name: "vinicunca/react/rules",
1371
1379
  rules: {
1372
- // recommended rules from @eslint-react/dom
1373
- "react-dom/no-children-in-void-dom-elements": WARN,
1380
+ // recommended rules from eslint-plugin-react-x https://eslint-react.xyz/docs/rules/overview#core-rules
1381
+ "react/no-access-state-in-setstate": ERROR,
1382
+ "react/no-array-index-key": WARN,
1383
+ "react/no-children-count": WARN,
1384
+ "react/no-children-for-each": WARN,
1385
+ "react/no-children-map": WARN,
1386
+ "react/no-children-only": WARN,
1387
+ "react/no-children-to-array": WARN,
1388
+ "react/no-clone-element": WARN,
1389
+ "react/no-comment-textnodes": WARN,
1390
+ "react/no-component-will-mount": ERROR,
1391
+ "react/no-component-will-receive-props": ERROR,
1392
+ "react/no-component-will-update": ERROR,
1393
+ "react/no-context-provider": WARN,
1394
+ "react/no-create-ref": ERROR,
1395
+ "react/no-default-props": ERROR,
1396
+ "react/no-direct-mutation-state": ERROR,
1397
+ "react/no-duplicate-jsx-props": WARN,
1398
+ "react/no-duplicate-key": WARN,
1399
+ "react/no-forward-ref": WARN,
1400
+ "react/no-implicit-key": WARN,
1401
+ "react/no-missing-key": ERROR,
1402
+ "react/no-nested-component-definitions": ERROR,
1403
+ "react/no-prop-types": ERROR,
1404
+ "react/no-redundant-should-component-update": ERROR,
1405
+ "react/no-set-state-in-component-did-mount": WARN,
1406
+ "react/no-set-state-in-component-did-update": WARN,
1407
+ "react/no-set-state-in-component-will-update": WARN,
1408
+ "react/no-string-refs": ERROR,
1409
+ "react/no-unsafe-component-will-mount": WARN,
1410
+ "react/no-unsafe-component-will-receive-props": WARN,
1411
+ "react/no-unsafe-component-will-update": WARN,
1412
+ "react/no-unstable-context-value": WARN,
1413
+ "react/no-unstable-default-props": WARN,
1414
+ "react/no-unused-class-component-members": WARN,
1415
+ "react/no-unused-state": WARN,
1416
+ "react/no-use-context": WARN,
1417
+ "react/no-useless-forward-ref": WARN,
1418
+ "react/use-jsx-vars": WARN,
1419
+ // recommended rules from eslint-plugin-react-dom https://eslint-react.xyz/docs/rules/overview#dom-rule
1374
1420
  "react-dom/no-dangerously-set-innerhtml": WARN,
1375
1421
  "react-dom/no-dangerously-set-innerhtml-with-children": ERROR,
1376
1422
  "react-dom/no-find-dom-node": ERROR,
1423
+ "react-dom/no-flush-sync": "error",
1424
+ "react-dom/no-hydrate": "error",
1377
1425
  "react-dom/no-missing-button-type": WARN,
1378
1426
  "react-dom/no-missing-iframe-sandbox": WARN,
1379
1427
  "react-dom/no-namespace": ERROR,
1428
+ "react-dom/no-render": "error",
1380
1429
  "react-dom/no-render-return-value": ERROR,
1381
1430
  "react-dom/no-script-url": WARN,
1382
1431
  "react-dom/no-unsafe-iframe-sandbox": WARN,
1383
1432
  "react-dom/no-unsafe-target-blank": WARN,
1384
- // recommended rules react-hooks
1433
+ "react-dom/no-use-form-state": "error",
1434
+ "react-dom/no-void-elements-with-children": "error",
1435
+ // recommended rules eslint-plugin-react-hooks https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks/src/rules
1385
1436
  "react-hooks/exhaustive-deps": WARN,
1386
1437
  "react-hooks/rules-of-hooks": ERROR,
1387
- // react refresh
1438
+ // recommended rules from eslint-plugin-react-hooks-extra https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules
1439
+ "react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
1440
+ "react-hooks-extra/no-unnecessary-use-prefix": "warn",
1441
+ // recommended rules from eslint-plugin-react-web-api https://eslint-react.xyz/docs/rules/overview#web-api-rules
1442
+ "react-web-api/no-leaked-event-listener": "warn",
1443
+ "react-web-api/no-leaked-interval": "warn",
1444
+ "react-web-api/no-leaked-resize-observer": "warn",
1445
+ "react-web-api/no-leaked-timeout": "warn",
1446
+ // preconfigured rules from eslint-plugin-react-refresh https://github.com/ArnaudBarre/eslint-plugin-react-refresh/tree/main/src
1388
1447
  "react-refresh/only-export-components": [
1389
1448
  WARN,
1390
1449
  {
1391
1450
  allowConstantExport: isAllowConstantExport,
1392
1451
  allowExportNames: [
1393
1452
  ...isUsingNext ? [
1453
+ "dynamic",
1454
+ "dynamicParams",
1455
+ "revalidate",
1456
+ "fetchCache",
1457
+ "runtime",
1458
+ "preferredRegion",
1459
+ "maxDuration",
1394
1460
  "config",
1395
1461
  "generateStaticParams",
1396
1462
  "metadata",
@@ -1398,7 +1464,7 @@ async function react(options = {}) {
1398
1464
  "viewport",
1399
1465
  "generateViewport"
1400
1466
  ] : [],
1401
- ...isUsingRemix ? [
1467
+ ...isUsingRemix || isUsingReactRouter ? [
1402
1468
  "meta",
1403
1469
  "links",
1404
1470
  "headers",
@@ -1408,43 +1474,6 @@ async function react(options = {}) {
1408
1474
  ]
1409
1475
  }
1410
1476
  ],
1411
- // recommended rules from @eslint-react
1412
- "react/ensure-forward-ref-using-ref": WARN,
1413
- "react/no-access-state-in-setstate": ERROR,
1414
- "react/no-array-index-key": WARN,
1415
- "react/no-children-count": WARN,
1416
- "react/no-children-for-each": WARN,
1417
- "react/no-children-map": WARN,
1418
- "react/no-children-only": WARN,
1419
- "react/no-children-prop": WARN,
1420
- "react/no-children-to-array": WARN,
1421
- "react/no-clone-element": WARN,
1422
- "react/no-comment-textnodes": WARN,
1423
- "react/no-component-will-mount": ERROR,
1424
- "react/no-component-will-receive-props": ERROR,
1425
- "react/no-component-will-update": ERROR,
1426
- "react/no-create-ref": ERROR,
1427
- "react/no-direct-mutation-state": ERROR,
1428
- "react/no-duplicate-key": ERROR,
1429
- "react/no-implicit-key": ERROR,
1430
- "react/no-missing-key": ERROR,
1431
- "react/no-nested-components": WARN,
1432
- "react/no-redundant-should-component-update": ERROR,
1433
- "react/no-set-state-in-component-did-mount": WARN,
1434
- "react/no-set-state-in-component-did-update": WARN,
1435
- "react/no-set-state-in-component-will-update": WARN,
1436
- "react/no-string-refs": ERROR,
1437
- "react/no-unsafe-component-will-mount": WARN,
1438
- "react/no-unsafe-component-will-receive-props": WARN,
1439
- "react/no-unsafe-component-will-update": WARN,
1440
- "react/no-unstable-context-value": ERROR,
1441
- "react/no-unstable-default-props": ERROR,
1442
- "react/no-unused-class-component-members": WARN,
1443
- "react/no-unused-state": WARN,
1444
- "react/no-useless-fragment": WARN,
1445
- "react/prefer-destructuring-assignment": WARN,
1446
- "react/prefer-shorthand-boolean": WARN,
1447
- "react/prefer-shorthand-fragment": WARN,
1448
1477
  // overrides
1449
1478
  ...overrides
1450
1479
  }
@@ -1727,6 +1756,7 @@ function sortTsconfig() {
1727
1756
  "useDefineForClassFields",
1728
1757
  "emitDecoratorMetadata",
1729
1758
  "experimentalDecorators",
1759
+ "libReplacement",
1730
1760
  /* Modules */
1731
1761
  "baseUrl",
1732
1762
  "rootDir",
@@ -1800,6 +1830,7 @@ function sortTsconfig() {
1800
1830
  "isolatedModules",
1801
1831
  "preserveSymlinks",
1802
1832
  "verbatimModuleSyntax",
1833
+ "erasableSyntaxOnly",
1803
1834
  /* Completeness */
1804
1835
  "skipDefaultLibCheck",
1805
1836
  "skipLibCheck"
@@ -2269,26 +2300,35 @@ async function vue(options = {}) {
2269
2300
  const {
2270
2301
  files = [GLOB_VUE],
2271
2302
  overrides = {},
2272
- stylistic: stylistic2 = true
2303
+ stylistic: stylistic2 = true,
2304
+ a11y = false
2273
2305
  } = options;
2274
2306
  const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
2275
2307
  const {
2276
2308
  indent = 2
2277
2309
  } = e2(stylistic2) ? {} : stylistic2;
2310
+ if (a11y) {
2311
+ await ensurePackages([
2312
+ "eslint-plugin-vuejs-accessibility"
2313
+ ]);
2314
+ }
2278
2315
  const [
2279
2316
  pluginVue,
2280
2317
  parserVue,
2281
- processorVueBlocks
2318
+ processorVueBlocks,
2319
+ pluginVueA11y
2282
2320
  ] = await Promise.all([
2283
2321
  interopDefault(import("eslint-plugin-vue")),
2284
2322
  interopDefault(import("vue-eslint-parser")),
2285
- interopDefault(import("eslint-processor-vue-blocks"))
2323
+ interopDefault(import("eslint-processor-vue-blocks")),
2324
+ ...a11y ? [interopDefault(import("eslint-plugin-vuejs-accessibility"))] : []
2286
2325
  ]);
2287
2326
  return [
2288
2327
  {
2289
2328
  name: "vinicunca/vue/setup",
2290
2329
  plugins: {
2291
- vue: pluginVue
2330
+ vue: pluginVue,
2331
+ ...a11y ? { "vue-a11y": pluginVueA11y } : {}
2292
2332
  },
2293
2333
  // This allows Vue plugin to work with auto imports
2294
2334
  // https://github.com/vuejs/eslint-plugin-vue/pull/2422
@@ -2428,6 +2468,30 @@ async function vue(options = {}) {
2428
2468
  "vue/space-in-parens": [ERROR, NEVER],
2429
2469
  "vue/template-curly-spacing": ERROR
2430
2470
  } : {},
2471
+ ...a11y ? {
2472
+ "vue-a11y/alt-text": ERROR,
2473
+ "vue-a11y/anchor-has-content": ERROR,
2474
+ "vue-a11y/aria-props": ERROR,
2475
+ "vue-a11y/aria-role": ERROR,
2476
+ "vue-a11y/aria-unsupported-elements": ERROR,
2477
+ "vue-a11y/click-events-have-key-events": ERROR,
2478
+ "vue-a11y/form-control-has-label": ERROR,
2479
+ "vue-a11y/heading-has-content": ERROR,
2480
+ "vue-a11y/iframe-has-title": ERROR,
2481
+ "vue-a11y/interactive-supports-focus": ERROR,
2482
+ "vue-a11y/label-has-for": ERROR,
2483
+ "vue-a11y/media-has-caption": WARN,
2484
+ "vue-a11y/mouse-events-have-key-events": ERROR,
2485
+ "vue-a11y/no-access-key": ERROR,
2486
+ "vue-a11y/no-aria-hidden-on-focusable": ERROR,
2487
+ "vue-a11y/no-autofocus": WARN,
2488
+ "vue-a11y/no-distracting-elements": ERROR,
2489
+ "vue-a11y/no-redundant-roles": ERROR,
2490
+ "vue-a11y/no-role-presentation-on-focusable": ERROR,
2491
+ "vue-a11y/no-static-element-interactions": ERROR,
2492
+ "vue-a11y/role-has-required-aria-props": ERROR,
2493
+ "vue-a11y/tabindex-no-positive": WARN
2494
+ } : {},
2431
2495
  ...overrides
2432
2496
  }
2433
2497
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vinicunca/eslint-config",
3
3
  "type": "module",
4
- "version": "3.8.0",
4
+ "version": "3.9.0",
5
5
  "description": "Vinicunca ESLint config",
6
6
  "author": {
7
7
  "name": "praburangki",
@@ -58,10 +58,11 @@
58
58
  "eslint": "^9.10.0",
59
59
  "eslint-plugin-astro": "^1.2.0",
60
60
  "eslint-plugin-format": ">=0.1.0",
61
- "eslint-plugin-react-hooks": "^5.0.0",
62
- "eslint-plugin-react-refresh": "^0.4.4",
61
+ "eslint-plugin-react-hooks": "^5.2.0",
62
+ "eslint-plugin-react-refresh": "^0.4.19",
63
63
  "eslint-plugin-solid": "^0.14.3",
64
64
  "eslint-plugin-svelte": ">=2.35.1",
65
+ "eslint-plugin-vuejs-accessibility": "^2.4.1",
65
66
  "prettier-plugin-astro": "^0.14.0",
66
67
  "prettier-plugin-slidev": "^1.0.5",
67
68
  "svelte-eslint-parser": ">=0.37.0"
@@ -94,6 +95,9 @@
94
95
  "eslint-plugin-svelte": {
95
96
  "optional": true
96
97
  },
98
+ "eslint-plugin-vuejs-accessibility": {
99
+ "optional": true
100
+ },
97
101
  "prettier-plugin-astro": {
98
102
  "optional": true
99
103
  },
@@ -110,18 +114,18 @@
110
114
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
111
115
  "@eslint/markdown": "^6.3.0",
112
116
  "@stylistic/eslint-plugin": "^4.2.0",
113
- "@typescript-eslint/eslint-plugin": "^8.26.1",
114
- "@typescript-eslint/parser": "^8.26.1",
117
+ "@typescript-eslint/eslint-plugin": "^8.27.0",
118
+ "@typescript-eslint/parser": "^8.27.0",
115
119
  "@unocss/eslint-plugin": "^66.0.0",
116
- "@vitest/eslint-plugin": "^1.1.37",
120
+ "@vitest/eslint-plugin": "^1.1.38",
117
121
  "eslint-config-flat-gitignore": "^2.1.0",
118
122
  "eslint-flat-config-utils": "^2.0.1",
119
123
  "eslint-merge-processors": "^2.0.0",
120
124
  "eslint-plugin-antfu": "^3.1.1",
121
- "eslint-plugin-command": "^3.1.0",
125
+ "eslint-plugin-command": "^3.2.0",
122
126
  "eslint-plugin-format": "^1.0.1",
123
- "eslint-plugin-import-x": "^4.6.1",
124
- "eslint-plugin-jsdoc": "^50.6.6",
127
+ "eslint-plugin-import-x": "^4.9.1",
128
+ "eslint-plugin-jsdoc": "^50.6.8",
125
129
  "eslint-plugin-jsonc": "^2.19.1",
126
130
  "eslint-plugin-n": "^17.16.2",
127
131
  "eslint-plugin-no-only-tests": "^3.3.0",