@ofk/eslint-config 0.0.5 → 0.0.7

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 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 import_typescript_eslint6 = __toESM(require("typescript-eslint"));
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"));
@@ -106,8 +106,6 @@ var importsStrict = mergeRules(
106
106
  },
107
107
  // https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#static-analysis
108
108
  {
109
- "import/enforce-node-protocol-usage": "off",
110
- // for node.js
111
109
  "import/no-absolute-path": "error",
112
110
  "import/no-cycle": "error",
113
111
  "import/no-dynamic-require": "error",
@@ -194,7 +192,6 @@ function imports({
194
192
  },
195
193
  node ? {
196
194
  rules: {
197
- "import/enforce-node-protocol-usage": ["error", "always"],
198
195
  "import/no-nodejs-modules": "off"
199
196
  }
200
197
  } : {},
@@ -748,8 +745,13 @@ var reactHooksStrict = mergeRules(
748
745
  var import_eslint_plugin_react_refresh = __toESM(require("eslint-plugin-react-refresh"));
749
746
  var reactRefreshStrict = mergeRules(import_eslint_plugin_react_refresh.default.configs.recommended);
750
747
 
751
- // src/configs/ts.ts
748
+ // src/configs/tailwindcss.ts
749
+ var import_eslint_plugin_tailwindcss = __toESM(require("eslint-plugin-tailwindcss"));
752
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
+ // src/configs/ts.ts
754
+ var import_typescript_eslint5 = __toESM(require("typescript-eslint"));
753
755
  var jsStrictRules = jsStrict.rules ?? {};
754
756
  var tsEslintOverrideRules = mergeRules(
755
757
  {},
@@ -829,14 +831,14 @@ var tsRecommendedOverride = mergeRules(
829
831
  // confilict with @typescript-eslint/consistent-type-imports
830
832
  }
831
833
  );
832
- var tsRecommended = import_typescript_eslint4.default.config(
833
- import_typescript_eslint4.default.configs.recommended,
834
+ var tsRecommended = import_typescript_eslint5.default.config(
835
+ import_typescript_eslint5.default.configs.recommended,
834
836
  tsEslintOverrideRules,
835
837
  tsRecommendedOverride
836
838
  );
837
- var tsStrict = import_typescript_eslint4.default.config(
838
- import_typescript_eslint4.default.configs.strictTypeChecked,
839
- import_typescript_eslint4.default.configs.stylisticTypeChecked,
839
+ var tsStrict = import_typescript_eslint5.default.config(
840
+ import_typescript_eslint5.default.configs.strictTypeChecked,
841
+ import_typescript_eslint5.default.configs.stylisticTypeChecked,
840
842
  tsEslintOverrideRules,
841
843
  tsRecommendedOverride,
842
844
  {
@@ -893,7 +895,7 @@ function ts({
893
895
  strict = true,
894
896
  ...config
895
897
  }) {
896
- return import_typescript_eslint4.default.config(
898
+ return import_typescript_eslint5.default.config(
897
899
  parserOptions ? {
898
900
  languageOptions: {
899
901
  parserOptions: {
@@ -905,7 +907,7 @@ function ts({
905
907
  strict ? tsStrict : tsRecommended,
906
908
  config,
907
909
  disableTypeChecked ? {
908
- extends: [import_typescript_eslint4.default.configs.disableTypeChecked],
910
+ extends: [import_typescript_eslint5.default.configs.disableTypeChecked],
909
911
  files: ["**/*.{js,jsx,mjs,cjs}"]
910
912
  } : {}
911
913
  );
@@ -928,7 +930,7 @@ var unusedImportsStrict = mergeRules({
928
930
 
929
931
  // src/configs/vitest.ts
930
932
  var import_eslint_plugin = __toESM(require("@vitest/eslint-plugin"));
931
- var import_typescript_eslint5 = __toESM(require("typescript-eslint"));
933
+ var import_typescript_eslint6 = __toESM(require("typescript-eslint"));
932
934
  var vitestStrict = mergeRules(import_eslint_plugin.default.configs.recommended, {
933
935
  "vitest/consistent-test-filename": "off",
934
936
  "vitest/consistent-test-it": "error",
@@ -987,7 +989,7 @@ var vitestStrict = mergeRules(import_eslint_plugin.default.configs.recommended,
987
989
  "vitest/valid-expect-in-promise": "error"
988
990
  });
989
991
  function vitest(config) {
990
- return import_typescript_eslint5.default.config({
992
+ return import_typescript_eslint6.default.config({
991
993
  extends: [vitestStrict, config],
992
994
  files: ["tests/**", "*.test.*"]
993
995
  });
@@ -1048,8 +1050,6 @@ var unicornRecommended = mergeRules(
1048
1050
  // not recommended
1049
1051
  "unicorn/prefer-keyboard-event-key": "off",
1050
1052
  // allow keyCode
1051
- "unicorn/prefer-node-protocol": "off",
1052
- // disabled for use import/enforce-node-protocol-usage
1053
1053
  "unicorn/prefer-string-raw": "off",
1054
1054
  // disallow String.raw
1055
1055
  "unicorn/prefer-structured-clone": "off",
@@ -1087,7 +1087,7 @@ function defineBaseConfig({
1087
1087
  vitest: vitestOptions = {},
1088
1088
  ...config
1089
1089
  } = {}) {
1090
- return import_typescript_eslint6.default.config(
1090
+ return import_typescript_eslint7.default.config(
1091
1091
  settings ? { settings } : {},
1092
1092
  ignores ? { ignores } : {},
1093
1093
  jsOptions ? js(jsOptions) : {},
@@ -1104,15 +1104,16 @@ function defineBaseConfig({
1104
1104
 
1105
1105
  // src/react.ts
1106
1106
  var import_eslint_plugin_react2 = __toESM(require("eslint-plugin-react"));
1107
- var import_typescript_eslint7 = __toESM(require("typescript-eslint"));
1107
+ var import_typescript_eslint8 = __toESM(require("typescript-eslint"));
1108
1108
  function defineReactConfig({
1109
1109
  jsxA11y: enabledJsxA11y = true,
1110
1110
  jsxRuntime: enabledJsxRuntime = true,
1111
1111
  reactHooks: enabledReactHooks = true,
1112
1112
  reactRefresh: enabledReactRefresh = true,
1113
+ tailwindcss: enabledTailwindcss = true,
1113
1114
  ...reactOptions
1114
1115
  } = {}) {
1115
- return import_typescript_eslint7.default.config(
1116
+ return import_typescript_eslint8.default.config(
1116
1117
  react({
1117
1118
  ...reactOptions,
1118
1119
  extends: [
@@ -1120,6 +1121,7 @@ function defineReactConfig({
1120
1121
  enabledReactHooks ? reactHooksStrict : {},
1121
1122
  enabledReactRefresh ? reactRefreshStrict : {},
1122
1123
  enabledJsxA11y ? jsxA11yStrict : {},
1124
+ enabledTailwindcss ? tailwindcssStrict : {},
1123
1125
  ...reactOptions.extends ?? []
1124
1126
  ]
1125
1127
  })
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/base.ts
2
- import pluginTs6 from "typescript-eslint";
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";
@@ -70,8 +70,6 @@ var importsStrict = mergeRules(
70
70
  },
71
71
  // https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#static-analysis
72
72
  {
73
- "import/enforce-node-protocol-usage": "off",
74
- // for node.js
75
73
  "import/no-absolute-path": "error",
76
74
  "import/no-cycle": "error",
77
75
  "import/no-dynamic-require": "error",
@@ -158,7 +156,6 @@ function imports({
158
156
  },
159
157
  node ? {
160
158
  rules: {
161
- "import/enforce-node-protocol-usage": ["error", "always"],
162
159
  "import/no-nodejs-modules": "off"
163
160
  }
164
161
  } : {},
@@ -712,8 +709,13 @@ var reactHooksStrict = mergeRules(
712
709
  import pluginReactRefresh from "eslint-plugin-react-refresh";
713
710
  var reactRefreshStrict = mergeRules(pluginReactRefresh.configs.recommended);
714
711
 
715
- // src/configs/ts.ts
712
+ // src/configs/tailwindcss.ts
713
+ import pluginTailwindcss from "eslint-plugin-tailwindcss";
716
714
  import pluginTs4 from "typescript-eslint";
715
+ var tailwindcssStrict = pluginTs4.config(pluginTailwindcss.configs["flat/recommended"]);
716
+
717
+ // src/configs/ts.ts
718
+ import pluginTs5 from "typescript-eslint";
717
719
  var jsStrictRules = jsStrict.rules ?? {};
718
720
  var tsEslintOverrideRules = mergeRules(
719
721
  {},
@@ -793,14 +795,14 @@ var tsRecommendedOverride = mergeRules(
793
795
  // confilict with @typescript-eslint/consistent-type-imports
794
796
  }
795
797
  );
796
- var tsRecommended = pluginTs4.config(
797
- pluginTs4.configs.recommended,
798
+ var tsRecommended = pluginTs5.config(
799
+ pluginTs5.configs.recommended,
798
800
  tsEslintOverrideRules,
799
801
  tsRecommendedOverride
800
802
  );
801
- var tsStrict = pluginTs4.config(
802
- pluginTs4.configs.strictTypeChecked,
803
- pluginTs4.configs.stylisticTypeChecked,
803
+ var tsStrict = pluginTs5.config(
804
+ pluginTs5.configs.strictTypeChecked,
805
+ pluginTs5.configs.stylisticTypeChecked,
804
806
  tsEslintOverrideRules,
805
807
  tsRecommendedOverride,
806
808
  {
@@ -857,7 +859,7 @@ function ts({
857
859
  strict = true,
858
860
  ...config
859
861
  }) {
860
- return pluginTs4.config(
862
+ return pluginTs5.config(
861
863
  parserOptions ? {
862
864
  languageOptions: {
863
865
  parserOptions: {
@@ -869,7 +871,7 @@ function ts({
869
871
  strict ? tsStrict : tsRecommended,
870
872
  config,
871
873
  disableTypeChecked ? {
872
- extends: [pluginTs4.configs.disableTypeChecked],
874
+ extends: [pluginTs5.configs.disableTypeChecked],
873
875
  files: ["**/*.{js,jsx,mjs,cjs}"]
874
876
  } : {}
875
877
  );
@@ -892,7 +894,7 @@ var unusedImportsStrict = mergeRules({
892
894
 
893
895
  // src/configs/vitest.ts
894
896
  import pluginVitest from "@vitest/eslint-plugin";
895
- import pluginTs5 from "typescript-eslint";
897
+ import pluginTs6 from "typescript-eslint";
896
898
  var vitestStrict = mergeRules(pluginVitest.configs.recommended, {
897
899
  "vitest/consistent-test-filename": "off",
898
900
  "vitest/consistent-test-it": "error",
@@ -951,7 +953,7 @@ var vitestStrict = mergeRules(pluginVitest.configs.recommended, {
951
953
  "vitest/valid-expect-in-promise": "error"
952
954
  });
953
955
  function vitest(config) {
954
- return pluginTs5.config({
956
+ return pluginTs6.config({
955
957
  extends: [vitestStrict, config],
956
958
  files: ["tests/**", "*.test.*"]
957
959
  });
@@ -1012,8 +1014,6 @@ var unicornRecommended = mergeRules(
1012
1014
  // not recommended
1013
1015
  "unicorn/prefer-keyboard-event-key": "off",
1014
1016
  // allow keyCode
1015
- "unicorn/prefer-node-protocol": "off",
1016
- // disabled for use import/enforce-node-protocol-usage
1017
1017
  "unicorn/prefer-string-raw": "off",
1018
1018
  // disallow String.raw
1019
1019
  "unicorn/prefer-structured-clone": "off",
@@ -1051,7 +1051,7 @@ function defineBaseConfig({
1051
1051
  vitest: vitestOptions = {},
1052
1052
  ...config
1053
1053
  } = {}) {
1054
- return pluginTs6.config(
1054
+ return pluginTs7.config(
1055
1055
  settings ? { settings } : {},
1056
1056
  ignores ? { ignores } : {},
1057
1057
  jsOptions ? js(jsOptions) : {},
@@ -1068,15 +1068,16 @@ function defineBaseConfig({
1068
1068
 
1069
1069
  // src/react.ts
1070
1070
  import pluginReact2 from "eslint-plugin-react";
1071
- import pluginTs7 from "typescript-eslint";
1071
+ import pluginTs8 from "typescript-eslint";
1072
1072
  function defineReactConfig({
1073
1073
  jsxA11y: enabledJsxA11y = true,
1074
1074
  jsxRuntime: enabledJsxRuntime = true,
1075
1075
  reactHooks: enabledReactHooks = true,
1076
1076
  reactRefresh: enabledReactRefresh = true,
1077
+ tailwindcss: enabledTailwindcss = true,
1077
1078
  ...reactOptions
1078
1079
  } = {}) {
1079
- return pluginTs7.config(
1080
+ return pluginTs8.config(
1080
1081
  react({
1081
1082
  ...reactOptions,
1082
1083
  extends: [
@@ -1084,6 +1085,7 @@ function defineReactConfig({
1084
1085
  enabledReactHooks ? reactHooksStrict : {},
1085
1086
  enabledReactRefresh ? reactRefreshStrict : {},
1086
1087
  enabledJsxA11y ? jsxA11yStrict : {},
1088
+ enabledTailwindcss ? tailwindcssStrict : {},
1087
1089
  ...reactOptions.extends ?? []
1088
1090
  ]
1089
1091
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ofk/eslint-config",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
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",