@sxzz/eslint-config 3.8.0 → 3.8.1
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 +49 -46
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +48 -45
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -97,7 +97,7 @@ __export(src_exports, {
|
|
|
97
97
|
sxzz: () => sxzz,
|
|
98
98
|
tseslint: () => import_typescript_eslint.default,
|
|
99
99
|
typescript: () => typescript,
|
|
100
|
-
|
|
100
|
+
typescriptCore: () => typescriptCore,
|
|
101
101
|
unicorn: () => unicorn,
|
|
102
102
|
unocss: () => unocss,
|
|
103
103
|
vue: () => vue,
|
|
@@ -749,51 +749,51 @@ var sortTsconfig = [
|
|
|
749
749
|
];
|
|
750
750
|
|
|
751
751
|
// src/configs/typescript.ts
|
|
752
|
-
var
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
{
|
|
758
|
-
|
|
759
|
-
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
752
|
+
var typescriptCore = import_typescript_eslint.default.config({
|
|
753
|
+
extends: [...import_typescript_eslint.default.configs.recommended],
|
|
754
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
755
|
+
languageOptions: {
|
|
756
|
+
parser: import_typescript_eslint.default.parser,
|
|
757
|
+
parserOptions: {
|
|
758
|
+
sourceType: "module"
|
|
760
759
|
}
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
"
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
771
|
-
"@typescript-eslint/no-redeclare": "error",
|
|
772
|
-
// handled by unused-imports/no-unused-imports
|
|
773
|
-
"@typescript-eslint/no-unused-vars": "off",
|
|
774
|
-
"@typescript-eslint/prefer-as-const": "warn",
|
|
775
|
-
"@typescript-eslint/prefer-literal-enum-member": [
|
|
776
|
-
"error",
|
|
777
|
-
{ allowBitwiseExpressions: true }
|
|
778
|
-
],
|
|
779
|
-
"no-restricted-syntax": [
|
|
780
|
-
"error",
|
|
781
|
-
...restrictedSyntaxJs,
|
|
782
|
-
"TSEnumDeclaration[const=true]"
|
|
783
|
-
]
|
|
784
|
-
};
|
|
785
|
-
var typescript = [
|
|
786
|
-
...import_typescript_eslint.default.config({
|
|
787
|
-
extends: [...import_typescript_eslint.default.configs.recommended],
|
|
788
|
-
files: [GLOB_TS, GLOB_TSX],
|
|
789
|
-
languageOptions: {
|
|
790
|
-
parser: import_typescript_eslint.default.parser,
|
|
791
|
-
parserOptions: {
|
|
792
|
-
sourceType: "module"
|
|
760
|
+
},
|
|
761
|
+
rules: {
|
|
762
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
763
|
+
"@typescript-eslint/ban-types": "off",
|
|
764
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
765
|
+
"error",
|
|
766
|
+
{
|
|
767
|
+
assertionStyle: "as",
|
|
768
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
793
769
|
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
770
|
+
],
|
|
771
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
772
|
+
"error",
|
|
773
|
+
{ disallowTypeAnnotations: false, fixStyle: "inline-type-imports" }
|
|
774
|
+
],
|
|
775
|
+
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
776
|
+
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
777
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
778
|
+
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
779
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
780
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
781
|
+
// handled by unused-imports/no-unused-imports
|
|
782
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
783
|
+
"@typescript-eslint/prefer-as-const": "warn",
|
|
784
|
+
"@typescript-eslint/prefer-literal-enum-member": [
|
|
785
|
+
"error",
|
|
786
|
+
{ allowBitwiseExpressions: true }
|
|
787
|
+
],
|
|
788
|
+
"no-restricted-syntax": [
|
|
789
|
+
"error",
|
|
790
|
+
...restrictedSyntaxJs,
|
|
791
|
+
"TSEnumDeclaration[const=true]"
|
|
792
|
+
]
|
|
793
|
+
}
|
|
794
|
+
});
|
|
795
|
+
var typescript = [
|
|
796
|
+
...typescriptCore,
|
|
797
797
|
{
|
|
798
798
|
files: ["**/*.d.ts"],
|
|
799
799
|
rules: {
|
|
@@ -980,6 +980,10 @@ var vue2Rules = {
|
|
|
980
980
|
...pluginVue.configs.recommended.rules
|
|
981
981
|
};
|
|
982
982
|
var vue = [
|
|
983
|
+
...import_typescript_eslint.default.config({
|
|
984
|
+
extends: typescriptCore,
|
|
985
|
+
files: [GLOB_VUE]
|
|
986
|
+
}),
|
|
983
987
|
{
|
|
984
988
|
files: [GLOB_VUE],
|
|
985
989
|
languageOptions: {
|
|
@@ -999,7 +1003,6 @@ var vue = [
|
|
|
999
1003
|
},
|
|
1000
1004
|
processor: pluginVue.processors[".vue"],
|
|
1001
1005
|
rules: {
|
|
1002
|
-
...typescriptRules,
|
|
1003
1006
|
...isVue3 ? vue3Rules : vue2Rules,
|
|
1004
1007
|
...vueCustomRules
|
|
1005
1008
|
}
|
|
@@ -1137,7 +1140,7 @@ function sxzz(config = [], {
|
|
|
1137
1140
|
sxzz,
|
|
1138
1141
|
tseslint,
|
|
1139
1142
|
typescript,
|
|
1140
|
-
|
|
1143
|
+
typescriptCore,
|
|
1141
1144
|
unicorn,
|
|
1142
1145
|
unocss,
|
|
1143
1146
|
vue,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlatESLintConfigItem
|
|
1
|
+
import { FlatESLintConfigItem } from 'eslint-define-config';
|
|
2
2
|
import * as _unocss_eslint_plugin from '@unocss/eslint-plugin';
|
|
3
3
|
import * as eslint_plugin_antfu from 'eslint-plugin-antfu';
|
|
4
4
|
import * as eslintPluginI from 'eslint-plugin-i';
|
|
@@ -39,7 +39,7 @@ declare const prettier: FlatESLintConfigItem[];
|
|
|
39
39
|
declare const sortPackageJson: FlatESLintConfigItem[];
|
|
40
40
|
declare const sortTsconfig: FlatESLintConfigItem[];
|
|
41
41
|
|
|
42
|
-
declare const
|
|
42
|
+
declare const typescriptCore: FlatESLintConfigItem[];
|
|
43
43
|
declare const typescript: FlatESLintConfigItem[];
|
|
44
44
|
|
|
45
45
|
declare const unicorn: FlatESLintConfigItem[];
|
|
@@ -131,4 +131,4 @@ declare function sxzz(config?: FlatESLintConfigItem | FlatESLintConfigItem[], {
|
|
|
131
131
|
sortKeys: boolean;
|
|
132
132
|
}>): FlatESLintConfigItem[];
|
|
133
133
|
|
|
134
|
-
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropDefault, presetAll as all, presetBasic as basic, comments, configPrettier, getVueVersion, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, node, pluginAntfu, pluginComments, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPrettier, pluginUnicorn, pluginUnocss, pluginVue, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, restrictedSyntaxJs, sortKeys, sortPackageJson, sortTsconfig, sxzz, typescript,
|
|
134
|
+
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropDefault, presetAll as all, presetBasic as basic, comments, configPrettier, getVueVersion, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, node, pluginAntfu, pluginComments, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPrettier, pluginUnicorn, pluginUnocss, pluginVue, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, restrictedSyntaxJs, sortKeys, sortPackageJson, sortTsconfig, sxzz, typescript, typescriptCore, unicorn, unocss, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlatESLintConfigItem
|
|
1
|
+
import { FlatESLintConfigItem } from 'eslint-define-config';
|
|
2
2
|
import * as _unocss_eslint_plugin from '@unocss/eslint-plugin';
|
|
3
3
|
import * as eslint_plugin_antfu from 'eslint-plugin-antfu';
|
|
4
4
|
import * as eslintPluginI from 'eslint-plugin-i';
|
|
@@ -39,7 +39,7 @@ declare const prettier: FlatESLintConfigItem[];
|
|
|
39
39
|
declare const sortPackageJson: FlatESLintConfigItem[];
|
|
40
40
|
declare const sortTsconfig: FlatESLintConfigItem[];
|
|
41
41
|
|
|
42
|
-
declare const
|
|
42
|
+
declare const typescriptCore: FlatESLintConfigItem[];
|
|
43
43
|
declare const typescript: FlatESLintConfigItem[];
|
|
44
44
|
|
|
45
45
|
declare const unicorn: FlatESLintConfigItem[];
|
|
@@ -131,4 +131,4 @@ declare function sxzz(config?: FlatESLintConfigItem | FlatESLintConfigItem[], {
|
|
|
131
131
|
sortKeys: boolean;
|
|
132
132
|
}>): FlatESLintConfigItem[];
|
|
133
133
|
|
|
134
|
-
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropDefault, presetAll as all, presetBasic as basic, comments, configPrettier, getVueVersion, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, node, pluginAntfu, pluginComments, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPrettier, pluginUnicorn, pluginUnocss, pluginVue, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, restrictedSyntaxJs, sortKeys, sortPackageJson, sortTsconfig, sxzz, typescript,
|
|
134
|
+
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropDefault, presetAll as all, presetBasic as basic, comments, configPrettier, getVueVersion, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, node, pluginAntfu, pluginComments, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPrettier, pluginUnicorn, pluginUnocss, pluginVue, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, restrictedSyntaxJs, sortKeys, sortPackageJson, sortTsconfig, sxzz, typescript, typescriptCore, unicorn, unocss, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -642,51 +642,51 @@ var sortTsconfig = [
|
|
|
642
642
|
];
|
|
643
643
|
|
|
644
644
|
// src/configs/typescript.ts
|
|
645
|
-
var
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
{
|
|
651
|
-
|
|
652
|
-
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
645
|
+
var typescriptCore = tseslint.config({
|
|
646
|
+
extends: [...tseslint.configs.recommended],
|
|
647
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
648
|
+
languageOptions: {
|
|
649
|
+
parser: tseslint.parser,
|
|
650
|
+
parserOptions: {
|
|
651
|
+
sourceType: "module"
|
|
653
652
|
}
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
"
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
664
|
-
"@typescript-eslint/no-redeclare": "error",
|
|
665
|
-
// handled by unused-imports/no-unused-imports
|
|
666
|
-
"@typescript-eslint/no-unused-vars": "off",
|
|
667
|
-
"@typescript-eslint/prefer-as-const": "warn",
|
|
668
|
-
"@typescript-eslint/prefer-literal-enum-member": [
|
|
669
|
-
"error",
|
|
670
|
-
{ allowBitwiseExpressions: true }
|
|
671
|
-
],
|
|
672
|
-
"no-restricted-syntax": [
|
|
673
|
-
"error",
|
|
674
|
-
...restrictedSyntaxJs,
|
|
675
|
-
"TSEnumDeclaration[const=true]"
|
|
676
|
-
]
|
|
677
|
-
};
|
|
678
|
-
var typescript = [
|
|
679
|
-
...tseslint.config({
|
|
680
|
-
extends: [...tseslint.configs.recommended],
|
|
681
|
-
files: [GLOB_TS, GLOB_TSX],
|
|
682
|
-
languageOptions: {
|
|
683
|
-
parser: tseslint.parser,
|
|
684
|
-
parserOptions: {
|
|
685
|
-
sourceType: "module"
|
|
653
|
+
},
|
|
654
|
+
rules: {
|
|
655
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
656
|
+
"@typescript-eslint/ban-types": "off",
|
|
657
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
658
|
+
"error",
|
|
659
|
+
{
|
|
660
|
+
assertionStyle: "as",
|
|
661
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
686
662
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
663
|
+
],
|
|
664
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
665
|
+
"error",
|
|
666
|
+
{ disallowTypeAnnotations: false, fixStyle: "inline-type-imports" }
|
|
667
|
+
],
|
|
668
|
+
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
669
|
+
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
670
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
671
|
+
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
672
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
673
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
674
|
+
// handled by unused-imports/no-unused-imports
|
|
675
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
676
|
+
"@typescript-eslint/prefer-as-const": "warn",
|
|
677
|
+
"@typescript-eslint/prefer-literal-enum-member": [
|
|
678
|
+
"error",
|
|
679
|
+
{ allowBitwiseExpressions: true }
|
|
680
|
+
],
|
|
681
|
+
"no-restricted-syntax": [
|
|
682
|
+
"error",
|
|
683
|
+
...restrictedSyntaxJs,
|
|
684
|
+
"TSEnumDeclaration[const=true]"
|
|
685
|
+
]
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
var typescript = [
|
|
689
|
+
...typescriptCore,
|
|
690
690
|
{
|
|
691
691
|
files: ["**/*.d.ts"],
|
|
692
692
|
rules: {
|
|
@@ -873,6 +873,10 @@ var vue2Rules = {
|
|
|
873
873
|
...pluginVue.configs.recommended.rules
|
|
874
874
|
};
|
|
875
875
|
var vue = [
|
|
876
|
+
...tseslint.config({
|
|
877
|
+
extends: typescriptCore,
|
|
878
|
+
files: [GLOB_VUE]
|
|
879
|
+
}),
|
|
876
880
|
{
|
|
877
881
|
files: [GLOB_VUE],
|
|
878
882
|
languageOptions: {
|
|
@@ -892,7 +896,6 @@ var vue = [
|
|
|
892
896
|
},
|
|
893
897
|
processor: pluginVue.processors[".vue"],
|
|
894
898
|
rules: {
|
|
895
|
-
...typescriptRules,
|
|
896
899
|
...isVue3 ? vue3Rules : vue2Rules,
|
|
897
900
|
...vueCustomRules
|
|
898
901
|
}
|
|
@@ -1029,7 +1032,7 @@ export {
|
|
|
1029
1032
|
sxzz,
|
|
1030
1033
|
tseslint,
|
|
1031
1034
|
typescript,
|
|
1032
|
-
|
|
1035
|
+
typescriptCore,
|
|
1033
1036
|
unicorn,
|
|
1034
1037
|
unocss,
|
|
1035
1038
|
vue,
|