@sxzz/eslint-config 3.8.0 → 3.8.2
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 +50 -48
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +49 -47
- 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,
|
|
@@ -255,8 +255,7 @@ var imports = [
|
|
|
255
255
|
{
|
|
256
256
|
files: [
|
|
257
257
|
`**/*config*.${GLOB_SRC_EXT}`,
|
|
258
|
-
`**/views
|
|
259
|
-
`**/pages/${GLOB_SRC}`,
|
|
258
|
+
`**/{views,pages,routes,middleware,plugins,api}/**`,
|
|
260
259
|
`**/{index,vite,esbuild,rollup,webpack,rspack}.ts`,
|
|
261
260
|
"**/*.d.ts",
|
|
262
261
|
`${GLOB_MARKDOWN}/**`,
|
|
@@ -749,51 +748,51 @@ var sortTsconfig = [
|
|
|
749
748
|
];
|
|
750
749
|
|
|
751
750
|
// src/configs/typescript.ts
|
|
752
|
-
var
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
{
|
|
758
|
-
|
|
759
|
-
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
751
|
+
var typescriptCore = import_typescript_eslint.default.config({
|
|
752
|
+
extends: [...import_typescript_eslint.default.configs.recommended],
|
|
753
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
754
|
+
languageOptions: {
|
|
755
|
+
parser: import_typescript_eslint.default.parser,
|
|
756
|
+
parserOptions: {
|
|
757
|
+
sourceType: "module"
|
|
760
758
|
}
|
|
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"
|
|
759
|
+
},
|
|
760
|
+
rules: {
|
|
761
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
762
|
+
"@typescript-eslint/ban-types": "off",
|
|
763
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
764
|
+
"error",
|
|
765
|
+
{
|
|
766
|
+
assertionStyle: "as",
|
|
767
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
793
768
|
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
769
|
+
],
|
|
770
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
771
|
+
"error",
|
|
772
|
+
{ disallowTypeAnnotations: false, fixStyle: "inline-type-imports" }
|
|
773
|
+
],
|
|
774
|
+
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
775
|
+
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
776
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
777
|
+
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
778
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
779
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
780
|
+
// handled by unused-imports/no-unused-imports
|
|
781
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
782
|
+
"@typescript-eslint/prefer-as-const": "warn",
|
|
783
|
+
"@typescript-eslint/prefer-literal-enum-member": [
|
|
784
|
+
"error",
|
|
785
|
+
{ allowBitwiseExpressions: true }
|
|
786
|
+
],
|
|
787
|
+
"no-restricted-syntax": [
|
|
788
|
+
"error",
|
|
789
|
+
...restrictedSyntaxJs,
|
|
790
|
+
"TSEnumDeclaration[const=true]"
|
|
791
|
+
]
|
|
792
|
+
}
|
|
793
|
+
});
|
|
794
|
+
var typescript = [
|
|
795
|
+
...typescriptCore,
|
|
797
796
|
{
|
|
798
797
|
files: ["**/*.d.ts"],
|
|
799
798
|
rules: {
|
|
@@ -980,6 +979,10 @@ var vue2Rules = {
|
|
|
980
979
|
...pluginVue.configs.recommended.rules
|
|
981
980
|
};
|
|
982
981
|
var vue = [
|
|
982
|
+
...import_typescript_eslint.default.config({
|
|
983
|
+
extends: typescriptCore,
|
|
984
|
+
files: [GLOB_VUE]
|
|
985
|
+
}),
|
|
983
986
|
{
|
|
984
987
|
files: [GLOB_VUE],
|
|
985
988
|
languageOptions: {
|
|
@@ -999,7 +1002,6 @@ var vue = [
|
|
|
999
1002
|
},
|
|
1000
1003
|
processor: pluginVue.processors[".vue"],
|
|
1001
1004
|
rules: {
|
|
1002
|
-
...typescriptRules,
|
|
1003
1005
|
...isVue3 ? vue3Rules : vue2Rules,
|
|
1004
1006
|
...vueCustomRules
|
|
1005
1007
|
}
|
|
@@ -1137,7 +1139,7 @@ function sxzz(config = [], {
|
|
|
1137
1139
|
sxzz,
|
|
1138
1140
|
tseslint,
|
|
1139
1141
|
typescript,
|
|
1140
|
-
|
|
1142
|
+
typescriptCore,
|
|
1141
1143
|
unicorn,
|
|
1142
1144
|
unocss,
|
|
1143
1145
|
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
|
@@ -148,8 +148,7 @@ var imports = [
|
|
|
148
148
|
{
|
|
149
149
|
files: [
|
|
150
150
|
`**/*config*.${GLOB_SRC_EXT}`,
|
|
151
|
-
`**/views
|
|
152
|
-
`**/pages/${GLOB_SRC}`,
|
|
151
|
+
`**/{views,pages,routes,middleware,plugins,api}/**`,
|
|
153
152
|
`**/{index,vite,esbuild,rollup,webpack,rspack}.ts`,
|
|
154
153
|
"**/*.d.ts",
|
|
155
154
|
`${GLOB_MARKDOWN}/**`,
|
|
@@ -642,51 +641,51 @@ var sortTsconfig = [
|
|
|
642
641
|
];
|
|
643
642
|
|
|
644
643
|
// src/configs/typescript.ts
|
|
645
|
-
var
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
{
|
|
651
|
-
|
|
652
|
-
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
644
|
+
var typescriptCore = tseslint.config({
|
|
645
|
+
extends: [...tseslint.configs.recommended],
|
|
646
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
647
|
+
languageOptions: {
|
|
648
|
+
parser: tseslint.parser,
|
|
649
|
+
parserOptions: {
|
|
650
|
+
sourceType: "module"
|
|
653
651
|
}
|
|
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"
|
|
652
|
+
},
|
|
653
|
+
rules: {
|
|
654
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
655
|
+
"@typescript-eslint/ban-types": "off",
|
|
656
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
657
|
+
"error",
|
|
658
|
+
{
|
|
659
|
+
assertionStyle: "as",
|
|
660
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
686
661
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
662
|
+
],
|
|
663
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
664
|
+
"error",
|
|
665
|
+
{ disallowTypeAnnotations: false, fixStyle: "inline-type-imports" }
|
|
666
|
+
],
|
|
667
|
+
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
668
|
+
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
669
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
670
|
+
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
671
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
672
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
673
|
+
// handled by unused-imports/no-unused-imports
|
|
674
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
675
|
+
"@typescript-eslint/prefer-as-const": "warn",
|
|
676
|
+
"@typescript-eslint/prefer-literal-enum-member": [
|
|
677
|
+
"error",
|
|
678
|
+
{ allowBitwiseExpressions: true }
|
|
679
|
+
],
|
|
680
|
+
"no-restricted-syntax": [
|
|
681
|
+
"error",
|
|
682
|
+
...restrictedSyntaxJs,
|
|
683
|
+
"TSEnumDeclaration[const=true]"
|
|
684
|
+
]
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
var typescript = [
|
|
688
|
+
...typescriptCore,
|
|
690
689
|
{
|
|
691
690
|
files: ["**/*.d.ts"],
|
|
692
691
|
rules: {
|
|
@@ -873,6 +872,10 @@ var vue2Rules = {
|
|
|
873
872
|
...pluginVue.configs.recommended.rules
|
|
874
873
|
};
|
|
875
874
|
var vue = [
|
|
875
|
+
...tseslint.config({
|
|
876
|
+
extends: typescriptCore,
|
|
877
|
+
files: [GLOB_VUE]
|
|
878
|
+
}),
|
|
876
879
|
{
|
|
877
880
|
files: [GLOB_VUE],
|
|
878
881
|
languageOptions: {
|
|
@@ -892,7 +895,6 @@ var vue = [
|
|
|
892
895
|
},
|
|
893
896
|
processor: pluginVue.processors[".vue"],
|
|
894
897
|
rules: {
|
|
895
|
-
...typescriptRules,
|
|
896
898
|
...isVue3 ? vue3Rules : vue2Rules,
|
|
897
899
|
...vueCustomRules
|
|
898
900
|
}
|
|
@@ -1029,7 +1031,7 @@ export {
|
|
|
1029
1031
|
sxzz,
|
|
1030
1032
|
tseslint,
|
|
1031
1033
|
typescript,
|
|
1032
|
-
|
|
1034
|
+
typescriptCore,
|
|
1033
1035
|
unicorn,
|
|
1034
1036
|
unocss,
|
|
1035
1037
|
vue,
|