@ofk/eslint-config 0.0.7 → 0.0.8
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.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +14 -21
- package/dist/index.mjs +14 -21
- package/package.json +1 -7
package/dist/index.d.mts
CHANGED
|
@@ -42,12 +42,11 @@ declare function defineBaseConfig({ eslintComments: eslintCommentsOptions, ignor
|
|
|
42
42
|
vitest?: false | Parameters<typeof vitest>[0];
|
|
43
43
|
}): _typescript_eslint_utils_ts_eslint.FlatConfig.ConfigArray;
|
|
44
44
|
|
|
45
|
-
declare function defineReactConfig({ jsxA11y: enabledJsxA11y, jsxRuntime: enabledJsxRuntime, reactHooks: enabledReactHooks, reactRefresh: enabledReactRefresh,
|
|
45
|
+
declare function defineReactConfig({ jsxA11y: enabledJsxA11y, jsxRuntime: enabledJsxRuntime, reactHooks: enabledReactHooks, reactRefresh: enabledReactRefresh, ...reactOptions }?: Parameters<typeof react>[0] & {
|
|
46
46
|
jsxA11y?: boolean;
|
|
47
47
|
jsxRuntime?: boolean;
|
|
48
48
|
reactHooks?: boolean;
|
|
49
49
|
reactRefresh?: boolean;
|
|
50
|
-
tailwindcss?: boolean;
|
|
51
50
|
}): _typescript_eslint_utils_ts_eslint.FlatConfig.ConfigArray;
|
|
52
51
|
|
|
53
52
|
declare function defineConfig({ eslintComments: eslintCommentsOptions, imports: importsOptions, js: jsOptions, perfectionist: perfectionistOptions, react: reactOptions, ts: tsOptions, unusedImports: unusedImportsOptions, vitest: vitestOptions, ...config }?: Parameters<typeof defineBaseConfig>[0] & {
|
package/dist/index.d.ts
CHANGED
|
@@ -42,12 +42,11 @@ declare function defineBaseConfig({ eslintComments: eslintCommentsOptions, ignor
|
|
|
42
42
|
vitest?: false | Parameters<typeof vitest>[0];
|
|
43
43
|
}): _typescript_eslint_utils_ts_eslint.FlatConfig.ConfigArray;
|
|
44
44
|
|
|
45
|
-
declare function defineReactConfig({ jsxA11y: enabledJsxA11y, jsxRuntime: enabledJsxRuntime, reactHooks: enabledReactHooks, reactRefresh: enabledReactRefresh,
|
|
45
|
+
declare function defineReactConfig({ jsxA11y: enabledJsxA11y, jsxRuntime: enabledJsxRuntime, reactHooks: enabledReactHooks, reactRefresh: enabledReactRefresh, ...reactOptions }?: Parameters<typeof react>[0] & {
|
|
46
46
|
jsxA11y?: boolean;
|
|
47
47
|
jsxRuntime?: boolean;
|
|
48
48
|
reactHooks?: boolean;
|
|
49
49
|
reactRefresh?: boolean;
|
|
50
|
-
tailwindcss?: boolean;
|
|
51
50
|
}): _typescript_eslint_utils_ts_eslint.FlatConfig.ConfigArray;
|
|
52
51
|
|
|
53
52
|
declare function defineConfig({ eslintComments: eslintCommentsOptions, imports: importsOptions, js: jsOptions, perfectionist: perfectionistOptions, react: reactOptions, ts: tsOptions, unusedImports: unusedImportsOptions, vitest: vitestOptions, ...config }?: Parameters<typeof defineBaseConfig>[0] & {
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(index_exports);
|
|
36
36
|
|
|
37
37
|
// src/base.ts
|
|
38
|
-
var
|
|
38
|
+
var import_typescript_eslint6 = __toESM(require("typescript-eslint"));
|
|
39
39
|
|
|
40
40
|
// src/configs/eslint-comments.ts
|
|
41
41
|
var import_configs = __toESM(require("@eslint-community/eslint-plugin-eslint-comments/configs"));
|
|
@@ -745,13 +745,8 @@ var reactHooksStrict = mergeRules(
|
|
|
745
745
|
var import_eslint_plugin_react_refresh = __toESM(require("eslint-plugin-react-refresh"));
|
|
746
746
|
var reactRefreshStrict = mergeRules(import_eslint_plugin_react_refresh.default.configs.recommended);
|
|
747
747
|
|
|
748
|
-
// src/configs/tailwindcss.ts
|
|
749
|
-
var import_eslint_plugin_tailwindcss = __toESM(require("eslint-plugin-tailwindcss"));
|
|
750
|
-
var import_typescript_eslint4 = __toESM(require("typescript-eslint"));
|
|
751
|
-
var tailwindcssStrict = import_typescript_eslint4.default.config(import_eslint_plugin_tailwindcss.default.configs["flat/recommended"]);
|
|
752
|
-
|
|
753
748
|
// src/configs/ts.ts
|
|
754
|
-
var
|
|
749
|
+
var import_typescript_eslint4 = __toESM(require("typescript-eslint"));
|
|
755
750
|
var jsStrictRules = jsStrict.rules ?? {};
|
|
756
751
|
var tsEslintOverrideRules = mergeRules(
|
|
757
752
|
{},
|
|
@@ -831,14 +826,14 @@ var tsRecommendedOverride = mergeRules(
|
|
|
831
826
|
// confilict with @typescript-eslint/consistent-type-imports
|
|
832
827
|
}
|
|
833
828
|
);
|
|
834
|
-
var tsRecommended =
|
|
835
|
-
|
|
829
|
+
var tsRecommended = import_typescript_eslint4.default.config(
|
|
830
|
+
import_typescript_eslint4.default.configs.recommended,
|
|
836
831
|
tsEslintOverrideRules,
|
|
837
832
|
tsRecommendedOverride
|
|
838
833
|
);
|
|
839
|
-
var tsStrict =
|
|
840
|
-
|
|
841
|
-
|
|
834
|
+
var tsStrict = import_typescript_eslint4.default.config(
|
|
835
|
+
import_typescript_eslint4.default.configs.strictTypeChecked,
|
|
836
|
+
import_typescript_eslint4.default.configs.stylisticTypeChecked,
|
|
842
837
|
tsEslintOverrideRules,
|
|
843
838
|
tsRecommendedOverride,
|
|
844
839
|
{
|
|
@@ -895,7 +890,7 @@ function ts({
|
|
|
895
890
|
strict = true,
|
|
896
891
|
...config
|
|
897
892
|
}) {
|
|
898
|
-
return
|
|
893
|
+
return import_typescript_eslint4.default.config(
|
|
899
894
|
parserOptions ? {
|
|
900
895
|
languageOptions: {
|
|
901
896
|
parserOptions: {
|
|
@@ -907,7 +902,7 @@ function ts({
|
|
|
907
902
|
strict ? tsStrict : tsRecommended,
|
|
908
903
|
config,
|
|
909
904
|
disableTypeChecked ? {
|
|
910
|
-
extends: [
|
|
905
|
+
extends: [import_typescript_eslint4.default.configs.disableTypeChecked],
|
|
911
906
|
files: ["**/*.{js,jsx,mjs,cjs}"]
|
|
912
907
|
} : {}
|
|
913
908
|
);
|
|
@@ -930,7 +925,7 @@ var unusedImportsStrict = mergeRules({
|
|
|
930
925
|
|
|
931
926
|
// src/configs/vitest.ts
|
|
932
927
|
var import_eslint_plugin = __toESM(require("@vitest/eslint-plugin"));
|
|
933
|
-
var
|
|
928
|
+
var import_typescript_eslint5 = __toESM(require("typescript-eslint"));
|
|
934
929
|
var vitestStrict = mergeRules(import_eslint_plugin.default.configs.recommended, {
|
|
935
930
|
"vitest/consistent-test-filename": "off",
|
|
936
931
|
"vitest/consistent-test-it": "error",
|
|
@@ -989,7 +984,7 @@ var vitestStrict = mergeRules(import_eslint_plugin.default.configs.recommended,
|
|
|
989
984
|
"vitest/valid-expect-in-promise": "error"
|
|
990
985
|
});
|
|
991
986
|
function vitest(config) {
|
|
992
|
-
return
|
|
987
|
+
return import_typescript_eslint5.default.config({
|
|
993
988
|
extends: [vitestStrict, config],
|
|
994
989
|
files: ["tests/**", "*.test.*"]
|
|
995
990
|
});
|
|
@@ -1087,7 +1082,7 @@ function defineBaseConfig({
|
|
|
1087
1082
|
vitest: vitestOptions = {},
|
|
1088
1083
|
...config
|
|
1089
1084
|
} = {}) {
|
|
1090
|
-
return
|
|
1085
|
+
return import_typescript_eslint6.default.config(
|
|
1091
1086
|
settings ? { settings } : {},
|
|
1092
1087
|
ignores ? { ignores } : {},
|
|
1093
1088
|
jsOptions ? js(jsOptions) : {},
|
|
@@ -1104,16 +1099,15 @@ function defineBaseConfig({
|
|
|
1104
1099
|
|
|
1105
1100
|
// src/react.ts
|
|
1106
1101
|
var import_eslint_plugin_react2 = __toESM(require("eslint-plugin-react"));
|
|
1107
|
-
var
|
|
1102
|
+
var import_typescript_eslint7 = __toESM(require("typescript-eslint"));
|
|
1108
1103
|
function defineReactConfig({
|
|
1109
1104
|
jsxA11y: enabledJsxA11y = true,
|
|
1110
1105
|
jsxRuntime: enabledJsxRuntime = true,
|
|
1111
1106
|
reactHooks: enabledReactHooks = true,
|
|
1112
1107
|
reactRefresh: enabledReactRefresh = true,
|
|
1113
|
-
tailwindcss: enabledTailwindcss = true,
|
|
1114
1108
|
...reactOptions
|
|
1115
1109
|
} = {}) {
|
|
1116
|
-
return
|
|
1110
|
+
return import_typescript_eslint7.default.config(
|
|
1117
1111
|
react({
|
|
1118
1112
|
...reactOptions,
|
|
1119
1113
|
extends: [
|
|
@@ -1121,7 +1115,6 @@ function defineReactConfig({
|
|
|
1121
1115
|
enabledReactHooks ? reactHooksStrict : {},
|
|
1122
1116
|
enabledReactRefresh ? reactRefreshStrict : {},
|
|
1123
1117
|
enabledJsxA11y ? jsxA11yStrict : {},
|
|
1124
|
-
enabledTailwindcss ? tailwindcssStrict : {},
|
|
1125
1118
|
...reactOptions.extends ?? []
|
|
1126
1119
|
]
|
|
1127
1120
|
})
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/base.ts
|
|
2
|
-
import
|
|
2
|
+
import pluginTs6 from "typescript-eslint";
|
|
3
3
|
|
|
4
4
|
// src/configs/eslint-comments.ts
|
|
5
5
|
import pluginEslintComments from "@eslint-community/eslint-plugin-eslint-comments/configs";
|
|
@@ -709,13 +709,8 @@ var reactHooksStrict = mergeRules(
|
|
|
709
709
|
import pluginReactRefresh from "eslint-plugin-react-refresh";
|
|
710
710
|
var reactRefreshStrict = mergeRules(pluginReactRefresh.configs.recommended);
|
|
711
711
|
|
|
712
|
-
// src/configs/tailwindcss.ts
|
|
713
|
-
import pluginTailwindcss from "eslint-plugin-tailwindcss";
|
|
714
|
-
import pluginTs4 from "typescript-eslint";
|
|
715
|
-
var tailwindcssStrict = pluginTs4.config(pluginTailwindcss.configs["flat/recommended"]);
|
|
716
|
-
|
|
717
712
|
// src/configs/ts.ts
|
|
718
|
-
import
|
|
713
|
+
import pluginTs4 from "typescript-eslint";
|
|
719
714
|
var jsStrictRules = jsStrict.rules ?? {};
|
|
720
715
|
var tsEslintOverrideRules = mergeRules(
|
|
721
716
|
{},
|
|
@@ -795,14 +790,14 @@ var tsRecommendedOverride = mergeRules(
|
|
|
795
790
|
// confilict with @typescript-eslint/consistent-type-imports
|
|
796
791
|
}
|
|
797
792
|
);
|
|
798
|
-
var tsRecommended =
|
|
799
|
-
|
|
793
|
+
var tsRecommended = pluginTs4.config(
|
|
794
|
+
pluginTs4.configs.recommended,
|
|
800
795
|
tsEslintOverrideRules,
|
|
801
796
|
tsRecommendedOverride
|
|
802
797
|
);
|
|
803
|
-
var tsStrict =
|
|
804
|
-
|
|
805
|
-
|
|
798
|
+
var tsStrict = pluginTs4.config(
|
|
799
|
+
pluginTs4.configs.strictTypeChecked,
|
|
800
|
+
pluginTs4.configs.stylisticTypeChecked,
|
|
806
801
|
tsEslintOverrideRules,
|
|
807
802
|
tsRecommendedOverride,
|
|
808
803
|
{
|
|
@@ -859,7 +854,7 @@ function ts({
|
|
|
859
854
|
strict = true,
|
|
860
855
|
...config
|
|
861
856
|
}) {
|
|
862
|
-
return
|
|
857
|
+
return pluginTs4.config(
|
|
863
858
|
parserOptions ? {
|
|
864
859
|
languageOptions: {
|
|
865
860
|
parserOptions: {
|
|
@@ -871,7 +866,7 @@ function ts({
|
|
|
871
866
|
strict ? tsStrict : tsRecommended,
|
|
872
867
|
config,
|
|
873
868
|
disableTypeChecked ? {
|
|
874
|
-
extends: [
|
|
869
|
+
extends: [pluginTs4.configs.disableTypeChecked],
|
|
875
870
|
files: ["**/*.{js,jsx,mjs,cjs}"]
|
|
876
871
|
} : {}
|
|
877
872
|
);
|
|
@@ -894,7 +889,7 @@ var unusedImportsStrict = mergeRules({
|
|
|
894
889
|
|
|
895
890
|
// src/configs/vitest.ts
|
|
896
891
|
import pluginVitest from "@vitest/eslint-plugin";
|
|
897
|
-
import
|
|
892
|
+
import pluginTs5 from "typescript-eslint";
|
|
898
893
|
var vitestStrict = mergeRules(pluginVitest.configs.recommended, {
|
|
899
894
|
"vitest/consistent-test-filename": "off",
|
|
900
895
|
"vitest/consistent-test-it": "error",
|
|
@@ -953,7 +948,7 @@ var vitestStrict = mergeRules(pluginVitest.configs.recommended, {
|
|
|
953
948
|
"vitest/valid-expect-in-promise": "error"
|
|
954
949
|
});
|
|
955
950
|
function vitest(config) {
|
|
956
|
-
return
|
|
951
|
+
return pluginTs5.config({
|
|
957
952
|
extends: [vitestStrict, config],
|
|
958
953
|
files: ["tests/**", "*.test.*"]
|
|
959
954
|
});
|
|
@@ -1051,7 +1046,7 @@ function defineBaseConfig({
|
|
|
1051
1046
|
vitest: vitestOptions = {},
|
|
1052
1047
|
...config
|
|
1053
1048
|
} = {}) {
|
|
1054
|
-
return
|
|
1049
|
+
return pluginTs6.config(
|
|
1055
1050
|
settings ? { settings } : {},
|
|
1056
1051
|
ignores ? { ignores } : {},
|
|
1057
1052
|
jsOptions ? js(jsOptions) : {},
|
|
@@ -1068,16 +1063,15 @@ function defineBaseConfig({
|
|
|
1068
1063
|
|
|
1069
1064
|
// src/react.ts
|
|
1070
1065
|
import pluginReact2 from "eslint-plugin-react";
|
|
1071
|
-
import
|
|
1066
|
+
import pluginTs7 from "typescript-eslint";
|
|
1072
1067
|
function defineReactConfig({
|
|
1073
1068
|
jsxA11y: enabledJsxA11y = true,
|
|
1074
1069
|
jsxRuntime: enabledJsxRuntime = true,
|
|
1075
1070
|
reactHooks: enabledReactHooks = true,
|
|
1076
1071
|
reactRefresh: enabledReactRefresh = true,
|
|
1077
|
-
tailwindcss: enabledTailwindcss = true,
|
|
1078
1072
|
...reactOptions
|
|
1079
1073
|
} = {}) {
|
|
1080
|
-
return
|
|
1074
|
+
return pluginTs7.config(
|
|
1081
1075
|
react({
|
|
1082
1076
|
...reactOptions,
|
|
1083
1077
|
extends: [
|
|
@@ -1085,7 +1079,6 @@ function defineReactConfig({
|
|
|
1085
1079
|
enabledReactHooks ? reactHooksStrict : {},
|
|
1086
1080
|
enabledReactRefresh ? reactRefreshStrict : {},
|
|
1087
1081
|
enabledJsxA11y ? jsxA11yStrict : {},
|
|
1088
|
-
enabledTailwindcss ? tailwindcssStrict : {},
|
|
1089
1082
|
...reactOptions.extends ?? []
|
|
1090
1083
|
]
|
|
1091
1084
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ofk/eslint-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ofk (https://github.com/ofk/)",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"eslint-plugin-react": "^7.35.0",
|
|
42
42
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
43
43
|
"eslint-plugin-react-refresh": "^0.4.16",
|
|
44
|
-
"eslint-plugin-tailwindcss": "^3.16.0",
|
|
45
44
|
"eslint-plugin-unicorn": "^56.0.0",
|
|
46
45
|
"eslint-plugin-unused-imports": "^4.1.1",
|
|
47
46
|
"globals": ">=14.0.0",
|
|
@@ -78,9 +77,6 @@
|
|
|
78
77
|
"eslint-plugin-react-refresh": {
|
|
79
78
|
"optional": true
|
|
80
79
|
},
|
|
81
|
-
"eslint-plugin-tailwindcss": {
|
|
82
|
-
"optional": true
|
|
83
|
-
},
|
|
84
80
|
"eslint-plugin-unicorn": {
|
|
85
81
|
"optional": true
|
|
86
82
|
},
|
|
@@ -103,7 +99,6 @@
|
|
|
103
99
|
"@types/confusing-browser-globals": "^1.0.3",
|
|
104
100
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
105
101
|
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
|
|
106
|
-
"@types/eslint-plugin-tailwindcss": "^3.17.0",
|
|
107
102
|
"@vitest/eslint-plugin": "^1.1.25",
|
|
108
103
|
"confusing-browser-globals": "^1.0.11",
|
|
109
104
|
"eslint": "^9.19.0",
|
|
@@ -114,7 +109,6 @@
|
|
|
114
109
|
"eslint-plugin-react": "^7.37.4",
|
|
115
110
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
116
111
|
"eslint-plugin-react-refresh": "^0.4.18",
|
|
117
|
-
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
118
112
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
119
113
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
120
114
|
"globals": "^15.15.0",
|