@component-hook/eslint-plugin 1.4.2 → 1.4.4
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 +116 -110
- package/dist/index.d.cts +48 -4
- package/dist/index.d.mts +48 -4
- package/dist/index.mjs +114 -107
- package/package.json +22 -23
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Object.
|
|
2
|
-
//#region
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -76,8 +76,7 @@ let jsonc_eslint_parser = require("jsonc-eslint-parser");
|
|
|
76
76
|
jsonc_eslint_parser = __toESM(jsonc_eslint_parser);
|
|
77
77
|
let eslint_plugin_yml = require("eslint-plugin-yml");
|
|
78
78
|
eslint_plugin_yml = __toESM(eslint_plugin_yml);
|
|
79
|
-
let
|
|
80
|
-
yaml_eslint_parser = __toESM(yaml_eslint_parser);
|
|
79
|
+
let eslint_config = require("eslint/config");
|
|
81
80
|
|
|
82
81
|
//#region configs/comments.ts
|
|
83
82
|
const commentsConfigs = [{
|
|
@@ -140,7 +139,7 @@ const VUE = "**/*.vue";
|
|
|
140
139
|
const BLOB_JSON = "**/*.json";
|
|
141
140
|
const JSON5 = "**/*.json5";
|
|
142
141
|
const JSONC = "**/*.jsonc";
|
|
143
|
-
const
|
|
142
|
+
const RESTRICTED_SYNTAX = ["ForInStatement", "LabeledStatement"];
|
|
144
143
|
|
|
145
144
|
//#endregion
|
|
146
145
|
//#region configs/import.ts
|
|
@@ -185,33 +184,31 @@ const importConfigs = [{
|
|
|
185
184
|
|
|
186
185
|
//#endregion
|
|
187
186
|
//#region configs/javascript.ts
|
|
188
|
-
const rules$3 = {
|
|
189
|
-
"no-useless-call": "error",
|
|
190
|
-
"no-useless-computed-key": "error",
|
|
191
|
-
"no-useless-constructor": "error",
|
|
192
|
-
"no-useless-rename": "error",
|
|
193
|
-
"no-var": "error",
|
|
194
|
-
"no-console": ["warn", { allow: [
|
|
195
|
-
"warn",
|
|
196
|
-
"error",
|
|
197
|
-
"info",
|
|
198
|
-
"clear"
|
|
199
|
-
] }],
|
|
200
|
-
"no-debugger": "warn",
|
|
201
|
-
"no-eval": "error",
|
|
202
|
-
"no-loop-func": "error",
|
|
203
|
-
"no-dupe-class-members": "error",
|
|
204
|
-
"no-duplicate-imports": "error",
|
|
205
|
-
"object-shorthand": "error",
|
|
206
|
-
"prefer-const": "error",
|
|
207
|
-
"prefer-template": "error",
|
|
208
|
-
eqeqeq: "error"
|
|
209
|
-
};
|
|
210
187
|
const jsConfigs = [{
|
|
211
188
|
name: "component-hook/javascript",
|
|
212
189
|
rules: {
|
|
213
190
|
..._eslint_js.default.configs.recommended.rules,
|
|
214
|
-
|
|
191
|
+
"no-useless-call": "error",
|
|
192
|
+
"no-useless-computed-key": "error",
|
|
193
|
+
"no-useless-constructor": "error",
|
|
194
|
+
"no-useless-rename": "error",
|
|
195
|
+
"no-var": "error",
|
|
196
|
+
"no-console": ["warn", { allow: [
|
|
197
|
+
"warn",
|
|
198
|
+
"error",
|
|
199
|
+
"info",
|
|
200
|
+
"clear"
|
|
201
|
+
] }],
|
|
202
|
+
"no-debugger": "warn",
|
|
203
|
+
"no-eval": "error",
|
|
204
|
+
"no-loop-func": "error",
|
|
205
|
+
"no-dupe-class-members": "error",
|
|
206
|
+
"no-duplicate-imports": "error",
|
|
207
|
+
"object-shorthand": "error",
|
|
208
|
+
"prefer-const": "error",
|
|
209
|
+
"prefer-template": "error",
|
|
210
|
+
eqeqeq: "error",
|
|
211
|
+
"no-restricted-syntax": ["error", ...RESTRICTED_SYNTAX]
|
|
215
212
|
}
|
|
216
213
|
}, {
|
|
217
214
|
name: "component-hook/globals",
|
|
@@ -219,7 +216,8 @@ const jsConfigs = [{
|
|
|
219
216
|
ecmaVersion: "latest",
|
|
220
217
|
globals: {
|
|
221
218
|
...globals.default.node,
|
|
222
|
-
...globals.default.browser
|
|
219
|
+
...globals.default.browser,
|
|
220
|
+
...globals.default.es2026
|
|
223
221
|
}
|
|
224
222
|
}
|
|
225
223
|
}];
|
|
@@ -335,8 +333,8 @@ const jsoncConfigs = [
|
|
|
335
333
|
{
|
|
336
334
|
order: [
|
|
337
335
|
"types",
|
|
338
|
-
"require",
|
|
339
336
|
"import",
|
|
337
|
+
"require",
|
|
340
338
|
"default"
|
|
341
339
|
],
|
|
342
340
|
pathPattern: "^exports.*$"
|
|
@@ -487,7 +485,6 @@ const markdownConfigs = [..._eslint_markdown.default.configs.processor.map((conf
|
|
|
487
485
|
"@typescript-eslint/no-unused-expressions": "off",
|
|
488
486
|
"@typescript-eslint/no-unused-vars": "off",
|
|
489
487
|
"@typescript-eslint/no-use-before-define": "off",
|
|
490
|
-
"import/no-default-export": "off",
|
|
491
488
|
"sonarjs/no-dead-store": "off",
|
|
492
489
|
"sonarjs/unused-import": "off",
|
|
493
490
|
"sonarjs/no-unused-vars": "off",
|
|
@@ -540,13 +537,13 @@ const playwrightConfig = {
|
|
|
540
537
|
|
|
541
538
|
//#endregion
|
|
542
539
|
//#region configs/prettier.ts
|
|
543
|
-
const rules$
|
|
544
|
-
delete rules$
|
|
540
|
+
const rules$1 = { ...eslint_plugin_prettier_recommended.default.rules };
|
|
541
|
+
delete rules$1["vue/html-self-closing"];
|
|
545
542
|
const prettierConfig = {
|
|
546
543
|
name: "component-hook/prettier",
|
|
547
544
|
plugins: { prettier: eslint_plugin_prettier.default },
|
|
548
545
|
rules: {
|
|
549
|
-
...rules$
|
|
546
|
+
...rules$1,
|
|
550
547
|
"prettier/prettier": "warn"
|
|
551
548
|
}
|
|
552
549
|
};
|
|
@@ -596,12 +593,13 @@ const securityConfig = {
|
|
|
596
593
|
//#endregion
|
|
597
594
|
//#region configs/sonarjs.ts
|
|
598
595
|
const plugins$1 = { sonarjs: eslint_plugin_sonarjs.default };
|
|
599
|
-
const
|
|
596
|
+
const recommended = eslint_plugin_sonarjs.default.configs?.recommended;
|
|
597
|
+
const { settings } = recommended;
|
|
600
598
|
const sonarjsConfigs = [{
|
|
601
599
|
name: "component-hook/sonarjs",
|
|
602
600
|
plugins: plugins$1,
|
|
603
601
|
rules: {
|
|
604
|
-
...
|
|
602
|
+
...recommended.rules,
|
|
605
603
|
"sonarjs/no-commented-code": "warn"
|
|
606
604
|
},
|
|
607
605
|
settings
|
|
@@ -648,26 +646,51 @@ const testingLibraryMarkoConfig = {
|
|
|
648
646
|
|
|
649
647
|
//#endregion
|
|
650
648
|
//#region configs/typescript.ts
|
|
651
|
-
const
|
|
652
|
-
"@typescript-eslint/ban-ts-comment": "off",
|
|
653
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
654
|
-
"@typescript-eslint/no-unsafe-function-type": "off",
|
|
655
|
-
"@typescript-eslint/no-shadow": "error",
|
|
656
|
-
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "_" }],
|
|
657
|
-
"@typescript-eslint/no-useless-constructor": "error",
|
|
658
|
-
"@typescript-eslint/prefer-literal-enum-member": ["error", { allowBitwiseExpressions: true }],
|
|
659
|
-
"@typescript-eslint/no-unused-expressions": ["error", {
|
|
660
|
-
allowShortCircuit: true,
|
|
661
|
-
allowTaggedTemplates: true,
|
|
662
|
-
allowTernary: true
|
|
663
|
-
}]
|
|
664
|
-
};
|
|
665
|
-
const typescriptConfigs = typescript_eslint.default.config({
|
|
649
|
+
const typescriptCoreConfig = (0, eslint_config.defineConfig)({
|
|
666
650
|
extends: [...typescript_eslint.default.configs.recommended],
|
|
667
651
|
files: ["**/*.ts", "**/*.tsx"],
|
|
668
652
|
name: "component-hook/typescript",
|
|
669
|
-
rules:
|
|
653
|
+
rules: {
|
|
654
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
655
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
656
|
+
"@typescript-eslint/no-unsafe-function-type": "off",
|
|
657
|
+
"@typescript-eslint/no-shadow": "error",
|
|
658
|
+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "_" }],
|
|
659
|
+
"@typescript-eslint/no-useless-constructor": "error",
|
|
660
|
+
"@typescript-eslint/prefer-literal-enum-member": ["error", { allowBitwiseExpressions: true }],
|
|
661
|
+
"@typescript-eslint/no-unused-expressions": ["error", {
|
|
662
|
+
allowShortCircuit: true,
|
|
663
|
+
allowTaggedTemplates: true,
|
|
664
|
+
allowTernary: true
|
|
665
|
+
}],
|
|
666
|
+
"@typescript-eslint/consistent-type-assertions": ["error", {
|
|
667
|
+
assertionStyle: "as",
|
|
668
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
669
|
+
}],
|
|
670
|
+
"@typescript-eslint/consistent-type-imports": ["error", {
|
|
671
|
+
disallowTypeAnnotations: false,
|
|
672
|
+
fixStyle: "inline-type-imports"
|
|
673
|
+
}],
|
|
674
|
+
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
675
|
+
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
676
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
677
|
+
"no-restricted-syntax": [
|
|
678
|
+
"error",
|
|
679
|
+
"TSEnumDeclaration[const=true]",
|
|
680
|
+
...RESTRICTED_SYNTAX
|
|
681
|
+
]
|
|
682
|
+
}
|
|
670
683
|
});
|
|
684
|
+
const typescriptConfigs = [...typescriptCoreConfig, {
|
|
685
|
+
files: ["**/*.d.ts"],
|
|
686
|
+
name: "component-hook/typescript/dts-rules",
|
|
687
|
+
rules: {
|
|
688
|
+
"eslint-comments/no-unlimited-disable": "off",
|
|
689
|
+
"import/no-duplicates": "off",
|
|
690
|
+
"no-restricted-syntax": "off",
|
|
691
|
+
"unused-imports/no-unused-vars": "off"
|
|
692
|
+
}
|
|
693
|
+
}];
|
|
671
694
|
|
|
672
695
|
//#endregion
|
|
673
696
|
//#region configs/unicorn.ts
|
|
@@ -719,9 +742,9 @@ const unicornConfigs = [
|
|
|
719
742
|
|
|
720
743
|
//#endregion
|
|
721
744
|
//#region configs/vue.ts
|
|
722
|
-
const recommendedRules = eslint_plugin_vue.default.configs["flat/recommended"].map((config) => config.rules).reduce((acc, rules
|
|
745
|
+
const recommendedRules = eslint_plugin_vue.default.configs["flat/recommended"].map((config) => config.rules).reduce((acc, rules) => ({
|
|
723
746
|
...acc,
|
|
724
|
-
...rules
|
|
747
|
+
...rules
|
|
725
748
|
}), {});
|
|
726
749
|
const rules = {
|
|
727
750
|
"vue/block-order": ["error", { order: [
|
|
@@ -765,72 +788,55 @@ const rules = {
|
|
|
765
788
|
"vue/no-setup-props-reactivity-loss": "off",
|
|
766
789
|
"vue/return-in-computed-property": ["error", { treatUndefinedAsUnspecified: false }]
|
|
767
790
|
};
|
|
768
|
-
const
|
|
791
|
+
const eslintVueTypescript = typescriptCoreConfig.filter(({ name }) => name !== "component-hook/typescript > typescript-eslint/base").map((config) => ({
|
|
769
792
|
...config,
|
|
770
|
-
|
|
793
|
+
files: [VUE],
|
|
794
|
+
name: `component-hook/vue/${config.name?.replace("component-hook/", "")}`
|
|
771
795
|
}));
|
|
772
|
-
const
|
|
773
|
-
|
|
796
|
+
const vueConfigs = [...eslintVueTypescript, {
|
|
797
|
+
name: "component-hook/vue",
|
|
774
798
|
files: [VUE],
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
const vueConfigs = [
|
|
779
|
-
...eslintConfigTypescript,
|
|
780
|
-
{
|
|
781
|
-
name: "component-hook/vue/globals",
|
|
782
|
-
files: [VUE],
|
|
783
|
-
languageOptions: { globals: {
|
|
784
|
-
defineProps: "readonly",
|
|
785
|
-
defineEmits: "readonly",
|
|
786
|
-
defineExpose: "readonly",
|
|
787
|
-
defineModel: "readonly",
|
|
788
|
-
withDefaults: "readonly",
|
|
789
|
-
$: "readonly",
|
|
790
|
-
$$: "readonly",
|
|
791
|
-
$computed: "readonly",
|
|
792
|
-
$customRef: "readonly",
|
|
793
|
-
$ref: "readonly",
|
|
794
|
-
$shallowRef: "readonly",
|
|
795
|
-
$toRef: "readonly"
|
|
796
|
-
} }
|
|
799
|
+
plugins: {
|
|
800
|
+
"@typescript-eslint": typescript_eslint.default.plugin,
|
|
801
|
+
vue: eslint_plugin_vue.default
|
|
797
802
|
},
|
|
798
|
-
{
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
languageOptions: {
|
|
806
|
-
parser: vue_eslint_parser.default,
|
|
807
|
-
parserOptions: {
|
|
808
|
-
parser: "@typescript-eslint/parser",
|
|
809
|
-
extraFileExtensions: [".vue"],
|
|
810
|
-
sourceType: "module",
|
|
811
|
-
ecmaFeatures: { jsx: true }
|
|
812
|
-
}
|
|
813
|
-
},
|
|
814
|
-
processor: eslint_plugin_vue.default.processors[".vue"],
|
|
815
|
-
rules: {
|
|
816
|
-
...recommendedRules,
|
|
817
|
-
...rules
|
|
803
|
+
languageOptions: {
|
|
804
|
+
parser: vue_eslint_parser.default,
|
|
805
|
+
parserOptions: {
|
|
806
|
+
parser: typescript_eslint.default.parser,
|
|
807
|
+
extraFileExtensions: [".vue"],
|
|
808
|
+
sourceType: "module",
|
|
809
|
+
ecmaFeatures: { jsx: true }
|
|
818
810
|
}
|
|
811
|
+
},
|
|
812
|
+
processor: eslint_plugin_vue.default.processors[".vue"],
|
|
813
|
+
rules: {
|
|
814
|
+
...recommendedRules,
|
|
815
|
+
"no-useless-assignment": "off",
|
|
816
|
+
...rules
|
|
819
817
|
}
|
|
820
|
-
];
|
|
818
|
+
}];
|
|
821
819
|
|
|
822
820
|
//#endregion
|
|
823
821
|
//#region configs/yaml.ts
|
|
822
|
+
const initialRules = { rules: { "yml/no-empty-mapping-value": "off" } };
|
|
823
|
+
const mergedConfig = Array.from(new Set([
|
|
824
|
+
...eslint_plugin_yml.default.configs.standard,
|
|
825
|
+
...eslint_plugin_yml.default.configs.prettier,
|
|
826
|
+
initialRules
|
|
827
|
+
])).reduce((map, config) => {
|
|
828
|
+
return {
|
|
829
|
+
...map,
|
|
830
|
+
...config,
|
|
831
|
+
rules: {
|
|
832
|
+
...map.rules,
|
|
833
|
+
...config.rules
|
|
834
|
+
}
|
|
835
|
+
};
|
|
836
|
+
}, {});
|
|
824
837
|
const yamlConfigs = [{
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
plugins: { yml: eslint_plugin_yml.default },
|
|
828
|
-
languageOptions: { parser: yaml_eslint_parser.default },
|
|
829
|
-
rules: {
|
|
830
|
-
...eslint_plugin_yml.default.configs.standard.rules,
|
|
831
|
-
...eslint_plugin_yml.default.configs.prettier.rules,
|
|
832
|
-
"yml/no-empty-mapping-value": "off"
|
|
833
|
-
}
|
|
838
|
+
...mergedConfig,
|
|
839
|
+
name: "component-hook/yaml"
|
|
834
840
|
}, {
|
|
835
841
|
name: "component-hook/yaml/pnpm-workspace",
|
|
836
842
|
files: ["**/pnpm-workspace.yaml"],
|
package/dist/index.d.cts
CHANGED
|
@@ -1956,7 +1956,7 @@ interface VueRules {
|
|
|
1956
1956
|
* Disallow default values that will never be used
|
|
1957
1957
|
* @see https://typescript-eslint.io/rules/no-useless-default-assignment
|
|
1958
1958
|
*/
|
|
1959
|
-
'@typescript-eslint/no-useless-default-assignment'?: Linter.RuleEntry<
|
|
1959
|
+
'@typescript-eslint/no-useless-default-assignment'?: Linter.RuleEntry<TypescriptEslintNoUselessDefaultAssignment>;
|
|
1960
1960
|
/**
|
|
1961
1961
|
* Disallow empty exports that don't change anything in a module file
|
|
1962
1962
|
* @see https://typescript-eslint.io/rules/no-useless-empty-export
|
|
@@ -2130,6 +2130,11 @@ interface VueRules {
|
|
|
2130
2130
|
* @see https://typescript-eslint.io/rules/strict-boolean-expressions
|
|
2131
2131
|
*/
|
|
2132
2132
|
'@typescript-eslint/strict-boolean-expressions'?: Linter.RuleEntry<TypescriptEslintStrictBooleanExpressions>;
|
|
2133
|
+
/**
|
|
2134
|
+
* Disallow passing a value-returning function in a position accepting a void function
|
|
2135
|
+
* @see https://typescript-eslint.io/rules/strict-void-return
|
|
2136
|
+
*/
|
|
2137
|
+
'@typescript-eslint/strict-void-return'?: Linter.RuleEntry<TypescriptEslintStrictVoidReturn>;
|
|
2133
2138
|
/**
|
|
2134
2139
|
* Require switch-case statements to be exhaustive
|
|
2135
2140
|
* @see https://typescript-eslint.io/rules/switch-exhaustiveness-check
|
|
@@ -2666,6 +2671,11 @@ interface VueRules {
|
|
|
2666
2671
|
* @see https://eslint.vuejs.org/rules/no-lifecycle-after-await.html
|
|
2667
2672
|
*/
|
|
2668
2673
|
'vue/no-lifecycle-after-await'?: Linter.RuleEntry<[]>;
|
|
2674
|
+
/**
|
|
2675
|
+
* disallow object, array, and function literals in template
|
|
2676
|
+
* @see https://eslint.vuejs.org/rules/no-literals-in-template.html
|
|
2677
|
+
*/
|
|
2678
|
+
'vue/no-literals-in-template'?: Linter.RuleEntry<[]>;
|
|
2669
2679
|
/**
|
|
2670
2680
|
* disallow unnecessary `<template>`
|
|
2671
2681
|
* @see https://eslint.vuejs.org/rules/no-lone-template.html
|
|
@@ -2876,6 +2886,11 @@ interface VueRules {
|
|
|
2876
2886
|
* @see https://eslint.vuejs.org/rules/no-undef-components.html
|
|
2877
2887
|
*/
|
|
2878
2888
|
'vue/no-undef-components'?: Linter.RuleEntry<VueNoUndefComponents>;
|
|
2889
|
+
/**
|
|
2890
|
+
* disallow use of undefined custom directives
|
|
2891
|
+
* @see https://eslint.vuejs.org/rules/no-undef-directives.html
|
|
2892
|
+
*/
|
|
2893
|
+
'vue/no-undef-directives'?: Linter.RuleEntry<VueNoUndefDirectives>;
|
|
2879
2894
|
/**
|
|
2880
2895
|
* disallow undefined properties
|
|
2881
2896
|
* @see https://eslint.vuejs.org/rules/no-undef-properties.html
|
|
@@ -4071,6 +4086,9 @@ type TypescriptEslintNoUnusedVars = [] | [(("all" | "local") | {
|
|
|
4071
4086
|
caughtErrors?: ("all" | "none");
|
|
4072
4087
|
caughtErrorsIgnorePattern?: string;
|
|
4073
4088
|
destructuredArrayIgnorePattern?: string;
|
|
4089
|
+
enableAutofixRemoval?: {
|
|
4090
|
+
imports?: boolean;
|
|
4091
|
+
};
|
|
4074
4092
|
ignoreClassWithStaticInitBlock?: boolean;
|
|
4075
4093
|
ignoreRestSiblings?: boolean;
|
|
4076
4094
|
ignoreUsingDeclarations?: boolean;
|
|
@@ -4087,6 +4105,9 @@ type TypescriptEslintNoUseBeforeDefine = [] | [("nofunc" | {
|
|
|
4087
4105
|
typedefs?: boolean;
|
|
4088
4106
|
variables?: boolean;
|
|
4089
4107
|
})];
|
|
4108
|
+
type TypescriptEslintNoUselessDefaultAssignment = [] | [{
|
|
4109
|
+
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean;
|
|
4110
|
+
}];
|
|
4090
4111
|
type TypescriptEslintNoVarRequires = [] | [{
|
|
4091
4112
|
allow?: string[];
|
|
4092
4113
|
}];
|
|
@@ -4252,6 +4273,9 @@ type TypescriptEslintStrictBooleanExpressions = [] | [{
|
|
|
4252
4273
|
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean;
|
|
4253
4274
|
allowString?: boolean;
|
|
4254
4275
|
}];
|
|
4276
|
+
type TypescriptEslintStrictVoidReturn = [] | [{
|
|
4277
|
+
allowReturnAny?: boolean;
|
|
4278
|
+
}];
|
|
4255
4279
|
type TypescriptEslintSwitchExhaustivenessCheck = [] | [{
|
|
4256
4280
|
allowDefaultCaseForExhaustiveSwitch?: boolean;
|
|
4257
4281
|
considerDefaultExhaustiveForUnions?: boolean;
|
|
@@ -4986,6 +5010,7 @@ type VueNoLoneTemplate = [] | [{
|
|
|
4986
5010
|
}];
|
|
4987
5011
|
type VueNoMultiSpaces = [] | [{
|
|
4988
5012
|
ignoreProperties?: boolean;
|
|
5013
|
+
ignoreEOLComments?: boolean;
|
|
4989
5014
|
}];
|
|
4990
5015
|
type VueNoMultipleTemplateRoot = [] | [{
|
|
4991
5016
|
disallowComments?: boolean;
|
|
@@ -5119,6 +5144,9 @@ type VueNoTemplateTargetBlank = [] | [{
|
|
|
5119
5144
|
type VueNoUndefComponents = [] | [{
|
|
5120
5145
|
ignorePatterns?: unknown[];
|
|
5121
5146
|
}];
|
|
5147
|
+
type VueNoUndefDirectives = [] | [{
|
|
5148
|
+
ignore?: string[];
|
|
5149
|
+
}];
|
|
5122
5150
|
type VueNoUndefProperties = [] | [{
|
|
5123
5151
|
ignores?: string[];
|
|
5124
5152
|
}];
|
|
@@ -5575,7 +5603,7 @@ interface SonarjsRules {
|
|
|
5575
5603
|
*/
|
|
5576
5604
|
'sonarjs/aws-iam-public-access'?: Linter.RuleEntry<[]>;
|
|
5577
5605
|
/**
|
|
5578
|
-
* Using unencrypted
|
|
5606
|
+
* Using unencrypted Opensearch domains is security-sensitive
|
|
5579
5607
|
* @see https://sonarsource.github.io/rspec/#/rspec/S6308/javascript
|
|
5580
5608
|
*/
|
|
5581
5609
|
'sonarjs/aws-opensearchservice-domain'?: Linter.RuleEntry<[]>;
|
|
@@ -5794,6 +5822,11 @@ interface SonarjsRules {
|
|
|
5794
5822
|
* @see https://sonarsource.github.io/rspec/#/rspec/S5869/javascript
|
|
5795
5823
|
*/
|
|
5796
5824
|
'sonarjs/duplicates-in-character-class'?: Linter.RuleEntry<[]>;
|
|
5825
|
+
/**
|
|
5826
|
+
* Templates should not be constructed dynamically
|
|
5827
|
+
* @see https://sonarsource.github.io/rspec/#/rspec/S7790/javascript
|
|
5828
|
+
*/
|
|
5829
|
+
'sonarjs/dynamically-constructed-templates'?: Linter.RuleEntry<[]>;
|
|
5797
5830
|
/**
|
|
5798
5831
|
* "if ... else if" constructs should end with "else" clauses
|
|
5799
5832
|
* @see https://sonarsource.github.io/rspec/#/rspec/S126/javascript
|
|
@@ -5896,6 +5929,11 @@ interface SonarjsRules {
|
|
|
5896
5929
|
* @see https://sonarsource.github.io/rspec/#/rspec/S3531/javascript
|
|
5897
5930
|
*/
|
|
5898
5931
|
'sonarjs/generator-without-yield'?: Linter.RuleEntry<[]>;
|
|
5932
|
+
/**
|
|
5933
|
+
* Credentials should not be hard-coded
|
|
5934
|
+
* @see https://sonarsource.github.io/rspec/#/rspec/S6437/javascript
|
|
5935
|
+
*/
|
|
5936
|
+
'sonarjs/hardcoded-secret-signatures'?: Linter.RuleEntry<[]>;
|
|
5899
5937
|
/**
|
|
5900
5938
|
* Using weak hashing algorithms is security-sensitive
|
|
5901
5939
|
* @see https://sonarsource.github.io/rspec/#/rspec/S4790/javascript
|
|
@@ -6167,12 +6205,12 @@ interface SonarjsRules {
|
|
|
6167
6205
|
*/
|
|
6168
6206
|
'sonarjs/no-hardcoded-ip'?: Linter.RuleEntry<[]>;
|
|
6169
6207
|
/**
|
|
6170
|
-
*
|
|
6208
|
+
* Credentials should not be hard-coded
|
|
6171
6209
|
* @see https://sonarsource.github.io/rspec/#/rspec/S2068/javascript
|
|
6172
6210
|
*/
|
|
6173
6211
|
'sonarjs/no-hardcoded-passwords'?: Linter.RuleEntry<SonarjsNoHardcodedPasswords>;
|
|
6174
6212
|
/**
|
|
6175
|
-
*
|
|
6213
|
+
* Secrets should not be hard-coded
|
|
6176
6214
|
* @see https://sonarsource.github.io/rspec/#/rspec/S6418/javascript
|
|
6177
6215
|
*/
|
|
6178
6216
|
'sonarjs/no-hardcoded-secrets'?: Linter.RuleEntry<SonarjsNoHardcodedSecrets>;
|
|
@@ -6661,6 +6699,11 @@ interface SonarjsRules {
|
|
|
6661
6699
|
* @deprecated
|
|
6662
6700
|
*/
|
|
6663
6701
|
'sonarjs/regular-expr'?: Linter.RuleEntry<[]>;
|
|
6702
|
+
/**
|
|
6703
|
+
* Wallet phrases should not be hard-coded
|
|
6704
|
+
* @see https://sonarsource.github.io/rspec/#/rspec/S7639/javascript
|
|
6705
|
+
*/
|
|
6706
|
+
'sonarjs/review-blockchain-mnemonic'?: Linter.RuleEntry<[]>;
|
|
6664
6707
|
/**
|
|
6665
6708
|
* A new session should be created during user authentication
|
|
6666
6709
|
* @see https://sonarsource.github.io/rspec/#/rspec/S5876/javascript
|
|
@@ -7263,6 +7306,7 @@ interface PlaywrightRules {
|
|
|
7263
7306
|
'playwright/valid-expect-in-promise'?: Linter.RuleEntry<[]>;
|
|
7264
7307
|
/**
|
|
7265
7308
|
* Enforce valid tag format in Playwright test blocks and titles
|
|
7309
|
+
* @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/valid-test-tags.md
|
|
7266
7310
|
*/
|
|
7267
7311
|
'playwright/valid-test-tags'?: Linter.RuleEntry<PlaywrightValidTestTags>;
|
|
7268
7312
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1956,7 +1956,7 @@ interface VueRules {
|
|
|
1956
1956
|
* Disallow default values that will never be used
|
|
1957
1957
|
* @see https://typescript-eslint.io/rules/no-useless-default-assignment
|
|
1958
1958
|
*/
|
|
1959
|
-
'@typescript-eslint/no-useless-default-assignment'?: Linter.RuleEntry<
|
|
1959
|
+
'@typescript-eslint/no-useless-default-assignment'?: Linter.RuleEntry<TypescriptEslintNoUselessDefaultAssignment>;
|
|
1960
1960
|
/**
|
|
1961
1961
|
* Disallow empty exports that don't change anything in a module file
|
|
1962
1962
|
* @see https://typescript-eslint.io/rules/no-useless-empty-export
|
|
@@ -2130,6 +2130,11 @@ interface VueRules {
|
|
|
2130
2130
|
* @see https://typescript-eslint.io/rules/strict-boolean-expressions
|
|
2131
2131
|
*/
|
|
2132
2132
|
'@typescript-eslint/strict-boolean-expressions'?: Linter.RuleEntry<TypescriptEslintStrictBooleanExpressions>;
|
|
2133
|
+
/**
|
|
2134
|
+
* Disallow passing a value-returning function in a position accepting a void function
|
|
2135
|
+
* @see https://typescript-eslint.io/rules/strict-void-return
|
|
2136
|
+
*/
|
|
2137
|
+
'@typescript-eslint/strict-void-return'?: Linter.RuleEntry<TypescriptEslintStrictVoidReturn>;
|
|
2133
2138
|
/**
|
|
2134
2139
|
* Require switch-case statements to be exhaustive
|
|
2135
2140
|
* @see https://typescript-eslint.io/rules/switch-exhaustiveness-check
|
|
@@ -2666,6 +2671,11 @@ interface VueRules {
|
|
|
2666
2671
|
* @see https://eslint.vuejs.org/rules/no-lifecycle-after-await.html
|
|
2667
2672
|
*/
|
|
2668
2673
|
'vue/no-lifecycle-after-await'?: Linter.RuleEntry<[]>;
|
|
2674
|
+
/**
|
|
2675
|
+
* disallow object, array, and function literals in template
|
|
2676
|
+
* @see https://eslint.vuejs.org/rules/no-literals-in-template.html
|
|
2677
|
+
*/
|
|
2678
|
+
'vue/no-literals-in-template'?: Linter.RuleEntry<[]>;
|
|
2669
2679
|
/**
|
|
2670
2680
|
* disallow unnecessary `<template>`
|
|
2671
2681
|
* @see https://eslint.vuejs.org/rules/no-lone-template.html
|
|
@@ -2876,6 +2886,11 @@ interface VueRules {
|
|
|
2876
2886
|
* @see https://eslint.vuejs.org/rules/no-undef-components.html
|
|
2877
2887
|
*/
|
|
2878
2888
|
'vue/no-undef-components'?: Linter.RuleEntry<VueNoUndefComponents>;
|
|
2889
|
+
/**
|
|
2890
|
+
* disallow use of undefined custom directives
|
|
2891
|
+
* @see https://eslint.vuejs.org/rules/no-undef-directives.html
|
|
2892
|
+
*/
|
|
2893
|
+
'vue/no-undef-directives'?: Linter.RuleEntry<VueNoUndefDirectives>;
|
|
2879
2894
|
/**
|
|
2880
2895
|
* disallow undefined properties
|
|
2881
2896
|
* @see https://eslint.vuejs.org/rules/no-undef-properties.html
|
|
@@ -4071,6 +4086,9 @@ type TypescriptEslintNoUnusedVars = [] | [(("all" | "local") | {
|
|
|
4071
4086
|
caughtErrors?: ("all" | "none");
|
|
4072
4087
|
caughtErrorsIgnorePattern?: string;
|
|
4073
4088
|
destructuredArrayIgnorePattern?: string;
|
|
4089
|
+
enableAutofixRemoval?: {
|
|
4090
|
+
imports?: boolean;
|
|
4091
|
+
};
|
|
4074
4092
|
ignoreClassWithStaticInitBlock?: boolean;
|
|
4075
4093
|
ignoreRestSiblings?: boolean;
|
|
4076
4094
|
ignoreUsingDeclarations?: boolean;
|
|
@@ -4087,6 +4105,9 @@ type TypescriptEslintNoUseBeforeDefine = [] | [("nofunc" | {
|
|
|
4087
4105
|
typedefs?: boolean;
|
|
4088
4106
|
variables?: boolean;
|
|
4089
4107
|
})];
|
|
4108
|
+
type TypescriptEslintNoUselessDefaultAssignment = [] | [{
|
|
4109
|
+
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean;
|
|
4110
|
+
}];
|
|
4090
4111
|
type TypescriptEslintNoVarRequires = [] | [{
|
|
4091
4112
|
allow?: string[];
|
|
4092
4113
|
}];
|
|
@@ -4252,6 +4273,9 @@ type TypescriptEslintStrictBooleanExpressions = [] | [{
|
|
|
4252
4273
|
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean;
|
|
4253
4274
|
allowString?: boolean;
|
|
4254
4275
|
}];
|
|
4276
|
+
type TypescriptEslintStrictVoidReturn = [] | [{
|
|
4277
|
+
allowReturnAny?: boolean;
|
|
4278
|
+
}];
|
|
4255
4279
|
type TypescriptEslintSwitchExhaustivenessCheck = [] | [{
|
|
4256
4280
|
allowDefaultCaseForExhaustiveSwitch?: boolean;
|
|
4257
4281
|
considerDefaultExhaustiveForUnions?: boolean;
|
|
@@ -4986,6 +5010,7 @@ type VueNoLoneTemplate = [] | [{
|
|
|
4986
5010
|
}];
|
|
4987
5011
|
type VueNoMultiSpaces = [] | [{
|
|
4988
5012
|
ignoreProperties?: boolean;
|
|
5013
|
+
ignoreEOLComments?: boolean;
|
|
4989
5014
|
}];
|
|
4990
5015
|
type VueNoMultipleTemplateRoot = [] | [{
|
|
4991
5016
|
disallowComments?: boolean;
|
|
@@ -5119,6 +5144,9 @@ type VueNoTemplateTargetBlank = [] | [{
|
|
|
5119
5144
|
type VueNoUndefComponents = [] | [{
|
|
5120
5145
|
ignorePatterns?: unknown[];
|
|
5121
5146
|
}];
|
|
5147
|
+
type VueNoUndefDirectives = [] | [{
|
|
5148
|
+
ignore?: string[];
|
|
5149
|
+
}];
|
|
5122
5150
|
type VueNoUndefProperties = [] | [{
|
|
5123
5151
|
ignores?: string[];
|
|
5124
5152
|
}];
|
|
@@ -5575,7 +5603,7 @@ interface SonarjsRules {
|
|
|
5575
5603
|
*/
|
|
5576
5604
|
'sonarjs/aws-iam-public-access'?: Linter.RuleEntry<[]>;
|
|
5577
5605
|
/**
|
|
5578
|
-
* Using unencrypted
|
|
5606
|
+
* Using unencrypted Opensearch domains is security-sensitive
|
|
5579
5607
|
* @see https://sonarsource.github.io/rspec/#/rspec/S6308/javascript
|
|
5580
5608
|
*/
|
|
5581
5609
|
'sonarjs/aws-opensearchservice-domain'?: Linter.RuleEntry<[]>;
|
|
@@ -5794,6 +5822,11 @@ interface SonarjsRules {
|
|
|
5794
5822
|
* @see https://sonarsource.github.io/rspec/#/rspec/S5869/javascript
|
|
5795
5823
|
*/
|
|
5796
5824
|
'sonarjs/duplicates-in-character-class'?: Linter.RuleEntry<[]>;
|
|
5825
|
+
/**
|
|
5826
|
+
* Templates should not be constructed dynamically
|
|
5827
|
+
* @see https://sonarsource.github.io/rspec/#/rspec/S7790/javascript
|
|
5828
|
+
*/
|
|
5829
|
+
'sonarjs/dynamically-constructed-templates'?: Linter.RuleEntry<[]>;
|
|
5797
5830
|
/**
|
|
5798
5831
|
* "if ... else if" constructs should end with "else" clauses
|
|
5799
5832
|
* @see https://sonarsource.github.io/rspec/#/rspec/S126/javascript
|
|
@@ -5896,6 +5929,11 @@ interface SonarjsRules {
|
|
|
5896
5929
|
* @see https://sonarsource.github.io/rspec/#/rspec/S3531/javascript
|
|
5897
5930
|
*/
|
|
5898
5931
|
'sonarjs/generator-without-yield'?: Linter.RuleEntry<[]>;
|
|
5932
|
+
/**
|
|
5933
|
+
* Credentials should not be hard-coded
|
|
5934
|
+
* @see https://sonarsource.github.io/rspec/#/rspec/S6437/javascript
|
|
5935
|
+
*/
|
|
5936
|
+
'sonarjs/hardcoded-secret-signatures'?: Linter.RuleEntry<[]>;
|
|
5899
5937
|
/**
|
|
5900
5938
|
* Using weak hashing algorithms is security-sensitive
|
|
5901
5939
|
* @see https://sonarsource.github.io/rspec/#/rspec/S4790/javascript
|
|
@@ -6167,12 +6205,12 @@ interface SonarjsRules {
|
|
|
6167
6205
|
*/
|
|
6168
6206
|
'sonarjs/no-hardcoded-ip'?: Linter.RuleEntry<[]>;
|
|
6169
6207
|
/**
|
|
6170
|
-
*
|
|
6208
|
+
* Credentials should not be hard-coded
|
|
6171
6209
|
* @see https://sonarsource.github.io/rspec/#/rspec/S2068/javascript
|
|
6172
6210
|
*/
|
|
6173
6211
|
'sonarjs/no-hardcoded-passwords'?: Linter.RuleEntry<SonarjsNoHardcodedPasswords>;
|
|
6174
6212
|
/**
|
|
6175
|
-
*
|
|
6213
|
+
* Secrets should not be hard-coded
|
|
6176
6214
|
* @see https://sonarsource.github.io/rspec/#/rspec/S6418/javascript
|
|
6177
6215
|
*/
|
|
6178
6216
|
'sonarjs/no-hardcoded-secrets'?: Linter.RuleEntry<SonarjsNoHardcodedSecrets>;
|
|
@@ -6661,6 +6699,11 @@ interface SonarjsRules {
|
|
|
6661
6699
|
* @deprecated
|
|
6662
6700
|
*/
|
|
6663
6701
|
'sonarjs/regular-expr'?: Linter.RuleEntry<[]>;
|
|
6702
|
+
/**
|
|
6703
|
+
* Wallet phrases should not be hard-coded
|
|
6704
|
+
* @see https://sonarsource.github.io/rspec/#/rspec/S7639/javascript
|
|
6705
|
+
*/
|
|
6706
|
+
'sonarjs/review-blockchain-mnemonic'?: Linter.RuleEntry<[]>;
|
|
6664
6707
|
/**
|
|
6665
6708
|
* A new session should be created during user authentication
|
|
6666
6709
|
* @see https://sonarsource.github.io/rspec/#/rspec/S5876/javascript
|
|
@@ -7263,6 +7306,7 @@ interface PlaywrightRules {
|
|
|
7263
7306
|
'playwright/valid-expect-in-promise'?: Linter.RuleEntry<[]>;
|
|
7264
7307
|
/**
|
|
7265
7308
|
* Enforce valid tag format in Playwright test blocks and titles
|
|
7309
|
+
* @see https://github.com/mskelton/eslint-plugin-playwright/tree/main/docs/rules/valid-test-tags.md
|
|
7266
7310
|
*/
|
|
7267
7311
|
'playwright/valid-test-tags'?: Linter.RuleEntry<PlaywrightValidTestTags>;
|
|
7268
7312
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -23,7 +23,7 @@ import pluginJsdoc from "eslint-plugin-jsdoc";
|
|
|
23
23
|
import pluginJsonc from "eslint-plugin-jsonc";
|
|
24
24
|
import parserJsonc from "jsonc-eslint-parser";
|
|
25
25
|
import pluginYaml from "eslint-plugin-yml";
|
|
26
|
-
import
|
|
26
|
+
import { defineConfig } from "eslint/config";
|
|
27
27
|
|
|
28
28
|
//#region configs/comments.ts
|
|
29
29
|
const commentsConfigs = [{
|
|
@@ -86,7 +86,7 @@ const VUE = "**/*.vue";
|
|
|
86
86
|
const BLOB_JSON = "**/*.json";
|
|
87
87
|
const JSON5 = "**/*.json5";
|
|
88
88
|
const JSONC = "**/*.jsonc";
|
|
89
|
-
const
|
|
89
|
+
const RESTRICTED_SYNTAX = ["ForInStatement", "LabeledStatement"];
|
|
90
90
|
|
|
91
91
|
//#endregion
|
|
92
92
|
//#region configs/import.ts
|
|
@@ -131,33 +131,31 @@ const importConfigs = [{
|
|
|
131
131
|
|
|
132
132
|
//#endregion
|
|
133
133
|
//#region configs/javascript.ts
|
|
134
|
-
const rules$3 = {
|
|
135
|
-
"no-useless-call": "error",
|
|
136
|
-
"no-useless-computed-key": "error",
|
|
137
|
-
"no-useless-constructor": "error",
|
|
138
|
-
"no-useless-rename": "error",
|
|
139
|
-
"no-var": "error",
|
|
140
|
-
"no-console": ["warn", { allow: [
|
|
141
|
-
"warn",
|
|
142
|
-
"error",
|
|
143
|
-
"info",
|
|
144
|
-
"clear"
|
|
145
|
-
] }],
|
|
146
|
-
"no-debugger": "warn",
|
|
147
|
-
"no-eval": "error",
|
|
148
|
-
"no-loop-func": "error",
|
|
149
|
-
"no-dupe-class-members": "error",
|
|
150
|
-
"no-duplicate-imports": "error",
|
|
151
|
-
"object-shorthand": "error",
|
|
152
|
-
"prefer-const": "error",
|
|
153
|
-
"prefer-template": "error",
|
|
154
|
-
eqeqeq: "error"
|
|
155
|
-
};
|
|
156
134
|
const jsConfigs = [{
|
|
157
135
|
name: "component-hook/javascript",
|
|
158
136
|
rules: {
|
|
159
137
|
...pluginJs.configs.recommended.rules,
|
|
160
|
-
|
|
138
|
+
"no-useless-call": "error",
|
|
139
|
+
"no-useless-computed-key": "error",
|
|
140
|
+
"no-useless-constructor": "error",
|
|
141
|
+
"no-useless-rename": "error",
|
|
142
|
+
"no-var": "error",
|
|
143
|
+
"no-console": ["warn", { allow: [
|
|
144
|
+
"warn",
|
|
145
|
+
"error",
|
|
146
|
+
"info",
|
|
147
|
+
"clear"
|
|
148
|
+
] }],
|
|
149
|
+
"no-debugger": "warn",
|
|
150
|
+
"no-eval": "error",
|
|
151
|
+
"no-loop-func": "error",
|
|
152
|
+
"no-dupe-class-members": "error",
|
|
153
|
+
"no-duplicate-imports": "error",
|
|
154
|
+
"object-shorthand": "error",
|
|
155
|
+
"prefer-const": "error",
|
|
156
|
+
"prefer-template": "error",
|
|
157
|
+
eqeqeq: "error",
|
|
158
|
+
"no-restricted-syntax": ["error", ...RESTRICTED_SYNTAX]
|
|
161
159
|
}
|
|
162
160
|
}, {
|
|
163
161
|
name: "component-hook/globals",
|
|
@@ -165,7 +163,8 @@ const jsConfigs = [{
|
|
|
165
163
|
ecmaVersion: "latest",
|
|
166
164
|
globals: {
|
|
167
165
|
...globals.node,
|
|
168
|
-
...globals.browser
|
|
166
|
+
...globals.browser,
|
|
167
|
+
...globals.es2026
|
|
169
168
|
}
|
|
170
169
|
}
|
|
171
170
|
}];
|
|
@@ -281,8 +280,8 @@ const jsoncConfigs = [
|
|
|
281
280
|
{
|
|
282
281
|
order: [
|
|
283
282
|
"types",
|
|
284
|
-
"require",
|
|
285
283
|
"import",
|
|
284
|
+
"require",
|
|
286
285
|
"default"
|
|
287
286
|
],
|
|
288
287
|
pathPattern: "^exports.*$"
|
|
@@ -433,7 +432,6 @@ const markdownConfigs = [...pluginMarkdown.configs.processor.map((config) => ({
|
|
|
433
432
|
"@typescript-eslint/no-unused-expressions": "off",
|
|
434
433
|
"@typescript-eslint/no-unused-vars": "off",
|
|
435
434
|
"@typescript-eslint/no-use-before-define": "off",
|
|
436
|
-
"import/no-default-export": "off",
|
|
437
435
|
"sonarjs/no-dead-store": "off",
|
|
438
436
|
"sonarjs/unused-import": "off",
|
|
439
437
|
"sonarjs/no-unused-vars": "off",
|
|
@@ -486,13 +484,13 @@ const playwrightConfig = {
|
|
|
486
484
|
|
|
487
485
|
//#endregion
|
|
488
486
|
//#region configs/prettier.ts
|
|
489
|
-
const rules$
|
|
490
|
-
delete rules$
|
|
487
|
+
const rules$1 = { ...pluginPrettierRecommended.rules };
|
|
488
|
+
delete rules$1["vue/html-self-closing"];
|
|
491
489
|
const prettierConfig = {
|
|
492
490
|
name: "component-hook/prettier",
|
|
493
491
|
plugins: { prettier: pluginPrettier },
|
|
494
492
|
rules: {
|
|
495
|
-
...rules$
|
|
493
|
+
...rules$1,
|
|
496
494
|
"prettier/prettier": "warn"
|
|
497
495
|
}
|
|
498
496
|
};
|
|
@@ -542,12 +540,13 @@ const securityConfig = {
|
|
|
542
540
|
//#endregion
|
|
543
541
|
//#region configs/sonarjs.ts
|
|
544
542
|
const plugins$1 = { sonarjs: pluginSonarjs };
|
|
545
|
-
const
|
|
543
|
+
const recommended = pluginSonarjs.configs?.recommended;
|
|
544
|
+
const { settings } = recommended;
|
|
546
545
|
const sonarjsConfigs = [{
|
|
547
546
|
name: "component-hook/sonarjs",
|
|
548
547
|
plugins: plugins$1,
|
|
549
548
|
rules: {
|
|
550
|
-
...
|
|
549
|
+
...recommended.rules,
|
|
551
550
|
"sonarjs/no-commented-code": "warn"
|
|
552
551
|
},
|
|
553
552
|
settings
|
|
@@ -594,26 +593,51 @@ const testingLibraryMarkoConfig = {
|
|
|
594
593
|
|
|
595
594
|
//#endregion
|
|
596
595
|
//#region configs/typescript.ts
|
|
597
|
-
const
|
|
598
|
-
"@typescript-eslint/ban-ts-comment": "off",
|
|
599
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
600
|
-
"@typescript-eslint/no-unsafe-function-type": "off",
|
|
601
|
-
"@typescript-eslint/no-shadow": "error",
|
|
602
|
-
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "_" }],
|
|
603
|
-
"@typescript-eslint/no-useless-constructor": "error",
|
|
604
|
-
"@typescript-eslint/prefer-literal-enum-member": ["error", { allowBitwiseExpressions: true }],
|
|
605
|
-
"@typescript-eslint/no-unused-expressions": ["error", {
|
|
606
|
-
allowShortCircuit: true,
|
|
607
|
-
allowTaggedTemplates: true,
|
|
608
|
-
allowTernary: true
|
|
609
|
-
}]
|
|
610
|
-
};
|
|
611
|
-
const typescriptConfigs = typescriptEslint.config({
|
|
596
|
+
const typescriptCoreConfig = defineConfig({
|
|
612
597
|
extends: [...typescriptEslint.configs.recommended],
|
|
613
598
|
files: ["**/*.ts", "**/*.tsx"],
|
|
614
599
|
name: "component-hook/typescript",
|
|
615
|
-
rules:
|
|
600
|
+
rules: {
|
|
601
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
602
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
603
|
+
"@typescript-eslint/no-unsafe-function-type": "off",
|
|
604
|
+
"@typescript-eslint/no-shadow": "error",
|
|
605
|
+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "_" }],
|
|
606
|
+
"@typescript-eslint/no-useless-constructor": "error",
|
|
607
|
+
"@typescript-eslint/prefer-literal-enum-member": ["error", { allowBitwiseExpressions: true }],
|
|
608
|
+
"@typescript-eslint/no-unused-expressions": ["error", {
|
|
609
|
+
allowShortCircuit: true,
|
|
610
|
+
allowTaggedTemplates: true,
|
|
611
|
+
allowTernary: true
|
|
612
|
+
}],
|
|
613
|
+
"@typescript-eslint/consistent-type-assertions": ["error", {
|
|
614
|
+
assertionStyle: "as",
|
|
615
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
616
|
+
}],
|
|
617
|
+
"@typescript-eslint/consistent-type-imports": ["error", {
|
|
618
|
+
disallowTypeAnnotations: false,
|
|
619
|
+
fixStyle: "inline-type-imports"
|
|
620
|
+
}],
|
|
621
|
+
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
622
|
+
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
623
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
624
|
+
"no-restricted-syntax": [
|
|
625
|
+
"error",
|
|
626
|
+
"TSEnumDeclaration[const=true]",
|
|
627
|
+
...RESTRICTED_SYNTAX
|
|
628
|
+
]
|
|
629
|
+
}
|
|
616
630
|
});
|
|
631
|
+
const typescriptConfigs = [...typescriptCoreConfig, {
|
|
632
|
+
files: ["**/*.d.ts"],
|
|
633
|
+
name: "component-hook/typescript/dts-rules",
|
|
634
|
+
rules: {
|
|
635
|
+
"eslint-comments/no-unlimited-disable": "off",
|
|
636
|
+
"import/no-duplicates": "off",
|
|
637
|
+
"no-restricted-syntax": "off",
|
|
638
|
+
"unused-imports/no-unused-vars": "off"
|
|
639
|
+
}
|
|
640
|
+
}];
|
|
617
641
|
|
|
618
642
|
//#endregion
|
|
619
643
|
//#region configs/unicorn.ts
|
|
@@ -665,9 +689,9 @@ const unicornConfigs = [
|
|
|
665
689
|
|
|
666
690
|
//#endregion
|
|
667
691
|
//#region configs/vue.ts
|
|
668
|
-
const recommendedRules = pluginVue.configs["flat/recommended"].map((config) => config.rules).reduce((acc, rules
|
|
692
|
+
const recommendedRules = pluginVue.configs["flat/recommended"].map((config) => config.rules).reduce((acc, rules) => ({
|
|
669
693
|
...acc,
|
|
670
|
-
...rules
|
|
694
|
+
...rules
|
|
671
695
|
}), {});
|
|
672
696
|
const rules = {
|
|
673
697
|
"vue/block-order": ["error", { order: [
|
|
@@ -711,72 +735,55 @@ const rules = {
|
|
|
711
735
|
"vue/no-setup-props-reactivity-loss": "off",
|
|
712
736
|
"vue/return-in-computed-property": ["error", { treatUndefinedAsUnspecified: false }]
|
|
713
737
|
};
|
|
714
|
-
const
|
|
738
|
+
const eslintVueTypescript = typescriptCoreConfig.filter(({ name }) => name !== "component-hook/typescript > typescript-eslint/base").map((config) => ({
|
|
715
739
|
...config,
|
|
716
|
-
|
|
740
|
+
files: [VUE],
|
|
741
|
+
name: `component-hook/vue/${config.name?.replace("component-hook/", "")}`
|
|
717
742
|
}));
|
|
718
|
-
const
|
|
719
|
-
|
|
743
|
+
const vueConfigs = [...eslintVueTypescript, {
|
|
744
|
+
name: "component-hook/vue",
|
|
720
745
|
files: [VUE],
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
const vueConfigs = [
|
|
725
|
-
...eslintConfigTypescript,
|
|
726
|
-
{
|
|
727
|
-
name: "component-hook/vue/globals",
|
|
728
|
-
files: [VUE],
|
|
729
|
-
languageOptions: { globals: {
|
|
730
|
-
defineProps: "readonly",
|
|
731
|
-
defineEmits: "readonly",
|
|
732
|
-
defineExpose: "readonly",
|
|
733
|
-
defineModel: "readonly",
|
|
734
|
-
withDefaults: "readonly",
|
|
735
|
-
$: "readonly",
|
|
736
|
-
$$: "readonly",
|
|
737
|
-
$computed: "readonly",
|
|
738
|
-
$customRef: "readonly",
|
|
739
|
-
$ref: "readonly",
|
|
740
|
-
$shallowRef: "readonly",
|
|
741
|
-
$toRef: "readonly"
|
|
742
|
-
} }
|
|
746
|
+
plugins: {
|
|
747
|
+
"@typescript-eslint": typescriptEslint.plugin,
|
|
748
|
+
vue: pluginVue
|
|
743
749
|
},
|
|
744
|
-
{
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
languageOptions: {
|
|
752
|
-
parser: vueParser,
|
|
753
|
-
parserOptions: {
|
|
754
|
-
parser: "@typescript-eslint/parser",
|
|
755
|
-
extraFileExtensions: [".vue"],
|
|
756
|
-
sourceType: "module",
|
|
757
|
-
ecmaFeatures: { jsx: true }
|
|
758
|
-
}
|
|
759
|
-
},
|
|
760
|
-
processor: pluginVue.processors[".vue"],
|
|
761
|
-
rules: {
|
|
762
|
-
...recommendedRules,
|
|
763
|
-
...rules
|
|
750
|
+
languageOptions: {
|
|
751
|
+
parser: vueParser,
|
|
752
|
+
parserOptions: {
|
|
753
|
+
parser: typescriptEslint.parser,
|
|
754
|
+
extraFileExtensions: [".vue"],
|
|
755
|
+
sourceType: "module",
|
|
756
|
+
ecmaFeatures: { jsx: true }
|
|
764
757
|
}
|
|
758
|
+
},
|
|
759
|
+
processor: pluginVue.processors[".vue"],
|
|
760
|
+
rules: {
|
|
761
|
+
...recommendedRules,
|
|
762
|
+
"no-useless-assignment": "off",
|
|
763
|
+
...rules
|
|
765
764
|
}
|
|
766
|
-
];
|
|
765
|
+
}];
|
|
767
766
|
|
|
768
767
|
//#endregion
|
|
769
768
|
//#region configs/yaml.ts
|
|
769
|
+
const initialRules = { rules: { "yml/no-empty-mapping-value": "off" } };
|
|
770
|
+
const mergedConfig = Array.from(new Set([
|
|
771
|
+
...pluginYaml.configs.standard,
|
|
772
|
+
...pluginYaml.configs.prettier,
|
|
773
|
+
initialRules
|
|
774
|
+
])).reduce((map, config) => {
|
|
775
|
+
return {
|
|
776
|
+
...map,
|
|
777
|
+
...config,
|
|
778
|
+
rules: {
|
|
779
|
+
...map.rules,
|
|
780
|
+
...config.rules
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
}, {});
|
|
770
784
|
const yamlConfigs = [{
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
plugins: { yml: pluginYaml },
|
|
774
|
-
languageOptions: { parser: parserYaml },
|
|
775
|
-
rules: {
|
|
776
|
-
...pluginYaml.configs.standard.rules,
|
|
777
|
-
...pluginYaml.configs.prettier.rules,
|
|
778
|
-
"yml/no-empty-mapping-value": "off"
|
|
779
|
-
}
|
|
785
|
+
...mergedConfig,
|
|
786
|
+
name: "component-hook/yaml"
|
|
780
787
|
}, {
|
|
781
788
|
name: "component-hook/yaml/pnpm-workspace",
|
|
782
789
|
files: ["**/pnpm-workspace.yaml"],
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@component-hook/eslint-plugin",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.4",
|
|
5
5
|
"description": "ESLint config for component hook",
|
|
6
6
|
"author": "Tzuyi",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/tzuyi0817/component-hook/tree/master/packages/eslint-plugin#readme",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/tzuyi0817/component-hook.git",
|
|
11
|
+
"url": "git+https://github.com/tzuyi0817/component-hook.git",
|
|
12
12
|
"directory": "packages/eslint-plugin"
|
|
13
13
|
},
|
|
14
14
|
"bugs": {
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
],
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
-
"require": {
|
|
25
|
-
"types": "./dist/index.d.cts",
|
|
26
|
-
"default": "./dist/index.cjs"
|
|
27
|
-
},
|
|
28
24
|
"import": {
|
|
29
25
|
"types": "./dist/index.d.mts",
|
|
30
26
|
"default": "./dist/index.mjs"
|
|
27
|
+
},
|
|
28
|
+
"require": {
|
|
29
|
+
"types": "./dist/index.d.cts",
|
|
30
|
+
"default": "./dist/index.cjs"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
},
|
|
@@ -41,38 +41,37 @@
|
|
|
41
41
|
"eslint": "^9.39.2"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
44
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.6.0",
|
|
45
45
|
"@eslint/js": "^9.39.2",
|
|
46
46
|
"@eslint/markdown": "^7.5.1",
|
|
47
47
|
"eslint-config-prettier": "^10.1.8",
|
|
48
48
|
"eslint-plugin-de-morgan": "^2.0.0",
|
|
49
49
|
"eslint-plugin-import": "^2.32.0",
|
|
50
|
-
"eslint-plugin-jsdoc": "^62.
|
|
51
|
-
"eslint-plugin-jsonc": "^2.21.
|
|
50
|
+
"eslint-plugin-jsdoc": "^62.5.4",
|
|
51
|
+
"eslint-plugin-jsonc": "^2.21.1",
|
|
52
52
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
53
|
-
"eslint-plugin-perfectionist": "^5.
|
|
54
|
-
"eslint-plugin-playwright": "^2.
|
|
55
|
-
"eslint-plugin-prettier": "^5.5.
|
|
53
|
+
"eslint-plugin-perfectionist": "^5.5.0",
|
|
54
|
+
"eslint-plugin-playwright": "^2.5.1",
|
|
55
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
56
56
|
"eslint-plugin-react": "^7.37.5",
|
|
57
57
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
58
|
-
"eslint-plugin-regexp": "^
|
|
58
|
+
"eslint-plugin-regexp": "^3.0.0",
|
|
59
59
|
"eslint-plugin-security": "^3.0.1",
|
|
60
|
-
"eslint-plugin-sonarjs": "^3.0.
|
|
60
|
+
"eslint-plugin-sonarjs": "^3.0.7",
|
|
61
61
|
"eslint-plugin-testing-library": "^7.15.4",
|
|
62
|
-
"eslint-plugin-unicorn": "^
|
|
63
|
-
"eslint-plugin-vue": "^10.
|
|
64
|
-
"eslint-plugin-yml": "^1.
|
|
65
|
-
"globals": "^17.
|
|
62
|
+
"eslint-plugin-unicorn": "^63.0.0",
|
|
63
|
+
"eslint-plugin-vue": "^10.7.0",
|
|
64
|
+
"eslint-plugin-yml": "^3.1.2",
|
|
65
|
+
"globals": "^17.3.0",
|
|
66
66
|
"jsonc-eslint-parser": "^2.4.2",
|
|
67
|
-
"typescript-eslint": "^8.
|
|
68
|
-
"vue-eslint-parser": "^10.2.0"
|
|
69
|
-
"yaml-eslint-parser": "^1.3.2"
|
|
67
|
+
"typescript-eslint": "^8.55.0",
|
|
68
|
+
"vue-eslint-parser": "^10.2.0"
|
|
70
69
|
},
|
|
71
70
|
"devDependencies": {
|
|
72
71
|
"@eslint/config-inspector": "^1.4.2",
|
|
73
|
-
"@types/eslint-plugin-security": "^3.0.
|
|
72
|
+
"@types/eslint-plugin-security": "^3.0.1",
|
|
74
73
|
"eslint-typegen": "^2.3.0",
|
|
75
|
-
"unrun": "^0.2.
|
|
74
|
+
"unrun": "^0.2.27"
|
|
76
75
|
},
|
|
77
76
|
"scripts": {
|
|
78
77
|
"dev": "eslint-config-inspector --config ../../eslint.config.js",
|