@meteorlxy/eslint-config 7.3.0 → 7.5.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/dist/index.cjs +43 -17
- package/dist/index.d.cts +31 -7
- package/dist/index.d.mts +31 -7
- package/dist/index.mjs +36 -10
- package/package.json +14 -14
package/dist/index.cjs
CHANGED
|
@@ -31,20 +31,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
31
|
}) : target, mod));
|
|
32
32
|
//#endregion
|
|
33
33
|
let eslint_plugin_import_x = require("eslint-plugin-import-x");
|
|
34
|
-
eslint_plugin_import_x = __toESM(eslint_plugin_import_x);
|
|
34
|
+
eslint_plugin_import_x = __toESM(eslint_plugin_import_x, 1);
|
|
35
35
|
let confusing_browser_globals = require("confusing-browser-globals");
|
|
36
|
-
confusing_browser_globals = __toESM(confusing_browser_globals);
|
|
36
|
+
confusing_browser_globals = __toESM(confusing_browser_globals, 1);
|
|
37
37
|
let _typescript_eslint_eslint_plugin = require("@typescript-eslint/eslint-plugin");
|
|
38
|
-
_typescript_eslint_eslint_plugin = __toESM(_typescript_eslint_eslint_plugin);
|
|
39
|
-
let
|
|
40
|
-
|
|
38
|
+
_typescript_eslint_eslint_plugin = __toESM(_typescript_eslint_eslint_plugin, 1);
|
|
39
|
+
let _eslint_community_eslint_plugin_eslint_comments = require("@eslint-community/eslint-plugin-eslint-comments");
|
|
40
|
+
_eslint_community_eslint_plugin_eslint_comments = __toESM(_eslint_community_eslint_plugin_eslint_comments, 1);
|
|
41
41
|
let globals = require("globals");
|
|
42
|
-
globals = __toESM(globals);
|
|
42
|
+
globals = __toESM(globals, 1);
|
|
43
43
|
let eslint_merge_processors = require("eslint-merge-processors");
|
|
44
44
|
let eslint_config_prettier_flat = require("eslint-config-prettier/flat");
|
|
45
|
-
eslint_config_prettier_flat = __toESM(eslint_config_prettier_flat);
|
|
45
|
+
eslint_config_prettier_flat = __toESM(eslint_config_prettier_flat, 1);
|
|
46
46
|
let _typescript_eslint_parser = require("@typescript-eslint/parser");
|
|
47
|
-
_typescript_eslint_parser = __toESM(_typescript_eslint_parser);
|
|
47
|
+
_typescript_eslint_parser = __toESM(_typescript_eslint_parser, 1);
|
|
48
48
|
//#region src/utils.ts
|
|
49
49
|
var utils_exports = /* @__PURE__ */ __exportAll({ interopDefault: () => interopDefault });
|
|
50
50
|
const interopDefault = async (m) => {
|
|
@@ -594,10 +594,15 @@ const builtinRules = {
|
|
|
594
594
|
//#endregion
|
|
595
595
|
//#region src/rules/eslint-comments.ts
|
|
596
596
|
const eslintCommentsRules = {
|
|
597
|
-
"eslint-comments/
|
|
598
|
-
"eslint-comments/no-
|
|
599
|
-
"eslint-comments/no-
|
|
600
|
-
"eslint-comments/no-
|
|
597
|
+
"@eslint-community/eslint-comments/disable-enable-pair": "error",
|
|
598
|
+
"@eslint-community/eslint-comments/no-aggregating-enable": "error",
|
|
599
|
+
"@eslint-community/eslint-comments/no-duplicate-disable": "error",
|
|
600
|
+
"@eslint-community/eslint-comments/no-unlimited-disable": "error",
|
|
601
|
+
"@eslint-community/eslint-comments/no-unused-disable": "error",
|
|
602
|
+
"@eslint-community/eslint-comments/no-unused-enable": "error",
|
|
603
|
+
"@eslint-community/eslint-comments/no-restricted-disable": "off",
|
|
604
|
+
"@eslint-community/eslint-comments/no-use": ["off", { allow: [] }],
|
|
605
|
+
"@eslint-community/eslint-comments/require-description": ["error", { ignore: [] }]
|
|
601
606
|
};
|
|
602
607
|
//#endregion
|
|
603
608
|
//#region src/rules/imports.ts
|
|
@@ -815,6 +820,7 @@ const markdownShimRules = {
|
|
|
815
820
|
//#region src/rules/markdown.ts
|
|
816
821
|
const markdownRules = {
|
|
817
822
|
"markdown/fenced-code-language": "error",
|
|
823
|
+
"markdown/fenced-code-meta": "off",
|
|
818
824
|
"markdown/heading-increment": "error",
|
|
819
825
|
"markdown/no-bare-urls": "off",
|
|
820
826
|
"markdown/no-duplicate-definitions": "error",
|
|
@@ -860,12 +866,12 @@ const reactHooksRules = {
|
|
|
860
866
|
"react-hooks/static-components": "error",
|
|
861
867
|
"react-hooks/unsupported-syntax": "error",
|
|
862
868
|
"react-hooks/use-memo": "error",
|
|
863
|
-
"react-hooks/automatic-effect-dependencies": "off",
|
|
864
869
|
"react-hooks/capitalized-calls": "off",
|
|
870
|
+
"react-hooks/exhaustive-effect-dependencies": "off",
|
|
865
871
|
"react-hooks/fbt": "off",
|
|
866
|
-
"react-hooks/fire": "off",
|
|
867
872
|
"react-hooks/hooks": "off",
|
|
868
873
|
"react-hooks/invariant": "off",
|
|
874
|
+
"react-hooks/memo-dependencies": "off",
|
|
869
875
|
"react-hooks/memoized-effect-dependencies": "off",
|
|
870
876
|
"react-hooks/no-deriving-state-in-effects": "off",
|
|
871
877
|
"react-hooks/rule-suppression": "off",
|
|
@@ -1081,6 +1087,9 @@ const reactRules = {
|
|
|
1081
1087
|
//#endregion
|
|
1082
1088
|
//#region src/rules/typescript-shim.ts
|
|
1083
1089
|
const typescriptShimRules = {
|
|
1090
|
+
/**
|
|
1091
|
+
* Rules that are checked by typescript or recommended to disable in typescript.
|
|
1092
|
+
*/
|
|
1084
1093
|
"constructor-super": "off",
|
|
1085
1094
|
"getter-return": "off",
|
|
1086
1095
|
"no-const-assign": "off",
|
|
@@ -1099,6 +1108,11 @@ const typescriptShimRules = {
|
|
|
1099
1108
|
"no-unreachable": "off",
|
|
1100
1109
|
"no-unsafe-negation": "off",
|
|
1101
1110
|
"valid-typeof": "off",
|
|
1111
|
+
/**
|
|
1112
|
+
* Rules from eslint-plugin-import that should be disabled
|
|
1113
|
+
*
|
|
1114
|
+
* @see https://typescript-eslint.io/troubleshooting/performance-troubleshooting#eslint-plugin-import
|
|
1115
|
+
*/
|
|
1102
1116
|
"import/default": "off",
|
|
1103
1117
|
"import/named": "off",
|
|
1104
1118
|
"import/namespace": "off",
|
|
@@ -1108,6 +1122,9 @@ const typescriptShimRules = {
|
|
|
1108
1122
|
"import/no-deprecated": "off",
|
|
1109
1123
|
"import/no-named-as-default": "off",
|
|
1110
1124
|
"import/no-unused-modules": "off",
|
|
1125
|
+
/**
|
|
1126
|
+
* Rules that have equivalents in typescript-eslint plugin.
|
|
1127
|
+
*/
|
|
1111
1128
|
"brace-style": "off",
|
|
1112
1129
|
"camelcase": "off",
|
|
1113
1130
|
"class-methods-use-this": "off",
|
|
@@ -1537,9 +1554,11 @@ const vueRules = {
|
|
|
1537
1554
|
"vue/prefer-define-options": "error",
|
|
1538
1555
|
"vue/prefer-prop-type-boolean-first": "error",
|
|
1539
1556
|
"vue/prefer-separate-static-class": "error",
|
|
1557
|
+
"vue/prefer-single-event-payload": "warn",
|
|
1540
1558
|
"vue/prefer-template": builtinRules["prefer-template"],
|
|
1541
1559
|
"vue/prefer-true-attribute-shorthand": "off",
|
|
1542
1560
|
"vue/prefer-use-template-ref": "error",
|
|
1561
|
+
"vue/prefer-v-model": "warn",
|
|
1543
1562
|
"vue/require-default-export": "warn",
|
|
1544
1563
|
"vue/require-direct-export": ["error", { disallowFunctionalComponentFunction: false }],
|
|
1545
1564
|
"vue/require-explicit-slots": "error",
|
|
@@ -1611,7 +1630,7 @@ const imports = ({ overrides, packageDir } = {}) => [{
|
|
|
1611
1630
|
const javascript = ({ overrides } = {}) => [
|
|
1612
1631
|
{
|
|
1613
1632
|
name: "meteorlxy/javascript/plugins",
|
|
1614
|
-
plugins: { "eslint-comments":
|
|
1633
|
+
plugins: { "@eslint-community/eslint-comments": _eslint_community_eslint_plugin_eslint_comments.default }
|
|
1615
1634
|
},
|
|
1616
1635
|
{
|
|
1617
1636
|
name: "meteorlxy/javascript/rules",
|
|
@@ -1725,7 +1744,7 @@ const prettier = () => [{
|
|
|
1725
1744
|
/**
|
|
1726
1745
|
* React configuration for eslint.
|
|
1727
1746
|
*/
|
|
1728
|
-
const react = async ({ files = ["**/*.ts", "**/*.tsx"], overrides } = {}) => {
|
|
1747
|
+
const react = async ({ files = ["**/*.ts", "**/*.tsx"], overrides, settings } = {}) => {
|
|
1729
1748
|
const [reactPlugin, reactHooksPlugin, reactRefreshPlugin] = await Promise.all([
|
|
1730
1749
|
interopDefault(import("eslint-plugin-react")),
|
|
1731
1750
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
@@ -1738,7 +1757,14 @@ const react = async ({ files = ["**/*.ts", "**/*.tsx"], overrides } = {}) => {
|
|
|
1738
1757
|
"react-hooks": reactHooksPlugin,
|
|
1739
1758
|
"react-refresh": reactRefreshPlugin
|
|
1740
1759
|
},
|
|
1741
|
-
settings: {
|
|
1760
|
+
settings: {
|
|
1761
|
+
...settings,
|
|
1762
|
+
"react": {
|
|
1763
|
+
version: "detect",
|
|
1764
|
+
...settings?.react
|
|
1765
|
+
},
|
|
1766
|
+
"react-hooks": { ...settings?.["react-hooks"] }
|
|
1767
|
+
}
|
|
1742
1768
|
}, {
|
|
1743
1769
|
name: "meteorlxy/react/rules",
|
|
1744
1770
|
files,
|
package/dist/index.d.cts
CHANGED
|
@@ -78,13 +78,25 @@ declare const prettier: () => Config[];
|
|
|
78
78
|
interface EslintReactOptions {
|
|
79
79
|
files?: Config['files'];
|
|
80
80
|
overrides?: Config['rules'];
|
|
81
|
+
settings?: {
|
|
82
|
+
'react'?: {
|
|
83
|
+
version?: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* @see https://react.dev/reference/eslint-plugin-react-hooks/lints/rules-of-hooks#options
|
|
87
|
+
*/
|
|
88
|
+
'react-hooks'?: {
|
|
89
|
+
additionalEffectHooks?: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
81
92
|
}
|
|
82
93
|
/**
|
|
83
94
|
* React configuration for eslint.
|
|
84
95
|
*/
|
|
85
96
|
declare const react$1: ({
|
|
86
97
|
files,
|
|
87
|
-
overrides
|
|
98
|
+
overrides,
|
|
99
|
+
settings
|
|
88
100
|
}?: EslintReactOptions) => Promise<Config[]>;
|
|
89
101
|
//#endregion
|
|
90
102
|
//#region src/configs/typescript.d.ts
|
|
@@ -592,10 +604,19 @@ declare const builtinRules: {
|
|
|
592
604
|
//#endregion
|
|
593
605
|
//#region src/rules/eslint-comments.d.ts
|
|
594
606
|
declare const eslintCommentsRules: {
|
|
595
|
-
'eslint-comments/
|
|
596
|
-
'eslint-comments/no-
|
|
597
|
-
'eslint-comments/no-
|
|
598
|
-
'eslint-comments/no-
|
|
607
|
+
'@eslint-community/eslint-comments/disable-enable-pair': "error";
|
|
608
|
+
'@eslint-community/eslint-comments/no-aggregating-enable': "error";
|
|
609
|
+
'@eslint-community/eslint-comments/no-duplicate-disable': "error";
|
|
610
|
+
'@eslint-community/eslint-comments/no-unlimited-disable': "error";
|
|
611
|
+
'@eslint-community/eslint-comments/no-unused-disable': "error";
|
|
612
|
+
'@eslint-community/eslint-comments/no-unused-enable': "error";
|
|
613
|
+
'@eslint-community/eslint-comments/no-restricted-disable': "off";
|
|
614
|
+
'@eslint-community/eslint-comments/no-use': ["off", {
|
|
615
|
+
allow: never[];
|
|
616
|
+
}];
|
|
617
|
+
'@eslint-community/eslint-comments/require-description': ["error", {
|
|
618
|
+
ignore: never[];
|
|
619
|
+
}];
|
|
599
620
|
};
|
|
600
621
|
//#endregion
|
|
601
622
|
//#region src/rules/imports.d.ts
|
|
@@ -768,6 +789,7 @@ declare const markdownShimRules: {
|
|
|
768
789
|
//#region src/rules/markdown.d.ts
|
|
769
790
|
declare const markdownRules: {
|
|
770
791
|
'markdown/fenced-code-language': "error";
|
|
792
|
+
'markdown/fenced-code-meta': "off";
|
|
771
793
|
'markdown/heading-increment': "error";
|
|
772
794
|
'markdown/no-bare-urls': "off";
|
|
773
795
|
'markdown/no-duplicate-definitions': "error";
|
|
@@ -815,12 +837,12 @@ declare const reactHooksRules: {
|
|
|
815
837
|
'react-hooks/static-components': "error";
|
|
816
838
|
'react-hooks/unsupported-syntax': "error";
|
|
817
839
|
'react-hooks/use-memo': "error";
|
|
818
|
-
'react-hooks/automatic-effect-dependencies': "off";
|
|
819
840
|
'react-hooks/capitalized-calls': "off";
|
|
841
|
+
'react-hooks/exhaustive-effect-dependencies': "off";
|
|
820
842
|
'react-hooks/fbt': "off";
|
|
821
|
-
'react-hooks/fire': "off";
|
|
822
843
|
'react-hooks/hooks': "off";
|
|
823
844
|
'react-hooks/invariant': "off";
|
|
845
|
+
'react-hooks/memo-dependencies': "off";
|
|
824
846
|
'react-hooks/memoized-effect-dependencies': "off";
|
|
825
847
|
'react-hooks/no-deriving-state-in-effects': "off";
|
|
826
848
|
'react-hooks/rule-suppression': "off";
|
|
@@ -1530,9 +1552,11 @@ declare const vueRules: {
|
|
|
1530
1552
|
'vue/prefer-define-options': "error";
|
|
1531
1553
|
'vue/prefer-prop-type-boolean-first': "error";
|
|
1532
1554
|
'vue/prefer-separate-static-class': "error";
|
|
1555
|
+
'vue/prefer-single-event-payload': "warn";
|
|
1533
1556
|
'vue/prefer-template': "error";
|
|
1534
1557
|
'vue/prefer-true-attribute-shorthand': "off";
|
|
1535
1558
|
'vue/prefer-use-template-ref': "error";
|
|
1559
|
+
'vue/prefer-v-model': "warn";
|
|
1536
1560
|
'vue/require-default-export': "warn";
|
|
1537
1561
|
'vue/require-direct-export': ["error", {
|
|
1538
1562
|
disallowFunctionalComponentFunction: boolean;
|
package/dist/index.d.mts
CHANGED
|
@@ -76,13 +76,25 @@ declare const prettier: () => Config[];
|
|
|
76
76
|
interface EslintReactOptions {
|
|
77
77
|
files?: Config['files'];
|
|
78
78
|
overrides?: Config['rules'];
|
|
79
|
+
settings?: {
|
|
80
|
+
'react'?: {
|
|
81
|
+
version?: string;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* @see https://react.dev/reference/eslint-plugin-react-hooks/lints/rules-of-hooks#options
|
|
85
|
+
*/
|
|
86
|
+
'react-hooks'?: {
|
|
87
|
+
additionalEffectHooks?: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
79
90
|
}
|
|
80
91
|
/**
|
|
81
92
|
* React configuration for eslint.
|
|
82
93
|
*/
|
|
83
94
|
declare const react$1: ({
|
|
84
95
|
files,
|
|
85
|
-
overrides
|
|
96
|
+
overrides,
|
|
97
|
+
settings
|
|
86
98
|
}?: EslintReactOptions) => Promise<Config[]>;
|
|
87
99
|
//#endregion
|
|
88
100
|
//#region src/configs/typescript.d.ts
|
|
@@ -590,10 +602,19 @@ declare const builtinRules: {
|
|
|
590
602
|
//#endregion
|
|
591
603
|
//#region src/rules/eslint-comments.d.ts
|
|
592
604
|
declare const eslintCommentsRules: {
|
|
593
|
-
'eslint-comments/
|
|
594
|
-
'eslint-comments/no-
|
|
595
|
-
'eslint-comments/no-
|
|
596
|
-
'eslint-comments/no-
|
|
605
|
+
'@eslint-community/eslint-comments/disable-enable-pair': "error";
|
|
606
|
+
'@eslint-community/eslint-comments/no-aggregating-enable': "error";
|
|
607
|
+
'@eslint-community/eslint-comments/no-duplicate-disable': "error";
|
|
608
|
+
'@eslint-community/eslint-comments/no-unlimited-disable': "error";
|
|
609
|
+
'@eslint-community/eslint-comments/no-unused-disable': "error";
|
|
610
|
+
'@eslint-community/eslint-comments/no-unused-enable': "error";
|
|
611
|
+
'@eslint-community/eslint-comments/no-restricted-disable': "off";
|
|
612
|
+
'@eslint-community/eslint-comments/no-use': ["off", {
|
|
613
|
+
allow: never[];
|
|
614
|
+
}];
|
|
615
|
+
'@eslint-community/eslint-comments/require-description': ["error", {
|
|
616
|
+
ignore: never[];
|
|
617
|
+
}];
|
|
597
618
|
};
|
|
598
619
|
//#endregion
|
|
599
620
|
//#region src/rules/imports.d.ts
|
|
@@ -766,6 +787,7 @@ declare const markdownShimRules: {
|
|
|
766
787
|
//#region src/rules/markdown.d.ts
|
|
767
788
|
declare const markdownRules: {
|
|
768
789
|
'markdown/fenced-code-language': "error";
|
|
790
|
+
'markdown/fenced-code-meta': "off";
|
|
769
791
|
'markdown/heading-increment': "error";
|
|
770
792
|
'markdown/no-bare-urls': "off";
|
|
771
793
|
'markdown/no-duplicate-definitions': "error";
|
|
@@ -813,12 +835,12 @@ declare const reactHooksRules: {
|
|
|
813
835
|
'react-hooks/static-components': "error";
|
|
814
836
|
'react-hooks/unsupported-syntax': "error";
|
|
815
837
|
'react-hooks/use-memo': "error";
|
|
816
|
-
'react-hooks/automatic-effect-dependencies': "off";
|
|
817
838
|
'react-hooks/capitalized-calls': "off";
|
|
839
|
+
'react-hooks/exhaustive-effect-dependencies': "off";
|
|
818
840
|
'react-hooks/fbt': "off";
|
|
819
|
-
'react-hooks/fire': "off";
|
|
820
841
|
'react-hooks/hooks': "off";
|
|
821
842
|
'react-hooks/invariant': "off";
|
|
843
|
+
'react-hooks/memo-dependencies': "off";
|
|
822
844
|
'react-hooks/memoized-effect-dependencies': "off";
|
|
823
845
|
'react-hooks/no-deriving-state-in-effects': "off";
|
|
824
846
|
'react-hooks/rule-suppression': "off";
|
|
@@ -1528,9 +1550,11 @@ declare const vueRules: {
|
|
|
1528
1550
|
'vue/prefer-define-options': "error";
|
|
1529
1551
|
'vue/prefer-prop-type-boolean-first': "error";
|
|
1530
1552
|
'vue/prefer-separate-static-class': "error";
|
|
1553
|
+
'vue/prefer-single-event-payload': "warn";
|
|
1531
1554
|
'vue/prefer-template': "error";
|
|
1532
1555
|
'vue/prefer-true-attribute-shorthand': "off";
|
|
1533
1556
|
'vue/prefer-use-template-ref': "error";
|
|
1557
|
+
'vue/prefer-v-model': "warn";
|
|
1534
1558
|
'vue/require-default-export': "warn";
|
|
1535
1559
|
'vue/require-direct-export': ["error", {
|
|
1536
1560
|
disallowFunctionalComponentFunction: boolean;
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { t as __exportAll } from "./chunk-CfYAbeIz.mjs";
|
|
|
2
2
|
import importPlugin from "eslint-plugin-import-x";
|
|
3
3
|
import confusingBrowserGlobals from "confusing-browser-globals";
|
|
4
4
|
import tsPlugin from "@typescript-eslint/eslint-plugin";
|
|
5
|
-
import eslintCommentsPlugin from "eslint-plugin-eslint-comments";
|
|
5
|
+
import eslintCommentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
|
|
6
6
|
import globals from "globals";
|
|
7
7
|
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
8
8
|
import prettierConfig from "eslint-config-prettier/flat";
|
|
@@ -556,10 +556,15 @@ const builtinRules = {
|
|
|
556
556
|
//#endregion
|
|
557
557
|
//#region src/rules/eslint-comments.ts
|
|
558
558
|
const eslintCommentsRules = {
|
|
559
|
-
"eslint-comments/
|
|
560
|
-
"eslint-comments/no-
|
|
561
|
-
"eslint-comments/no-
|
|
562
|
-
"eslint-comments/no-
|
|
559
|
+
"@eslint-community/eslint-comments/disable-enable-pair": "error",
|
|
560
|
+
"@eslint-community/eslint-comments/no-aggregating-enable": "error",
|
|
561
|
+
"@eslint-community/eslint-comments/no-duplicate-disable": "error",
|
|
562
|
+
"@eslint-community/eslint-comments/no-unlimited-disable": "error",
|
|
563
|
+
"@eslint-community/eslint-comments/no-unused-disable": "error",
|
|
564
|
+
"@eslint-community/eslint-comments/no-unused-enable": "error",
|
|
565
|
+
"@eslint-community/eslint-comments/no-restricted-disable": "off",
|
|
566
|
+
"@eslint-community/eslint-comments/no-use": ["off", { allow: [] }],
|
|
567
|
+
"@eslint-community/eslint-comments/require-description": ["error", { ignore: [] }]
|
|
563
568
|
};
|
|
564
569
|
//#endregion
|
|
565
570
|
//#region src/rules/imports.ts
|
|
@@ -777,6 +782,7 @@ const markdownShimRules = {
|
|
|
777
782
|
//#region src/rules/markdown.ts
|
|
778
783
|
const markdownRules = {
|
|
779
784
|
"markdown/fenced-code-language": "error",
|
|
785
|
+
"markdown/fenced-code-meta": "off",
|
|
780
786
|
"markdown/heading-increment": "error",
|
|
781
787
|
"markdown/no-bare-urls": "off",
|
|
782
788
|
"markdown/no-duplicate-definitions": "error",
|
|
@@ -822,12 +828,12 @@ const reactHooksRules = {
|
|
|
822
828
|
"react-hooks/static-components": "error",
|
|
823
829
|
"react-hooks/unsupported-syntax": "error",
|
|
824
830
|
"react-hooks/use-memo": "error",
|
|
825
|
-
"react-hooks/automatic-effect-dependencies": "off",
|
|
826
831
|
"react-hooks/capitalized-calls": "off",
|
|
832
|
+
"react-hooks/exhaustive-effect-dependencies": "off",
|
|
827
833
|
"react-hooks/fbt": "off",
|
|
828
|
-
"react-hooks/fire": "off",
|
|
829
834
|
"react-hooks/hooks": "off",
|
|
830
835
|
"react-hooks/invariant": "off",
|
|
836
|
+
"react-hooks/memo-dependencies": "off",
|
|
831
837
|
"react-hooks/memoized-effect-dependencies": "off",
|
|
832
838
|
"react-hooks/no-deriving-state-in-effects": "off",
|
|
833
839
|
"react-hooks/rule-suppression": "off",
|
|
@@ -1043,6 +1049,9 @@ const reactRules = {
|
|
|
1043
1049
|
//#endregion
|
|
1044
1050
|
//#region src/rules/typescript-shim.ts
|
|
1045
1051
|
const typescriptShimRules = {
|
|
1052
|
+
/**
|
|
1053
|
+
* Rules that are checked by typescript or recommended to disable in typescript.
|
|
1054
|
+
*/
|
|
1046
1055
|
"constructor-super": "off",
|
|
1047
1056
|
"getter-return": "off",
|
|
1048
1057
|
"no-const-assign": "off",
|
|
@@ -1061,6 +1070,11 @@ const typescriptShimRules = {
|
|
|
1061
1070
|
"no-unreachable": "off",
|
|
1062
1071
|
"no-unsafe-negation": "off",
|
|
1063
1072
|
"valid-typeof": "off",
|
|
1073
|
+
/**
|
|
1074
|
+
* Rules from eslint-plugin-import that should be disabled
|
|
1075
|
+
*
|
|
1076
|
+
* @see https://typescript-eslint.io/troubleshooting/performance-troubleshooting#eslint-plugin-import
|
|
1077
|
+
*/
|
|
1064
1078
|
"import/default": "off",
|
|
1065
1079
|
"import/named": "off",
|
|
1066
1080
|
"import/namespace": "off",
|
|
@@ -1070,6 +1084,9 @@ const typescriptShimRules = {
|
|
|
1070
1084
|
"import/no-deprecated": "off",
|
|
1071
1085
|
"import/no-named-as-default": "off",
|
|
1072
1086
|
"import/no-unused-modules": "off",
|
|
1087
|
+
/**
|
|
1088
|
+
* Rules that have equivalents in typescript-eslint plugin.
|
|
1089
|
+
*/
|
|
1073
1090
|
"brace-style": "off",
|
|
1074
1091
|
"camelcase": "off",
|
|
1075
1092
|
"class-methods-use-this": "off",
|
|
@@ -1499,9 +1516,11 @@ const vueRules = {
|
|
|
1499
1516
|
"vue/prefer-define-options": "error",
|
|
1500
1517
|
"vue/prefer-prop-type-boolean-first": "error",
|
|
1501
1518
|
"vue/prefer-separate-static-class": "error",
|
|
1519
|
+
"vue/prefer-single-event-payload": "warn",
|
|
1502
1520
|
"vue/prefer-template": builtinRules["prefer-template"],
|
|
1503
1521
|
"vue/prefer-true-attribute-shorthand": "off",
|
|
1504
1522
|
"vue/prefer-use-template-ref": "error",
|
|
1523
|
+
"vue/prefer-v-model": "warn",
|
|
1505
1524
|
"vue/require-default-export": "warn",
|
|
1506
1525
|
"vue/require-direct-export": ["error", { disallowFunctionalComponentFunction: false }],
|
|
1507
1526
|
"vue/require-explicit-slots": "error",
|
|
@@ -1573,7 +1592,7 @@ const imports = ({ overrides, packageDir } = {}) => [{
|
|
|
1573
1592
|
const javascript = ({ overrides } = {}) => [
|
|
1574
1593
|
{
|
|
1575
1594
|
name: "meteorlxy/javascript/plugins",
|
|
1576
|
-
plugins: { "eslint-comments": eslintCommentsPlugin }
|
|
1595
|
+
plugins: { "@eslint-community/eslint-comments": eslintCommentsPlugin }
|
|
1577
1596
|
},
|
|
1578
1597
|
{
|
|
1579
1598
|
name: "meteorlxy/javascript/rules",
|
|
@@ -1687,7 +1706,7 @@ const prettier = () => [{
|
|
|
1687
1706
|
/**
|
|
1688
1707
|
* React configuration for eslint.
|
|
1689
1708
|
*/
|
|
1690
|
-
const react = async ({ files = ["**/*.ts", "**/*.tsx"], overrides } = {}) => {
|
|
1709
|
+
const react = async ({ files = ["**/*.ts", "**/*.tsx"], overrides, settings } = {}) => {
|
|
1691
1710
|
const [reactPlugin, reactHooksPlugin, reactRefreshPlugin] = await Promise.all([
|
|
1692
1711
|
interopDefault(import("eslint-plugin-react")),
|
|
1693
1712
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
@@ -1700,7 +1719,14 @@ const react = async ({ files = ["**/*.ts", "**/*.tsx"], overrides } = {}) => {
|
|
|
1700
1719
|
"react-hooks": reactHooksPlugin,
|
|
1701
1720
|
"react-refresh": reactRefreshPlugin
|
|
1702
1721
|
},
|
|
1703
|
-
settings: {
|
|
1722
|
+
settings: {
|
|
1723
|
+
...settings,
|
|
1724
|
+
"react": {
|
|
1725
|
+
version: "detect",
|
|
1726
|
+
...settings?.react
|
|
1727
|
+
},
|
|
1728
|
+
"react-hooks": { ...settings?.["react-hooks"] }
|
|
1729
|
+
}
|
|
1704
1730
|
}, {
|
|
1705
1731
|
name: "meteorlxy/react/rules",
|
|
1706
1732
|
files,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meteorlxy/eslint-config",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0",
|
|
4
4
|
"description": "meteorlxy eslint config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -32,36 +32,36 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@eslint/
|
|
36
|
-
"@eslint/
|
|
37
|
-
"@
|
|
38
|
-
"@typescript-eslint/
|
|
35
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
|
|
36
|
+
"@eslint/core": "^1.2.1",
|
|
37
|
+
"@eslint/markdown": "^8.0.1",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^8.59.2",
|
|
39
|
+
"@typescript-eslint/parser": "^8.59.2",
|
|
39
40
|
"confusing-browser-globals": "^1.0.11",
|
|
40
41
|
"eslint-config-flat-gitignore": "^2.3.0",
|
|
41
42
|
"eslint-config-prettier": "^10.1.8",
|
|
42
43
|
"eslint-merge-processors": "^2.0.0",
|
|
43
|
-
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
44
44
|
"eslint-plugin-import-x": "^4.16.2",
|
|
45
45
|
"eslint-plugin-jsonc": "^3.1.2",
|
|
46
|
-
"globals": "^17.
|
|
46
|
+
"globals": "^17.6.0",
|
|
47
47
|
"jsonc-eslint-parser": "^3.1.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/confusing-browser-globals": "^1.0.3",
|
|
51
|
-
"eslint": "^
|
|
51
|
+
"eslint": "^10.3.0",
|
|
52
52
|
"eslint-plugin-react": "^7.37.5",
|
|
53
|
-
"eslint-plugin-react-hooks": "^7.
|
|
53
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
54
54
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
55
|
-
"eslint-plugin-vue": "^10.
|
|
56
|
-
"tsdown": "^0.
|
|
55
|
+
"eslint-plugin-vue": "^10.9.1",
|
|
56
|
+
"tsdown": "^0.22.0",
|
|
57
57
|
"vue-eslint-parser": "^10.4.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"eslint": "^9.39.4",
|
|
60
|
+
"eslint": "^9.39.4 || ^10.3.0",
|
|
61
61
|
"eslint-plugin-react": "^7.37.5",
|
|
62
|
-
"eslint-plugin-react-hooks": "^7.
|
|
62
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
63
63
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
64
|
-
"eslint-plugin-vue": "^10.
|
|
64
|
+
"eslint-plugin-vue": "^10.9.1",
|
|
65
65
|
"vue-eslint-parser": "^10.4.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|