@ofk/eslint-config 0.0.5 → 0.0.6
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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +21 -14
- package/dist/index.mjs +21 -14
- package/package.json +7 -1
package/dist/index.d.mts
CHANGED
|
@@ -42,11 +42,12 @@ 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, ...reactOptions }?: Parameters<typeof react>[0] & {
|
|
45
|
+
declare function defineReactConfig({ jsxA11y: enabledJsxA11y, jsxRuntime: enabledJsxRuntime, reactHooks: enabledReactHooks, reactRefresh: enabledReactRefresh, tailwindcss: enabledTailwindcss, ...reactOptions }?: Parameters<typeof react>[0] & {
|
|
46
46
|
jsxA11y?: boolean;
|
|
47
47
|
jsxRuntime?: boolean;
|
|
48
48
|
reactHooks?: boolean;
|
|
49
49
|
reactRefresh?: boolean;
|
|
50
|
+
tailwindcss?: boolean;
|
|
50
51
|
}): _typescript_eslint_utils_ts_eslint.FlatConfig.ConfigArray;
|
|
51
52
|
|
|
52
53
|
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,11 +42,12 @@ 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, ...reactOptions }?: Parameters<typeof react>[0] & {
|
|
45
|
+
declare function defineReactConfig({ jsxA11y: enabledJsxA11y, jsxRuntime: enabledJsxRuntime, reactHooks: enabledReactHooks, reactRefresh: enabledReactRefresh, tailwindcss: enabledTailwindcss, ...reactOptions }?: Parameters<typeof react>[0] & {
|
|
46
46
|
jsxA11y?: boolean;
|
|
47
47
|
jsxRuntime?: boolean;
|
|
48
48
|
reactHooks?: boolean;
|
|
49
49
|
reactRefresh?: boolean;
|
|
50
|
+
tailwindcss?: boolean;
|
|
50
51
|
}): _typescript_eslint_utils_ts_eslint.FlatConfig.ConfigArray;
|
|
51
52
|
|
|
52
53
|
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_eslint7 = __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"));
|
|
@@ -748,8 +748,13 @@ var reactHooksStrict = mergeRules(
|
|
|
748
748
|
var import_eslint_plugin_react_refresh = __toESM(require("eslint-plugin-react-refresh"));
|
|
749
749
|
var reactRefreshStrict = mergeRules(import_eslint_plugin_react_refresh.default.configs.recommended);
|
|
750
750
|
|
|
751
|
-
// src/configs/
|
|
751
|
+
// src/configs/tailwindcss.ts
|
|
752
|
+
var import_eslint_plugin_tailwindcss = __toESM(require("eslint-plugin-tailwindcss"));
|
|
752
753
|
var import_typescript_eslint4 = __toESM(require("typescript-eslint"));
|
|
754
|
+
var tailwindcssStrict = import_typescript_eslint4.default.config(import_eslint_plugin_tailwindcss.default.configs["flat/recommended"]);
|
|
755
|
+
|
|
756
|
+
// src/configs/ts.ts
|
|
757
|
+
var import_typescript_eslint5 = __toESM(require("typescript-eslint"));
|
|
753
758
|
var jsStrictRules = jsStrict.rules ?? {};
|
|
754
759
|
var tsEslintOverrideRules = mergeRules(
|
|
755
760
|
{},
|
|
@@ -829,14 +834,14 @@ var tsRecommendedOverride = mergeRules(
|
|
|
829
834
|
// confilict with @typescript-eslint/consistent-type-imports
|
|
830
835
|
}
|
|
831
836
|
);
|
|
832
|
-
var tsRecommended =
|
|
833
|
-
|
|
837
|
+
var tsRecommended = import_typescript_eslint5.default.config(
|
|
838
|
+
import_typescript_eslint5.default.configs.recommended,
|
|
834
839
|
tsEslintOverrideRules,
|
|
835
840
|
tsRecommendedOverride
|
|
836
841
|
);
|
|
837
|
-
var tsStrict =
|
|
838
|
-
|
|
839
|
-
|
|
842
|
+
var tsStrict = import_typescript_eslint5.default.config(
|
|
843
|
+
import_typescript_eslint5.default.configs.strictTypeChecked,
|
|
844
|
+
import_typescript_eslint5.default.configs.stylisticTypeChecked,
|
|
840
845
|
tsEslintOverrideRules,
|
|
841
846
|
tsRecommendedOverride,
|
|
842
847
|
{
|
|
@@ -893,7 +898,7 @@ function ts({
|
|
|
893
898
|
strict = true,
|
|
894
899
|
...config
|
|
895
900
|
}) {
|
|
896
|
-
return
|
|
901
|
+
return import_typescript_eslint5.default.config(
|
|
897
902
|
parserOptions ? {
|
|
898
903
|
languageOptions: {
|
|
899
904
|
parserOptions: {
|
|
@@ -905,7 +910,7 @@ function ts({
|
|
|
905
910
|
strict ? tsStrict : tsRecommended,
|
|
906
911
|
config,
|
|
907
912
|
disableTypeChecked ? {
|
|
908
|
-
extends: [
|
|
913
|
+
extends: [import_typescript_eslint5.default.configs.disableTypeChecked],
|
|
909
914
|
files: ["**/*.{js,jsx,mjs,cjs}"]
|
|
910
915
|
} : {}
|
|
911
916
|
);
|
|
@@ -928,7 +933,7 @@ var unusedImportsStrict = mergeRules({
|
|
|
928
933
|
|
|
929
934
|
// src/configs/vitest.ts
|
|
930
935
|
var import_eslint_plugin = __toESM(require("@vitest/eslint-plugin"));
|
|
931
|
-
var
|
|
936
|
+
var import_typescript_eslint6 = __toESM(require("typescript-eslint"));
|
|
932
937
|
var vitestStrict = mergeRules(import_eslint_plugin.default.configs.recommended, {
|
|
933
938
|
"vitest/consistent-test-filename": "off",
|
|
934
939
|
"vitest/consistent-test-it": "error",
|
|
@@ -987,7 +992,7 @@ var vitestStrict = mergeRules(import_eslint_plugin.default.configs.recommended,
|
|
|
987
992
|
"vitest/valid-expect-in-promise": "error"
|
|
988
993
|
});
|
|
989
994
|
function vitest(config) {
|
|
990
|
-
return
|
|
995
|
+
return import_typescript_eslint6.default.config({
|
|
991
996
|
extends: [vitestStrict, config],
|
|
992
997
|
files: ["tests/**", "*.test.*"]
|
|
993
998
|
});
|
|
@@ -1087,7 +1092,7 @@ function defineBaseConfig({
|
|
|
1087
1092
|
vitest: vitestOptions = {},
|
|
1088
1093
|
...config
|
|
1089
1094
|
} = {}) {
|
|
1090
|
-
return
|
|
1095
|
+
return import_typescript_eslint7.default.config(
|
|
1091
1096
|
settings ? { settings } : {},
|
|
1092
1097
|
ignores ? { ignores } : {},
|
|
1093
1098
|
jsOptions ? js(jsOptions) : {},
|
|
@@ -1104,15 +1109,16 @@ function defineBaseConfig({
|
|
|
1104
1109
|
|
|
1105
1110
|
// src/react.ts
|
|
1106
1111
|
var import_eslint_plugin_react2 = __toESM(require("eslint-plugin-react"));
|
|
1107
|
-
var
|
|
1112
|
+
var import_typescript_eslint8 = __toESM(require("typescript-eslint"));
|
|
1108
1113
|
function defineReactConfig({
|
|
1109
1114
|
jsxA11y: enabledJsxA11y = true,
|
|
1110
1115
|
jsxRuntime: enabledJsxRuntime = true,
|
|
1111
1116
|
reactHooks: enabledReactHooks = true,
|
|
1112
1117
|
reactRefresh: enabledReactRefresh = true,
|
|
1118
|
+
tailwindcss: enabledTailwindcss = true,
|
|
1113
1119
|
...reactOptions
|
|
1114
1120
|
} = {}) {
|
|
1115
|
-
return
|
|
1121
|
+
return import_typescript_eslint8.default.config(
|
|
1116
1122
|
react({
|
|
1117
1123
|
...reactOptions,
|
|
1118
1124
|
extends: [
|
|
@@ -1120,6 +1126,7 @@ function defineReactConfig({
|
|
|
1120
1126
|
enabledReactHooks ? reactHooksStrict : {},
|
|
1121
1127
|
enabledReactRefresh ? reactRefreshStrict : {},
|
|
1122
1128
|
enabledJsxA11y ? jsxA11yStrict : {},
|
|
1129
|
+
enabledTailwindcss ? tailwindcssStrict : {},
|
|
1123
1130
|
...reactOptions.extends ?? []
|
|
1124
1131
|
]
|
|
1125
1132
|
})
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/base.ts
|
|
2
|
-
import
|
|
2
|
+
import pluginTs7 from "typescript-eslint";
|
|
3
3
|
|
|
4
4
|
// src/configs/eslint-comments.ts
|
|
5
5
|
import pluginEslintComments from "@eslint-community/eslint-plugin-eslint-comments/configs";
|
|
@@ -712,8 +712,13 @@ var reactHooksStrict = mergeRules(
|
|
|
712
712
|
import pluginReactRefresh from "eslint-plugin-react-refresh";
|
|
713
713
|
var reactRefreshStrict = mergeRules(pluginReactRefresh.configs.recommended);
|
|
714
714
|
|
|
715
|
-
// src/configs/
|
|
715
|
+
// src/configs/tailwindcss.ts
|
|
716
|
+
import pluginTailwindcss from "eslint-plugin-tailwindcss";
|
|
716
717
|
import pluginTs4 from "typescript-eslint";
|
|
718
|
+
var tailwindcssStrict = pluginTs4.config(pluginTailwindcss.configs["flat/recommended"]);
|
|
719
|
+
|
|
720
|
+
// src/configs/ts.ts
|
|
721
|
+
import pluginTs5 from "typescript-eslint";
|
|
717
722
|
var jsStrictRules = jsStrict.rules ?? {};
|
|
718
723
|
var tsEslintOverrideRules = mergeRules(
|
|
719
724
|
{},
|
|
@@ -793,14 +798,14 @@ var tsRecommendedOverride = mergeRules(
|
|
|
793
798
|
// confilict with @typescript-eslint/consistent-type-imports
|
|
794
799
|
}
|
|
795
800
|
);
|
|
796
|
-
var tsRecommended =
|
|
797
|
-
|
|
801
|
+
var tsRecommended = pluginTs5.config(
|
|
802
|
+
pluginTs5.configs.recommended,
|
|
798
803
|
tsEslintOverrideRules,
|
|
799
804
|
tsRecommendedOverride
|
|
800
805
|
);
|
|
801
|
-
var tsStrict =
|
|
802
|
-
|
|
803
|
-
|
|
806
|
+
var tsStrict = pluginTs5.config(
|
|
807
|
+
pluginTs5.configs.strictTypeChecked,
|
|
808
|
+
pluginTs5.configs.stylisticTypeChecked,
|
|
804
809
|
tsEslintOverrideRules,
|
|
805
810
|
tsRecommendedOverride,
|
|
806
811
|
{
|
|
@@ -857,7 +862,7 @@ function ts({
|
|
|
857
862
|
strict = true,
|
|
858
863
|
...config
|
|
859
864
|
}) {
|
|
860
|
-
return
|
|
865
|
+
return pluginTs5.config(
|
|
861
866
|
parserOptions ? {
|
|
862
867
|
languageOptions: {
|
|
863
868
|
parserOptions: {
|
|
@@ -869,7 +874,7 @@ function ts({
|
|
|
869
874
|
strict ? tsStrict : tsRecommended,
|
|
870
875
|
config,
|
|
871
876
|
disableTypeChecked ? {
|
|
872
|
-
extends: [
|
|
877
|
+
extends: [pluginTs5.configs.disableTypeChecked],
|
|
873
878
|
files: ["**/*.{js,jsx,mjs,cjs}"]
|
|
874
879
|
} : {}
|
|
875
880
|
);
|
|
@@ -892,7 +897,7 @@ var unusedImportsStrict = mergeRules({
|
|
|
892
897
|
|
|
893
898
|
// src/configs/vitest.ts
|
|
894
899
|
import pluginVitest from "@vitest/eslint-plugin";
|
|
895
|
-
import
|
|
900
|
+
import pluginTs6 from "typescript-eslint";
|
|
896
901
|
var vitestStrict = mergeRules(pluginVitest.configs.recommended, {
|
|
897
902
|
"vitest/consistent-test-filename": "off",
|
|
898
903
|
"vitest/consistent-test-it": "error",
|
|
@@ -951,7 +956,7 @@ var vitestStrict = mergeRules(pluginVitest.configs.recommended, {
|
|
|
951
956
|
"vitest/valid-expect-in-promise": "error"
|
|
952
957
|
});
|
|
953
958
|
function vitest(config) {
|
|
954
|
-
return
|
|
959
|
+
return pluginTs6.config({
|
|
955
960
|
extends: [vitestStrict, config],
|
|
956
961
|
files: ["tests/**", "*.test.*"]
|
|
957
962
|
});
|
|
@@ -1051,7 +1056,7 @@ function defineBaseConfig({
|
|
|
1051
1056
|
vitest: vitestOptions = {},
|
|
1052
1057
|
...config
|
|
1053
1058
|
} = {}) {
|
|
1054
|
-
return
|
|
1059
|
+
return pluginTs7.config(
|
|
1055
1060
|
settings ? { settings } : {},
|
|
1056
1061
|
ignores ? { ignores } : {},
|
|
1057
1062
|
jsOptions ? js(jsOptions) : {},
|
|
@@ -1068,15 +1073,16 @@ function defineBaseConfig({
|
|
|
1068
1073
|
|
|
1069
1074
|
// src/react.ts
|
|
1070
1075
|
import pluginReact2 from "eslint-plugin-react";
|
|
1071
|
-
import
|
|
1076
|
+
import pluginTs8 from "typescript-eslint";
|
|
1072
1077
|
function defineReactConfig({
|
|
1073
1078
|
jsxA11y: enabledJsxA11y = true,
|
|
1074
1079
|
jsxRuntime: enabledJsxRuntime = true,
|
|
1075
1080
|
reactHooks: enabledReactHooks = true,
|
|
1076
1081
|
reactRefresh: enabledReactRefresh = true,
|
|
1082
|
+
tailwindcss: enabledTailwindcss = true,
|
|
1077
1083
|
...reactOptions
|
|
1078
1084
|
} = {}) {
|
|
1079
|
-
return
|
|
1085
|
+
return pluginTs8.config(
|
|
1080
1086
|
react({
|
|
1081
1087
|
...reactOptions,
|
|
1082
1088
|
extends: [
|
|
@@ -1084,6 +1090,7 @@ function defineReactConfig({
|
|
|
1084
1090
|
enabledReactHooks ? reactHooksStrict : {},
|
|
1085
1091
|
enabledReactRefresh ? reactRefreshStrict : {},
|
|
1086
1092
|
enabledJsxA11y ? jsxA11yStrict : {},
|
|
1093
|
+
enabledTailwindcss ? tailwindcssStrict : {},
|
|
1087
1094
|
...reactOptions.extends ?? []
|
|
1088
1095
|
]
|
|
1089
1096
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ofk/eslint-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ofk (https://github.com/ofk/)",
|
|
@@ -41,6 +41,7 @@
|
|
|
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",
|
|
44
45
|
"eslint-plugin-unicorn": "^56.0.0",
|
|
45
46
|
"eslint-plugin-unused-imports": "^4.1.1",
|
|
46
47
|
"globals": ">=14.0.0",
|
|
@@ -77,6 +78,9 @@
|
|
|
77
78
|
"eslint-plugin-react-refresh": {
|
|
78
79
|
"optional": true
|
|
79
80
|
},
|
|
81
|
+
"eslint-plugin-tailwindcss": {
|
|
82
|
+
"optional": true
|
|
83
|
+
},
|
|
80
84
|
"eslint-plugin-unicorn": {
|
|
81
85
|
"optional": true
|
|
82
86
|
},
|
|
@@ -99,6 +103,7 @@
|
|
|
99
103
|
"@types/confusing-browser-globals": "^1.0.3",
|
|
100
104
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
101
105
|
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
|
|
106
|
+
"@types/eslint-plugin-tailwindcss": "^3.17.0",
|
|
102
107
|
"@vitest/eslint-plugin": "^1.1.25",
|
|
103
108
|
"confusing-browser-globals": "^1.0.11",
|
|
104
109
|
"eslint": "^9.19.0",
|
|
@@ -109,6 +114,7 @@
|
|
|
109
114
|
"eslint-plugin-react": "^7.37.4",
|
|
110
115
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
111
116
|
"eslint-plugin-react-refresh": "^0.4.18",
|
|
117
|
+
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
112
118
|
"eslint-plugin-unicorn": "^56.0.1",
|
|
113
119
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
114
120
|
"globals": "^15.15.0",
|