@ntnyq/eslint-config 2.8.1 → 2.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 CHANGED
@@ -49,6 +49,7 @@ __export(src_exports, {
49
49
  GLOB_SRC: () => GLOB_SRC,
50
50
  GLOB_SRC_EXT: () => GLOB_SRC_EXT,
51
51
  GLOB_STYLE: () => GLOB_STYLE,
52
+ GLOB_TEST: () => GLOB_TEST,
52
53
  GLOB_TOML: () => GLOB_TOML,
53
54
  GLOB_TS: () => GLOB_TS,
54
55
  GLOB_TSX: () => GLOB_TSX,
@@ -60,6 +61,7 @@ __export(src_exports, {
60
61
  getVueVersion: () => getVueVersion,
61
62
  hasTypeScript: () => hasTypeScript,
62
63
  hasUnoCSS: () => hasUnoCSS,
64
+ hasVitest: () => hasVitest,
63
65
  hasVue: () => hasVue,
64
66
  ignores: () => ignores,
65
67
  imports: () => imports,
@@ -90,6 +92,7 @@ __export(src_exports, {
90
92
  pluginUnicorn: () => import_eslint_plugin_unicorn.default,
91
93
  pluginUnoCSS: () => import_eslint_plugin.default,
92
94
  pluginUnusedImports: () => import_eslint_plugin_unused_imports.default,
95
+ pluginVitest: () => import_eslint_plugin2.default,
93
96
  pluginVue: () => import_eslint_plugin_vue.default,
94
97
  pluginYaml: () => import_eslint_plugin_yml.default,
95
98
  prettier: () => prettier,
@@ -103,6 +106,7 @@ __export(src_exports, {
103
106
  unicorn: () => unicorn,
104
107
  unocss: () => unocss,
105
108
  unusedImports: () => unusedImports,
109
+ vitest: () => vitest,
106
110
  vue: () => vue,
107
111
  yml: () => yml
108
112
  });
@@ -113,6 +117,7 @@ var import_node_process = __toESM(require("process"), 1);
113
117
  var import_node_path = require("path");
114
118
  var import_local_pkg = require("local-pkg");
115
119
  var hasTypeScript = (0, import_local_pkg.isPackageExists)("typescript");
120
+ var hasVitest = (0, import_local_pkg.isPackageExists)("vitest");
116
121
  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") || (0, import_local_pkg.isPackageExists)("vue", {
117
122
  paths: [(0, import_node_path.resolve)(import_node_process.default.cwd(), "playground")]
118
123
  });
@@ -146,6 +151,7 @@ var GLOB_JSX = "**/*.?([cm])jsx";
146
151
  var GLOB_TS = "**/*.?([cm])ts";
147
152
  var GLOB_TSX = "**/*.?([cm])tsx";
148
153
  var GLOB_DTS = "**/*.d.?([cm])ts";
154
+ var GLOB_TEST = "**/*.{test,spec}.?([cm])[jt]s?(x)";
149
155
  var GLOB_STYLE = "**/*.{c,le,sc}ss";
150
156
  var GLOB_CSS = "**/*.css";
151
157
  var GLOB_LESS = "**/*.less";
@@ -241,12 +247,13 @@ var import_eslint_plugin_toml = __toESM(require("eslint-plugin-toml"), 1);
241
247
  var import_eslint_plugin_jsonc = __toESM(require("eslint-plugin-jsonc"), 1);
242
248
  var import_eslint_plugin_jsdoc = __toESM(require("eslint-plugin-jsdoc"), 1);
243
249
  var import_eslint_plugin = __toESM(require("@unocss/eslint-plugin"), 1);
250
+ var import_eslint_plugin2 = __toESM(require("@vitest/eslint-plugin"), 1);
244
251
  var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
245
252
  var import_eslint_plugin_import_x = __toESM(require("eslint-plugin-import-x"), 1);
246
253
  var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
247
254
  var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
248
255
  var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
249
- var import_eslint_plugin_unused_imports = __toESM(require("@antfu/eslint-plugin-unused-imports"), 1);
256
+ var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
250
257
  var import_eslint_plugin_eslint_comments = __toESM(require("@eslint-community/eslint-plugin-eslint-comments"), 1);
251
258
  var parserToml = __toESM(require("toml-eslint-parser"), 1);
252
259
  var parserYaml = __toESM(require("yaml-eslint-parser"), 1);
@@ -894,6 +901,288 @@ var unocss = defineConfig([
894
901
  var import_config = __toESM(require("eslint-plugin-command/config"), 1);
895
902
  var command = defineConfig([(0, import_config.default)()]);
896
903
 
904
+ // src/configs/vitest.ts
905
+ var vitest = defineConfig([
906
+ {
907
+ name: "ntnyq/test",
908
+ plugins: {
909
+ vitest: import_eslint_plugin2.default
910
+ },
911
+ files: [GLOB_TEST],
912
+ rules: {
913
+ ...import_eslint_plugin2.default.configs.recommended.rules
914
+ }
915
+ }
916
+ ]);
917
+
918
+ // src/configs/vue.ts
919
+ var import_node_process2 = __toESM(require("process"), 1);
920
+ var import_local_pkg2 = require("local-pkg");
921
+ function getVueVersion() {
922
+ const pkg = (0, import_local_pkg2.getPackageInfoSync)("vue", { paths: [import_node_process2.default.cwd()] });
923
+ if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) {
924
+ return +pkg.version[0];
925
+ }
926
+ return 3;
927
+ }
928
+ var isVue3 = getVueVersion() === 3;
929
+ var vue2Rules = {
930
+ ...import_eslint_plugin_vue.default.configs.base.rules,
931
+ ...import_eslint_plugin_vue.default.configs.essential.rules,
932
+ ...import_eslint_plugin_vue.default.configs["strongly-recommended"].rules,
933
+ ...import_eslint_plugin_vue.default.configs.recommended.rules
934
+ };
935
+ var vue3Rules = {
936
+ ...import_eslint_plugin_vue.default.configs.base.rules,
937
+ ...import_eslint_plugin_vue.default.configs["vue3-essential"].rules,
938
+ ...import_eslint_plugin_vue.default.configs["vue3-strongly-recommended"].rules,
939
+ ...import_eslint_plugin_vue.default.configs["vue3-recommended"].rules
940
+ };
941
+ var vue = defineConfig([
942
+ ...import_typescript_eslint.default.config({
943
+ name: "ntnyq/vue/ts",
944
+ files: [GLOB_VUE],
945
+ // TODO: Remove this when `typescript-eslint` is aligned with `eslint`
946
+ // @ts-expect-error - `typescript-eslint` is not aligned with eslint
947
+ extends: typescriptCore
948
+ }),
949
+ {
950
+ name: "ntnyq/vue/core",
951
+ files: [GLOB_VUE],
952
+ plugins: {
953
+ vue: import_eslint_plugin_vue.default,
954
+ "@typescript-eslint": import_typescript_eslint.default.plugin
955
+ },
956
+ languageOptions: {
957
+ parser: parserVue,
958
+ parserOptions: {
959
+ parser: "@typescript-eslint/parser",
960
+ sourceType: "module",
961
+ extraFileExtensions: [".vue"],
962
+ ecmaFeatures: {
963
+ jsx: true
964
+ }
965
+ }
966
+ },
967
+ processor: import_eslint_plugin_vue.default.processors[".vue"],
968
+ rules: {
969
+ ...isVue3 ? vue3Rules : vue2Rules,
970
+ // OFF
971
+ "vue/no-v-html": "off",
972
+ "vue/require-prop-types": "off",
973
+ "vue/require-default-prop": "off",
974
+ "vue/multi-word-component-names": "off",
975
+ "vue/no-setup-props-reactivity-loss": "off",
976
+ "vue/html-self-closing": [
977
+ "error",
978
+ {
979
+ html: {
980
+ void: "always",
981
+ normal: "always",
982
+ component: "always"
983
+ },
984
+ svg: "always",
985
+ math: "always"
986
+ }
987
+ ],
988
+ "vue/block-tag-newline": [
989
+ "error",
990
+ {
991
+ singleline: "always",
992
+ multiline: "always"
993
+ }
994
+ ],
995
+ "vue/component-name-in-template-casing": [
996
+ "error",
997
+ "PascalCase",
998
+ {
999
+ // Force auto-import components to be PascalCase
1000
+ registeredComponentsOnly: false,
1001
+ ignores: ["slot", "component"]
1002
+ }
1003
+ ],
1004
+ "vue/component-options-name-casing": ["error", "PascalCase"],
1005
+ "vue/custom-event-name-casing": ["error", "camelCase"],
1006
+ "vue/define-macros-order": [
1007
+ "error",
1008
+ {
1009
+ order: ["defineProps", "defineEmits", "defineOptions", "defineSlots"]
1010
+ }
1011
+ ],
1012
+ "vue/html-comment-content-spacing": [
1013
+ "error",
1014
+ "always",
1015
+ {
1016
+ exceptions: ["-"]
1017
+ }
1018
+ ],
1019
+ "vue/array-bracket-spacing": ["error", "never"],
1020
+ "vue/arrow-spacing": ["error", { before: true, after: true }],
1021
+ "vue/block-spacing": ["error", "always"],
1022
+ "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
1023
+ "vue/comma-dangle": ["error", "always-multiline"],
1024
+ "vue/comma-spacing": ["error", { before: false, after: true }],
1025
+ "vue/comma-style": ["error", "last"],
1026
+ "vue/dot-location": ["error", "property"],
1027
+ "vue/dot-notation": ["error", { allowKeywords: true }],
1028
+ "vue/eqeqeq": ["error", "smart"],
1029
+ "vue/key-spacing": ["error", { beforeColon: false, afterColon: true }],
1030
+ "vue/keyword-spacing": ["error", { before: true, after: true }],
1031
+ "vue/no-empty-pattern": "error",
1032
+ "vue/no-loss-of-precision": "error",
1033
+ "vue/no-irregular-whitespace": "error",
1034
+ "vue/no-use-v-else-with-v-for": "error",
1035
+ "vue/require-typed-object-prop": "error",
1036
+ "vue/no-extra-parens": ["error", "functions"],
1037
+ "vue/no-restricted-syntax": [
1038
+ "error",
1039
+ "DebuggerStatement",
1040
+ "LabeledStatement",
1041
+ "WithStatement"
1042
+ ],
1043
+ "vue/no-sparse-arrays": "error",
1044
+ "vue/no-deprecated-model-definition": [
1045
+ "error",
1046
+ {
1047
+ allowVue3Compat: true
1048
+ }
1049
+ ],
1050
+ "vue/object-curly-newline": [
1051
+ "error",
1052
+ {
1053
+ multiline: true,
1054
+ consistent: true
1055
+ }
1056
+ ],
1057
+ "vue/no-static-inline-styles": [
1058
+ "error",
1059
+ {
1060
+ allowBinding: true
1061
+ }
1062
+ ],
1063
+ "vue/object-curly-spacing": ["error", "always"],
1064
+ "vue/object-property-newline": [
1065
+ "error",
1066
+ {
1067
+ allowMultiplePropertiesPerLine: true
1068
+ }
1069
+ ],
1070
+ "vue/object-shorthand": [
1071
+ "error",
1072
+ "always",
1073
+ {
1074
+ ignoreConstructors: false,
1075
+ avoidQuotes: true
1076
+ }
1077
+ ],
1078
+ "vue/operator-linebreak": ["error", "before"],
1079
+ "vue/prefer-template": "error",
1080
+ "vue/prop-name-casing": ["error", "camelCase"],
1081
+ "vue/quote-props": ["error", "consistent-as-needed"],
1082
+ "vue/space-in-parens": ["error", "never"],
1083
+ "vue/space-infix-ops": "error",
1084
+ "vue/space-unary-ops": [
1085
+ "error",
1086
+ {
1087
+ words: true,
1088
+ nonwords: false
1089
+ }
1090
+ ],
1091
+ "vue/template-curly-spacing": "error",
1092
+ "vue/block-order": [
1093
+ "error",
1094
+ {
1095
+ order: ["script", "template", "style"]
1096
+ }
1097
+ ],
1098
+ "vue/attributes-order": [
1099
+ "error",
1100
+ {
1101
+ order: [
1102
+ "EVENTS",
1103
+ // `@click="functionCall"`, `v-on="event"`
1104
+ "TWO_WAY_BINDING",
1105
+ // `v-model`
1106
+ "OTHER_DIRECTIVES",
1107
+ // `v-custom-directive`
1108
+ "LIST_RENDERING",
1109
+ // `v-for item in items`
1110
+ "CONDITIONALS",
1111
+ // `v-if`, `v-show`, `v-cloak`
1112
+ "CONTENT",
1113
+ // `v-text`, `v-html`
1114
+ "SLOT",
1115
+ // `v-slot`, `slot`
1116
+ "UNIQUE",
1117
+ // `ref`, `key`
1118
+ "DEFINITION",
1119
+ // `is`, `v-is`
1120
+ "ATTR_DYNAMIC",
1121
+ // `v-bind:prop="foo"`, `:prop="foo"`
1122
+ // `OTHER_ATTR`, // `custom-prop="foo"`, `:prop="foo"`, `disabled`
1123
+ "RENDER_MODIFIERS",
1124
+ // `v-once`, `v-pre`
1125
+ "GLOBAL",
1126
+ // `id`
1127
+ "ATTR_STATIC",
1128
+ // `prop="foo", `static attributes
1129
+ "ATTR_SHORTHAND_BOOL"
1130
+ // `disabled`, prop shorthand
1131
+ ],
1132
+ alphabetical: false
1133
+ }
1134
+ ],
1135
+ "vue/order-in-components": [
1136
+ "error",
1137
+ {
1138
+ order: [
1139
+ "el",
1140
+ "name",
1141
+ "key",
1142
+ "parent",
1143
+ "functional",
1144
+ ["provide", "inject"],
1145
+ ["delimiters", "comments"],
1146
+ ["components", "directives", "filters"],
1147
+ "extends",
1148
+ "mixins",
1149
+ "layout",
1150
+ "middleware",
1151
+ "validate",
1152
+ "scrollToTop",
1153
+ "transition",
1154
+ "loading",
1155
+ "inheritAttrs",
1156
+ "model",
1157
+ ["props", "propsData"],
1158
+ "emits",
1159
+ "setup",
1160
+ "asyncData",
1161
+ "computed",
1162
+ "data",
1163
+ "fetch",
1164
+ "head",
1165
+ "methods",
1166
+ ["template", "render"],
1167
+ "watch",
1168
+ "watchQuery",
1169
+ "LIFECYCLE_HOOKS",
1170
+ "renderError",
1171
+ "ROUTER_GUARDS"
1172
+ ]
1173
+ }
1174
+ ],
1175
+ "vue/max-attributes-per-line": [
1176
+ "error",
1177
+ {
1178
+ singleline: 1,
1179
+ multiline: 1
1180
+ }
1181
+ ]
1182
+ }
1183
+ }
1184
+ ]);
1185
+
897
1186
  // src/configs/yml.ts
898
1187
  var yml = defineConfig([
899
1188
  {
@@ -1168,347 +1457,80 @@ var sortTsConfig = defineConfig([
1168
1457
 
1169
1458
  // src/configs/jsonc.ts
1170
1459
  var jsonc = defineConfig([
1171
- {
1172
- name: "ntnyq/jsonc",
1173
- files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
1174
- plugins: {
1175
- jsonc: import_eslint_plugin_jsonc.default
1176
- },
1177
- languageOptions: {
1178
- parser: parserJsonc
1179
- },
1180
- rules: {
1181
- ...import_eslint_plugin_jsonc.default.configs["recommended-with-jsonc"].rules,
1182
- "jsonc/array-bracket-spacing": ["error", "never"],
1183
- "jsonc/comma-dangle": ["error", "never"],
1184
- "jsonc/comma-style": ["error", "last"],
1185
- "jsonc/indent": ["error", 2],
1186
- "jsonc/key-spacing": [
1187
- "error",
1188
- {
1189
- beforeColon: false,
1190
- afterColon: true
1191
- }
1192
- ],
1193
- "jsonc/no-octal-escape": "error",
1194
- "jsonc/object-curly-newline": [
1195
- "error",
1196
- {
1197
- multiline: true,
1198
- consistent: true
1199
- }
1200
- ],
1201
- "jsonc/object-curly-spacing": ["error", "always"],
1202
- "jsonc/object-property-newline": [
1203
- "error",
1204
- {
1205
- allowMultiplePropertiesPerLine: true
1206
- }
1207
- ]
1208
- }
1209
- }
1210
- ]);
1211
-
1212
- // src/configs/markdown.ts
1213
- var markdown = defineConfig([
1214
- ...import_eslint_plugin_markdown.default.configs.recommended,
1215
- {
1216
- name: "ntnyq/markdown/extensions",
1217
- files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
1218
- rules: {
1219
- "no-undef": "off",
1220
- "no-alert": "off",
1221
- "no-console": "off",
1222
- "no-unused-vars": "off",
1223
- "no-unused-expressions": "off",
1224
- "no-restricted-imports": "off",
1225
- "node/prefer-global/buffer": "off",
1226
- "node/prefer-global/process": "off",
1227
- "import/no-unresolved": "off",
1228
- "unused-imports/no-unused-imports": "off",
1229
- "unused-imports/no-unused-vars": "off",
1230
- "@typescript-eslint/comma-dangle": "off",
1231
- "@typescript-eslint/no-redeclare": "off",
1232
- "@typescript-eslint/no-namespace": "off",
1233
- "@typescript-eslint/no-unused-vars": "off",
1234
- "@typescript-eslint/no-extraneous-class": "off",
1235
- "@typescript-eslint/no-use-before-define": "off"
1236
- }
1237
- }
1238
- ]);
1239
-
1240
- // src/configs/vue.ts
1241
- var import_node_process2 = __toESM(require("process"), 1);
1242
- var import_local_pkg2 = require("local-pkg");
1243
- function getVueVersion() {
1244
- const pkg = (0, import_local_pkg2.getPackageInfoSync)("vue", { paths: [import_node_process2.default.cwd()] });
1245
- if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) {
1246
- return +pkg.version[0];
1247
- }
1248
- return 3;
1249
- }
1250
- var isVue3 = getVueVersion() === 3;
1251
- var vue2Rules = {
1252
- ...import_eslint_plugin_vue.default.configs.base.rules,
1253
- ...import_eslint_plugin_vue.default.configs.essential.rules,
1254
- ...import_eslint_plugin_vue.default.configs["strongly-recommended"].rules,
1255
- ...import_eslint_plugin_vue.default.configs.recommended.rules
1256
- };
1257
- var vue3Rules = {
1258
- ...import_eslint_plugin_vue.default.configs.base.rules,
1259
- ...import_eslint_plugin_vue.default.configs["vue3-essential"].rules,
1260
- ...import_eslint_plugin_vue.default.configs["vue3-strongly-recommended"].rules,
1261
- ...import_eslint_plugin_vue.default.configs["vue3-recommended"].rules
1262
- };
1263
- var vue = defineConfig([
1264
- ...import_typescript_eslint.default.config({
1265
- name: "ntnyq/vue/ts",
1266
- files: [GLOB_VUE],
1267
- // TODO: Remove this when `typescript-eslint` is aligned with `eslint`
1268
- // @ts-expect-error - `typescript-eslint` is not aligned with eslint
1269
- extends: typescriptCore
1270
- }),
1271
- {
1272
- name: "ntnyq/vue/core",
1273
- files: [GLOB_VUE],
1460
+ {
1461
+ name: "ntnyq/jsonc",
1462
+ files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
1274
1463
  plugins: {
1275
- vue: import_eslint_plugin_vue.default,
1276
- "@typescript-eslint": import_typescript_eslint.default.plugin
1464
+ jsonc: import_eslint_plugin_jsonc.default
1277
1465
  },
1278
1466
  languageOptions: {
1279
- parser: parserVue,
1280
- parserOptions: {
1281
- parser: "@typescript-eslint/parser",
1282
- sourceType: "module",
1283
- extraFileExtensions: [".vue"],
1284
- ecmaFeatures: {
1285
- jsx: true
1286
- }
1287
- }
1467
+ parser: parserJsonc
1288
1468
  },
1289
- processor: import_eslint_plugin_vue.default.processors[".vue"],
1290
1469
  rules: {
1291
- ...isVue3 ? vue3Rules : vue2Rules,
1292
- // OFF
1293
- "vue/no-v-html": "off",
1294
- "vue/require-prop-types": "off",
1295
- "vue/require-default-prop": "off",
1296
- "vue/multi-word-component-names": "off",
1297
- "vue/no-setup-props-reactivity-loss": "off",
1298
- "vue/html-self-closing": [
1299
- "error",
1300
- {
1301
- html: {
1302
- void: "always",
1303
- normal: "always",
1304
- component: "always"
1305
- },
1306
- svg: "always",
1307
- math: "always"
1308
- }
1309
- ],
1310
- "vue/block-tag-newline": [
1311
- "error",
1312
- {
1313
- singleline: "always",
1314
- multiline: "always"
1315
- }
1316
- ],
1317
- "vue/component-name-in-template-casing": [
1318
- "error",
1319
- "PascalCase",
1320
- {
1321
- // Force auto-import components to be PascalCase
1322
- registeredComponentsOnly: false,
1323
- ignores: ["slot", "component"]
1324
- }
1325
- ],
1326
- "vue/component-options-name-casing": ["error", "PascalCase"],
1327
- "vue/custom-event-name-casing": ["error", "camelCase"],
1328
- "vue/define-macros-order": [
1329
- "error",
1330
- {
1331
- order: ["defineProps", "defineEmits", "defineOptions", "defineSlots"]
1332
- }
1333
- ],
1334
- "vue/html-comment-content-spacing": [
1335
- "error",
1336
- "always",
1337
- {
1338
- exceptions: ["-"]
1339
- }
1340
- ],
1341
- "vue/array-bracket-spacing": ["error", "never"],
1342
- "vue/arrow-spacing": ["error", { before: true, after: true }],
1343
- "vue/block-spacing": ["error", "always"],
1344
- "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
1345
- "vue/comma-dangle": ["error", "always-multiline"],
1346
- "vue/comma-spacing": ["error", { before: false, after: true }],
1347
- "vue/comma-style": ["error", "last"],
1348
- "vue/dot-location": ["error", "property"],
1349
- "vue/dot-notation": ["error", { allowKeywords: true }],
1350
- "vue/eqeqeq": ["error", "smart"],
1351
- "vue/key-spacing": ["error", { beforeColon: false, afterColon: true }],
1352
- "vue/keyword-spacing": ["error", { before: true, after: true }],
1353
- "vue/no-empty-pattern": "error",
1354
- "vue/no-loss-of-precision": "error",
1355
- "vue/no-irregular-whitespace": "error",
1356
- "vue/no-use-v-else-with-v-for": "error",
1357
- "vue/require-typed-object-prop": "error",
1358
- "vue/no-extra-parens": ["error", "functions"],
1359
- "vue/no-restricted-syntax": [
1360
- "error",
1361
- "DebuggerStatement",
1362
- "LabeledStatement",
1363
- "WithStatement"
1364
- ],
1365
- "vue/no-sparse-arrays": "error",
1366
- "vue/no-deprecated-model-definition": [
1470
+ ...import_eslint_plugin_jsonc.default.configs["recommended-with-jsonc"].rules,
1471
+ "jsonc/array-bracket-spacing": ["error", "never"],
1472
+ "jsonc/comma-dangle": ["error", "never"],
1473
+ "jsonc/comma-style": ["error", "last"],
1474
+ "jsonc/indent": ["error", 2],
1475
+ "jsonc/key-spacing": [
1367
1476
  "error",
1368
1477
  {
1369
- allowVue3Compat: true
1478
+ beforeColon: false,
1479
+ afterColon: true
1370
1480
  }
1371
1481
  ],
1372
- "vue/object-curly-newline": [
1482
+ "jsonc/no-octal-escape": "error",
1483
+ "jsonc/object-curly-newline": [
1373
1484
  "error",
1374
1485
  {
1375
1486
  multiline: true,
1376
1487
  consistent: true
1377
1488
  }
1378
1489
  ],
1379
- "vue/no-static-inline-styles": [
1380
- "error",
1381
- {
1382
- allowBinding: true
1383
- }
1384
- ],
1385
- "vue/object-curly-spacing": ["error", "always"],
1386
- "vue/object-property-newline": [
1490
+ "jsonc/object-curly-spacing": ["error", "always"],
1491
+ "jsonc/object-property-newline": [
1387
1492
  "error",
1388
1493
  {
1389
1494
  allowMultiplePropertiesPerLine: true
1390
1495
  }
1391
- ],
1392
- "vue/object-shorthand": [
1393
- "error",
1394
- "always",
1395
- {
1396
- ignoreConstructors: false,
1397
- avoidQuotes: true
1398
- }
1399
- ],
1400
- "vue/operator-linebreak": ["error", "before"],
1401
- "vue/prefer-template": "error",
1402
- "vue/prop-name-casing": ["error", "camelCase"],
1403
- "vue/quote-props": ["error", "consistent-as-needed"],
1404
- "vue/space-in-parens": ["error", "never"],
1405
- "vue/space-infix-ops": "error",
1406
- "vue/space-unary-ops": [
1407
- "error",
1408
- {
1409
- words: true,
1410
- nonwords: false
1411
- }
1412
- ],
1413
- "vue/template-curly-spacing": "error",
1414
- "vue/block-order": [
1415
- "error",
1416
- {
1417
- order: ["script", "template", "style"]
1418
- }
1419
- ],
1420
- "vue/attributes-order": [
1421
- "error",
1422
- {
1423
- order: [
1424
- "EVENTS",
1425
- // `@click="functionCall"`, `v-on="event"`
1426
- "TWO_WAY_BINDING",
1427
- // `v-model`
1428
- "OTHER_DIRECTIVES",
1429
- // `v-custom-directive`
1430
- "LIST_RENDERING",
1431
- // `v-for item in items`
1432
- "CONDITIONALS",
1433
- // `v-if`, `v-show`, `v-cloak`
1434
- "CONTENT",
1435
- // `v-text`, `v-html`
1436
- "SLOT",
1437
- // `v-slot`, `slot`
1438
- "UNIQUE",
1439
- // `ref`, `key`
1440
- "DEFINITION",
1441
- // `is`, `v-is`
1442
- "ATTR_DYNAMIC",
1443
- // `v-bind:prop="foo"`, `:prop="foo"`
1444
- // `OTHER_ATTR`, // `custom-prop="foo"`, `:prop="foo"`, `disabled`
1445
- "RENDER_MODIFIERS",
1446
- // `v-once`, `v-pre`
1447
- "GLOBAL",
1448
- // `id`
1449
- "ATTR_STATIC",
1450
- // `prop="foo", `static attributes
1451
- "ATTR_SHORTHAND_BOOL"
1452
- // `disabled`, prop shorthand
1453
- ],
1454
- alphabetical: false
1455
- }
1456
- ],
1457
- "vue/order-in-components": [
1458
- "error",
1459
- {
1460
- order: [
1461
- "el",
1462
- "name",
1463
- "key",
1464
- "parent",
1465
- "functional",
1466
- ["provide", "inject"],
1467
- ["delimiters", "comments"],
1468
- ["components", "directives", "filters"],
1469
- "extends",
1470
- "mixins",
1471
- "layout",
1472
- "middleware",
1473
- "validate",
1474
- "scrollToTop",
1475
- "transition",
1476
- "loading",
1477
- "inheritAttrs",
1478
- "model",
1479
- ["props", "propsData"],
1480
- "emits",
1481
- "setup",
1482
- "asyncData",
1483
- "computed",
1484
- "data",
1485
- "fetch",
1486
- "head",
1487
- "methods",
1488
- ["template", "render"],
1489
- "watch",
1490
- "watchQuery",
1491
- "LIFECYCLE_HOOKS",
1492
- "renderError",
1493
- "ROUTER_GUARDS"
1494
- ]
1495
- }
1496
- ],
1497
- "vue/max-attributes-per-line": [
1498
- "error",
1499
- {
1500
- singleline: 1,
1501
- multiline: 1
1502
- }
1503
1496
  ]
1504
1497
  }
1505
1498
  }
1506
1499
  ]);
1507
1500
 
1501
+ // src/configs/markdown.ts
1502
+ var markdown = defineConfig([
1503
+ ...import_eslint_plugin_markdown.default.configs.recommended,
1504
+ {
1505
+ name: "ntnyq/markdown/extensions",
1506
+ files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
1507
+ rules: {
1508
+ "no-undef": "off",
1509
+ "no-alert": "off",
1510
+ "no-console": "off",
1511
+ "no-unused-vars": "off",
1512
+ "no-unused-expressions": "off",
1513
+ "no-restricted-imports": "off",
1514
+ "node/prefer-global/buffer": "off",
1515
+ "node/prefer-global/process": "off",
1516
+ "import/no-unresolved": "off",
1517
+ "unused-imports/no-unused-imports": "off",
1518
+ "unused-imports/no-unused-vars": "off",
1519
+ "@typescript-eslint/comma-dangle": "off",
1520
+ "@typescript-eslint/no-redeclare": "off",
1521
+ "@typescript-eslint/no-namespace": "off",
1522
+ "@typescript-eslint/no-unused-vars": "off",
1523
+ "@typescript-eslint/no-extraneous-class": "off",
1524
+ "@typescript-eslint/no-use-before-define": "off"
1525
+ }
1526
+ }
1527
+ ]);
1528
+
1508
1529
  // src/core.ts
1509
1530
  function ntnyq(config = [], {
1510
1531
  vue: enableVue = hasVue,
1511
1532
  unocss: enableUnoCSS = hasUnoCSS,
1533
+ vitest: enableVitest = hasVitest,
1512
1534
  prettier: enablePrettier = true,
1513
1535
  markdown: enableMarkdown = true,
1514
1536
  command: enableCommand = true
@@ -1539,6 +1561,9 @@ function ntnyq(config = [], {
1539
1561
  if (enableVue) {
1540
1562
  configs.push(...vue);
1541
1563
  }
1564
+ if (enableVitest) {
1565
+ configs.push(...vitest);
1566
+ }
1542
1567
  if (enableUnoCSS) {
1543
1568
  configs.push(...unocss);
1544
1569
  }
@@ -1577,6 +1602,7 @@ function ntnyq(config = [], {
1577
1602
  GLOB_SRC,
1578
1603
  GLOB_SRC_EXT,
1579
1604
  GLOB_STYLE,
1605
+ GLOB_TEST,
1580
1606
  GLOB_TOML,
1581
1607
  GLOB_TS,
1582
1608
  GLOB_TSX,
@@ -1588,6 +1614,7 @@ function ntnyq(config = [], {
1588
1614
  getVueVersion,
1589
1615
  hasTypeScript,
1590
1616
  hasUnoCSS,
1617
+ hasVitest,
1591
1618
  hasVue,
1592
1619
  ignores,
1593
1620
  imports,
@@ -1618,6 +1645,7 @@ function ntnyq(config = [], {
1618
1645
  pluginUnicorn,
1619
1646
  pluginUnoCSS,
1620
1647
  pluginUnusedImports,
1648
+ pluginVitest,
1621
1649
  pluginVue,
1622
1650
  pluginYaml,
1623
1651
  prettier,
@@ -1631,6 +1659,7 @@ function ntnyq(config = [], {
1631
1659
  unicorn,
1632
1660
  unocss,
1633
1661
  unusedImports,
1662
+ vitest,
1634
1663
  vue,
1635
1664
  yml
1636
1665
  });