@html-validate/eslint-config-vue 6.12.0 → 6.13.0

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.
Files changed (2) hide show
  1. package/index.mjs +51 -1
  2. package/package.json +4 -3
package/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import eslintConfigPrettier from "eslint-config-prettier";
2
2
  import eslintPluginVue from "eslint-plugin-vue";
3
+ import { parser as tseParser } from "typescript-eslint";
3
4
 
4
5
  function filterRules(rules, predicate) {
5
6
  return Object.fromEntries(Object.entries(rules).filter(([key]) => predicate(key)));
@@ -22,6 +23,10 @@ const recommended = eslintPluginVue.configs["flat/recommended"][1];
22
23
  export default defineConfig({
23
24
  languageOptions: {
24
25
  parser: recommended.languageOptions.parser,
26
+ parserOptions: {
27
+ extraFileExtensions: [".vue"],
28
+ parser: tseParser,
29
+ },
25
30
  },
26
31
 
27
32
  processor: eslintPluginVue.processors.vue,
@@ -34,22 +39,67 @@ export default defineConfig({
34
39
  ...recommended.rules,
35
40
  ...filterRules(eslintConfigPrettier.rules, (rule) => rule.startsWith("vue/")),
36
41
 
42
+ "@typescript-eslint/no-object-literal-type-assertion": ["off"],
43
+
44
+ "sonarjs/different-types-comparison": "off", // does not play well with vue
45
+
46
+ /* documentation for vue components does not adhere with tsdoc syntax */
47
+ "tsdoc/syntax": "off",
48
+
49
+ /* this rule warns about the order of the top-level tags */
37
50
  "vue/block-order": ["error", { order: ["script", "template", "style"] }],
51
+
52
+ /* requires defineEmit<{ ... }>() over defineEmit({ ... }) */
38
53
  "vue/define-emits-declaration": ["error", "type-based"],
54
+
55
+ /* requires a specific order of the compiler macros */
39
56
  "vue/define-macros-order": [
40
57
  "error",
41
58
  {
42
- order: ["defineModel", "defineProps", "defineEmits", "defineSlots"],
59
+ order: [
60
+ "defineModel",
61
+ "defineProps",
62
+ "defineEmits",
63
+ "defineSlots",
64
+ "defineOptions",
65
+ "defineExpose",
66
+ ],
43
67
  defineExposeLast: false,
44
68
  },
45
69
  ],
70
+
71
+ /* requires defineProps<{ ... }>() over defineProps({ ... }) */
46
72
  "vue/define-props-declaration": ["error", "type-based"],
73
+
74
+ /* disallows opt-out booleans as the consumer syntax becomes awkward */
47
75
  "vue/no-boolean-default": "error",
76
+
77
+ /* disallows importing compiler macros */
48
78
  "vue/no-import-compiler-macros": "error",
79
+
80
+ /* disallows unused declared events */
49
81
  "vue/no-unused-emit-declarations": "error",
82
+
83
+ /* disallows unused declared props */
50
84
  "vue/no-unused-properties": "error",
85
+
86
+ /* extended version of original object-shorthand for vue sfc templates */
51
87
  "vue/object-shorthand": "error",
88
+
89
+ /* prefer useTemplateRef() over ref() with same name */
52
90
  "vue/prefer-use-template-ref": "error",
91
+
92
+ /* require :foo over v-bind:foo */
53
93
  "vue/v-bind-style": ["error", "shorthand", { sameNameShorthand: "always" }],
94
+
95
+ /* require lang="ts" for <script> tags */
96
+ "vue/block-lang": [
97
+ "error",
98
+ {
99
+ script: {
100
+ lang: "ts",
101
+ },
102
+ },
103
+ ],
54
104
  },
55
105
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-validate/eslint-config-vue",
3
- "version": "6.12.0",
3
+ "version": "6.13.0",
4
4
  "description": "Eslint sharable config used by the various HTML-validate packages",
5
5
  "keywords": [
6
6
  "eslint",
@@ -30,7 +30,8 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "eslint-config-prettier": "10.1.8",
33
- "eslint-plugin-vue": "10.6.2"
33
+ "eslint-plugin-vue": "10.6.2",
34
+ "typescript-eslint": "8.49.0"
34
35
  },
35
36
  "peerDependencies": {
36
37
  "eslint": "^9.0.0"
@@ -42,5 +43,5 @@
42
43
  "publishConfig": {
43
44
  "access": "public"
44
45
  },
45
- "gitHead": "1bb2a82510f8fad3cd4717de83f6f74a11ada671"
46
+ "gitHead": "48725db7e0865dcd0aba16604734e60c4952625a"
46
47
  }