@cuiqg/eslint-config 2.1.25 → 2.1.27

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 CHANGED
@@ -43,6 +43,7 @@ __export(index_exports, {
43
43
  GLOB_SRC: () => GLOB_SRC,
44
44
  GLOB_SRC_EXT: () => GLOB_SRC_EXT,
45
45
  GLOB_STYLE: () => GLOB_STYLE,
46
+ GLOB_TOML: () => GLOB_TOML,
46
47
  GLOB_VUE: () => GLOB_VUE,
47
48
  GLOB_XML: () => GLOB_XML,
48
49
  GLOB_YAML: () => GLOB_YAML,
@@ -53,6 +54,7 @@ __export(index_exports, {
53
54
  defaultPluginRenaming: () => defaultPluginRenaming,
54
55
  disables: () => disables,
55
56
  gitignore: () => gitignore,
57
+ hasTailwindcss: () => hasTailwindcss,
56
58
  hasUnocss: () => hasUnocss,
57
59
  hasVue: () => hasVue,
58
60
  ignores: () => ignores,
@@ -68,6 +70,8 @@ __export(index_exports, {
68
70
  sortJsconfig: () => sortJsconfig,
69
71
  sortPackageJson: () => sortPackageJson,
70
72
  stylistic: () => stylistic,
73
+ tailwindcss: () => tailwindcss,
74
+ toml: () => toml,
71
75
  unicorn: () => unicorn,
72
76
  unocss: () => unocss,
73
77
  vue: () => vue,
@@ -119,6 +123,7 @@ var GLOB_VUE = "**/*.vue";
119
123
  var GLOB_YAML = "**/*.y?(a)ml";
120
124
  var GLOB_XML = "**/*.xml";
121
125
  var GLOB_HTML = "**/*.htm?(l)";
126
+ var GLOB_TOML = "**/*.toml";
122
127
  var GLOB_EXCLUDE = [
123
128
  "**/node_modules",
124
129
  "**/dist",
@@ -195,11 +200,13 @@ var import_local_pkg = require("local-pkg");
195
200
  var isInEditor = !!((import_node_process.default.env.VSCODE_PID || import_node_process.default.env.VSCODE_CWD || import_node_process.default.env.JETBRAINS_IDE || import_node_process.default.env.VIM) && !import_node_process.default.env.CI);
196
201
  var hasVue = (0, import_local_pkg.isPackageExists)("vue") || (0, import_local_pkg.isPackageExists)("nuxt") || (0, import_local_pkg.isPackageExists)("vitepress") || (0, import_local_pkg.isPackageExists)("@slidev/cli");
197
202
  var hasUnocss = (0, import_local_pkg.isPackageExists)("unocss") || (0, import_local_pkg.isPackageExists)("@unocss/webpack") || (0, import_local_pkg.isPackageExists)("@unocss/nuxt");
203
+ var hasTailwindcss = (0, import_local_pkg.isPackageExists)("tailwindcss");
198
204
 
199
205
  // src/configs/javascript.js
200
206
  async function javascript() {
201
207
  return [
202
208
  {
209
+ name: "cuiqg/javascript",
203
210
  languageOptions: {
204
211
  ecmaVersion: 2022,
205
212
  globals: {
@@ -222,7 +229,6 @@ async function javascript() {
222
229
  linterOptions: {
223
230
  reportUnusedDisableDirectives: true
224
231
  },
225
- name: "cuiqg/javascript",
226
232
  rules: {
227
233
  "accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
228
234
  "array-callback-return": "error",
@@ -380,14 +386,16 @@ async function javascript() {
380
386
  // src/configs/jsdoc.js
381
387
  async function jsdoc() {
382
388
  const pluginJsdoc = await interopDefault(import("eslint-plugin-jsdoc"));
389
+ const files = [GLOB_JS];
383
390
  return [
384
391
  {
392
+ files,
385
393
  name: "cuiqg/jsdoc",
386
394
  plugins: {
387
395
  jsdoc: pluginJsdoc
388
396
  },
389
397
  rules: {
390
- ...pluginJsdoc.configs.recommended.rules
398
+ ...pluginJsdoc.configs["flat/recommended"].rules
391
399
  }
392
400
  }
393
401
  ];
@@ -489,10 +497,9 @@ async function macros() {
489
497
 
490
498
  // src/configs/prettier.js
491
499
  async function prettier() {
492
- const [pluginJsonc, pluginPrettier, configPrettier] = await Promise.all([
500
+ const [pluginJsonc, pluginPrettier] = await Promise.all([
493
501
  interopDefault(import("eslint-plugin-jsonc")),
494
- interopDefault(import("eslint-plugin-prettier")),
495
- interopDefault(import("eslint-config-prettier"))
502
+ interopDefault(import("eslint-plugin-prettier"))
496
503
  ]);
497
504
  return [
498
505
  {
@@ -501,7 +508,6 @@ async function prettier() {
501
508
  prettier: pluginPrettier
502
509
  },
503
510
  rules: {
504
- ...configPrettier.rules,
505
511
  ...pluginPrettier.configs.recommended.rules,
506
512
  ...pluginJsonc.configs.prettier.rules,
507
513
  "prettier/prettier": "warn"
@@ -994,15 +1000,8 @@ async function yaml() {
994
1000
  parser: parserYaml
995
1001
  },
996
1002
  rules: {
997
- ...pluginYaml.configs.standard.rules,
998
- ...pluginYaml.configs.prettier.rules,
999
- "yaml/block-mapping": "error",
1000
- "yaml/block-sequence": "error",
1001
- "yaml/no-empty-key": "error",
1002
- "yaml/no-empty-sequence-entry": "error",
1003
- "yaml/no-irregular-whitespace": "error",
1004
- "yaml/plain-scalar": "error",
1005
- "yaml/vue-custom-block/no-parsing-error": "error"
1003
+ ...pluginYaml.configs.recommended.rules,
1004
+ ...pluginYaml.configs.prettier.rules
1006
1005
  }
1007
1006
  }
1008
1007
  ];
@@ -1032,6 +1031,46 @@ async function disables() {
1032
1031
  ];
1033
1032
  }
1034
1033
 
1034
+ // src/configs/toml.js
1035
+ async function toml() {
1036
+ const files = [GLOB_TOML];
1037
+ const [pluginToml, parserToml] = await Promise.all([
1038
+ interopDefault(import("eslint-plugin-toml")),
1039
+ interopDefault(import("toml-eslint-parser"))
1040
+ ]);
1041
+ return [
1042
+ {
1043
+ name: "cuiqg/toml",
1044
+ files,
1045
+ plugins: {
1046
+ toml: pluginToml
1047
+ },
1048
+ languageOptions: {
1049
+ parser: parserToml
1050
+ },
1051
+ rules: {
1052
+ ...pluginToml.configs.recommended.rules
1053
+ }
1054
+ }
1055
+ ];
1056
+ }
1057
+
1058
+ // src/configs/tailwindcss.js
1059
+ async function tailwindcss() {
1060
+ const pluginTailwindcss = await interopDefault(import("eslint-plugin-tailwindcss"));
1061
+ return [
1062
+ {
1063
+ name: "cuiqg/tailwindcss",
1064
+ plugins: {
1065
+ tailwindcss: pluginTailwindcss
1066
+ },
1067
+ rules: {
1068
+ ...pluginTailwindcss.configs.recommended.rules
1069
+ }
1070
+ }
1071
+ ];
1072
+ }
1073
+
1035
1074
  // src/presets.js
1036
1075
  var defaultPluginRenaming = {
1037
1076
  "@stylistic": "style",
@@ -1044,6 +1083,7 @@ function cuiqg(options = {}, ...userConfigs) {
1044
1083
  prettier: enablePrettier = false,
1045
1084
  gitignore: enableGitignore = true,
1046
1085
  unocss: enableUnocss = hasUnocss,
1086
+ tailwindcss: enableTailwindcss = hasTailwindcss,
1047
1087
  vue: enableVue = hasVue,
1048
1088
  stylistic: enableStylistic = true,
1049
1089
  jsdoc: enableJsdoc = false
@@ -1062,6 +1102,7 @@ function cuiqg(options = {}, ...userConfigs) {
1062
1102
  sortPackageJson(),
1063
1103
  sortJsconfig(),
1064
1104
  yaml(),
1105
+ toml(),
1065
1106
  disables()
1066
1107
  );
1067
1108
  if (enableGitignore) {
@@ -1084,6 +1125,11 @@ function cuiqg(options = {}, ...userConfigs) {
1084
1125
  unocss()
1085
1126
  );
1086
1127
  }
1128
+ if (enableTailwindcss) {
1129
+ configs.push(
1130
+ tailwindcss()
1131
+ );
1132
+ }
1087
1133
  if (enablePrettier) {
1088
1134
  configs.push(
1089
1135
  prettier()
@@ -1115,6 +1161,7 @@ var index_default = cuiqg;
1115
1161
  GLOB_SRC,
1116
1162
  GLOB_SRC_EXT,
1117
1163
  GLOB_STYLE,
1164
+ GLOB_TOML,
1118
1165
  GLOB_VUE,
1119
1166
  GLOB_XML,
1120
1167
  GLOB_YAML,
@@ -1124,6 +1171,7 @@ var index_default = cuiqg;
1124
1171
  defaultPluginRenaming,
1125
1172
  disables,
1126
1173
  gitignore,
1174
+ hasTailwindcss,
1127
1175
  hasUnocss,
1128
1176
  hasVue,
1129
1177
  ignores,
@@ -1139,6 +1187,8 @@ var index_default = cuiqg;
1139
1187
  sortJsconfig,
1140
1188
  sortPackageJson,
1141
1189
  stylistic,
1190
+ tailwindcss,
1191
+ toml,
1142
1192
  unicorn,
1143
1193
  unocss,
1144
1194
  vue,
package/dist/index.js CHANGED
@@ -42,6 +42,7 @@ var GLOB_VUE = "**/*.vue";
42
42
  var GLOB_YAML = "**/*.y?(a)ml";
43
43
  var GLOB_XML = "**/*.xml";
44
44
  var GLOB_HTML = "**/*.htm?(l)";
45
+ var GLOB_TOML = "**/*.toml";
45
46
  var GLOB_EXCLUDE = [
46
47
  "**/node_modules",
47
48
  "**/dist",
@@ -118,11 +119,13 @@ import { isPackageExists } from "local-pkg";
118
119
  var isInEditor = !!((process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM) && !process.env.CI);
119
120
  var hasVue = isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("@slidev/cli");
120
121
  var hasUnocss = isPackageExists("unocss") || isPackageExists("@unocss/webpack") || isPackageExists("@unocss/nuxt");
122
+ var hasTailwindcss = isPackageExists("tailwindcss");
121
123
 
122
124
  // src/configs/javascript.js
123
125
  async function javascript() {
124
126
  return [
125
127
  {
128
+ name: "cuiqg/javascript",
126
129
  languageOptions: {
127
130
  ecmaVersion: 2022,
128
131
  globals: {
@@ -145,7 +148,6 @@ async function javascript() {
145
148
  linterOptions: {
146
149
  reportUnusedDisableDirectives: true
147
150
  },
148
- name: "cuiqg/javascript",
149
151
  rules: {
150
152
  "accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
151
153
  "array-callback-return": "error",
@@ -303,14 +305,16 @@ async function javascript() {
303
305
  // src/configs/jsdoc.js
304
306
  async function jsdoc() {
305
307
  const pluginJsdoc = await interopDefault(import("eslint-plugin-jsdoc"));
308
+ const files = [GLOB_JS];
306
309
  return [
307
310
  {
311
+ files,
308
312
  name: "cuiqg/jsdoc",
309
313
  plugins: {
310
314
  jsdoc: pluginJsdoc
311
315
  },
312
316
  rules: {
313
- ...pluginJsdoc.configs.recommended.rules
317
+ ...pluginJsdoc.configs["flat/recommended"].rules
314
318
  }
315
319
  }
316
320
  ];
@@ -412,10 +416,9 @@ async function macros() {
412
416
 
413
417
  // src/configs/prettier.js
414
418
  async function prettier() {
415
- const [pluginJsonc, pluginPrettier, configPrettier] = await Promise.all([
419
+ const [pluginJsonc, pluginPrettier] = await Promise.all([
416
420
  interopDefault(import("eslint-plugin-jsonc")),
417
- interopDefault(import("eslint-plugin-prettier")),
418
- interopDefault(import("eslint-config-prettier"))
421
+ interopDefault(import("eslint-plugin-prettier"))
419
422
  ]);
420
423
  return [
421
424
  {
@@ -424,7 +427,6 @@ async function prettier() {
424
427
  prettier: pluginPrettier
425
428
  },
426
429
  rules: {
427
- ...configPrettier.rules,
428
430
  ...pluginPrettier.configs.recommended.rules,
429
431
  ...pluginJsonc.configs.prettier.rules,
430
432
  "prettier/prettier": "warn"
@@ -917,15 +919,8 @@ async function yaml() {
917
919
  parser: parserYaml
918
920
  },
919
921
  rules: {
920
- ...pluginYaml.configs.standard.rules,
921
- ...pluginYaml.configs.prettier.rules,
922
- "yaml/block-mapping": "error",
923
- "yaml/block-sequence": "error",
924
- "yaml/no-empty-key": "error",
925
- "yaml/no-empty-sequence-entry": "error",
926
- "yaml/no-irregular-whitespace": "error",
927
- "yaml/plain-scalar": "error",
928
- "yaml/vue-custom-block/no-parsing-error": "error"
922
+ ...pluginYaml.configs.recommended.rules,
923
+ ...pluginYaml.configs.prettier.rules
929
924
  }
930
925
  }
931
926
  ];
@@ -955,6 +950,46 @@ async function disables() {
955
950
  ];
956
951
  }
957
952
 
953
+ // src/configs/toml.js
954
+ async function toml() {
955
+ const files = [GLOB_TOML];
956
+ const [pluginToml, parserToml] = await Promise.all([
957
+ interopDefault(import("eslint-plugin-toml")),
958
+ interopDefault(import("toml-eslint-parser"))
959
+ ]);
960
+ return [
961
+ {
962
+ name: "cuiqg/toml",
963
+ files,
964
+ plugins: {
965
+ toml: pluginToml
966
+ },
967
+ languageOptions: {
968
+ parser: parserToml
969
+ },
970
+ rules: {
971
+ ...pluginToml.configs.recommended.rules
972
+ }
973
+ }
974
+ ];
975
+ }
976
+
977
+ // src/configs/tailwindcss.js
978
+ async function tailwindcss() {
979
+ const pluginTailwindcss = await interopDefault(import("eslint-plugin-tailwindcss"));
980
+ return [
981
+ {
982
+ name: "cuiqg/tailwindcss",
983
+ plugins: {
984
+ tailwindcss: pluginTailwindcss
985
+ },
986
+ rules: {
987
+ ...pluginTailwindcss.configs.recommended.rules
988
+ }
989
+ }
990
+ ];
991
+ }
992
+
958
993
  // src/presets.js
959
994
  var defaultPluginRenaming = {
960
995
  "@stylistic": "style",
@@ -967,6 +1002,7 @@ function cuiqg(options = {}, ...userConfigs) {
967
1002
  prettier: enablePrettier = false,
968
1003
  gitignore: enableGitignore = true,
969
1004
  unocss: enableUnocss = hasUnocss,
1005
+ tailwindcss: enableTailwindcss = hasTailwindcss,
970
1006
  vue: enableVue = hasVue,
971
1007
  stylistic: enableStylistic = true,
972
1008
  jsdoc: enableJsdoc = false
@@ -985,6 +1021,7 @@ function cuiqg(options = {}, ...userConfigs) {
985
1021
  sortPackageJson(),
986
1022
  sortJsconfig(),
987
1023
  yaml(),
1024
+ toml(),
988
1025
  disables()
989
1026
  );
990
1027
  if (enableGitignore) {
@@ -1007,6 +1044,11 @@ function cuiqg(options = {}, ...userConfigs) {
1007
1044
  unocss()
1008
1045
  );
1009
1046
  }
1047
+ if (enableTailwindcss) {
1048
+ configs.push(
1049
+ tailwindcss()
1050
+ );
1051
+ }
1010
1052
  if (enablePrettier) {
1011
1053
  configs.push(
1012
1054
  prettier()
@@ -1037,6 +1079,7 @@ export {
1037
1079
  GLOB_SRC,
1038
1080
  GLOB_SRC_EXT,
1039
1081
  GLOB_STYLE,
1082
+ GLOB_TOML,
1040
1083
  GLOB_VUE,
1041
1084
  GLOB_XML,
1042
1085
  GLOB_YAML,
@@ -1047,6 +1090,7 @@ export {
1047
1090
  defaultPluginRenaming,
1048
1091
  disables,
1049
1092
  gitignore,
1093
+ hasTailwindcss,
1050
1094
  hasUnocss,
1051
1095
  hasVue,
1052
1096
  ignores,
@@ -1062,6 +1106,8 @@ export {
1062
1106
  sortJsconfig,
1063
1107
  sortPackageJson,
1064
1108
  stylistic,
1109
+ tailwindcss,
1110
+ toml,
1065
1111
  unicorn,
1066
1112
  unocss,
1067
1113
  vue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuiqg/eslint-config",
3
- "version": "2.1.25",
3
+ "version": "2.1.27",
4
4
  "description": "ESLint config preset for @cuiqg",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -37,7 +37,6 @@
37
37
  "@stylistic/eslint-plugin": "^2.9.0",
38
38
  "@unocss/eslint-plugin": "^66.0.0",
39
39
  "eslint-config-flat-gitignore": "^0.3.0",
40
- "eslint-config-prettier": "^9.1.0",
41
40
  "eslint-flat-config-utils": "^0.4.0",
42
41
  "eslint-plugin-eslint-comments": "^3.2.0",
43
42
  "eslint-plugin-import-x": "^4.3.1",
@@ -45,12 +44,15 @@
45
44
  "eslint-plugin-jsonc": "^2.16.0",
46
45
  "eslint-plugin-n": "^17.11.1",
47
46
  "eslint-plugin-prettier": "^5.2.1",
47
+ "eslint-plugin-tailwindcss": "^3.18.0",
48
+ "eslint-plugin-toml": "^0.12.0",
48
49
  "eslint-plugin-unicorn": "^56.0.0",
49
50
  "eslint-plugin-vue": "^9.29.1",
50
51
  "eslint-plugin-yml": "^1.14.0",
51
52
  "globals": "^15.11.0",
52
53
  "jsonc-eslint-parser": "^2.4.0",
53
54
  "local-pkg": "^0.5.0",
55
+ "toml-eslint-parser": "^0.10.0",
54
56
  "unconfig": "^0.6.0",
55
57
  "vue-eslint-parser": "^9.4.3",
56
58
  "yaml-eslint-parser": "^1.2.3"