@eset-gdd/code-styleguide-eslint-vue3 1.1.2 → 1.1.4

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.
@@ -0,0 +1,152 @@
1
+ export const rules = {
2
+ // general
3
+ "vue/component-tags-order": [
4
+ "error",
5
+ {
6
+ order: ["template", "script", "style"],
7
+ },
8
+ ],
9
+ "vue/custom-event-name-casing": [
10
+ "warn",
11
+ "kebab-case",
12
+ {
13
+ ignores: [],
14
+ },
15
+ ],
16
+ "vue/component-definition-name-casing": ["error", "PascalCase"],
17
+ "vue/no-unused-properties": [
18
+ "warn",
19
+ {
20
+ groups: ["props", "data", "computed", "methods"],
21
+ },
22
+ ],
23
+
24
+ // template
25
+ "vue/no-multiple-template-root": "warn",
26
+ "vue/attributes-order": [
27
+ "error",
28
+ {
29
+ order: [
30
+ "DEFINITION",
31
+ "LIST_RENDERING",
32
+ "CONDITIONALS",
33
+ "RENDER_MODIFIERS",
34
+ "GLOBAL",
35
+ ["UNIQUE", "SLOT"],
36
+ "TWO_WAY_BINDING",
37
+ "OTHER_DIRECTIVES",
38
+ "OTHER_ATTR",
39
+ "EVENTS",
40
+ "CONTENT",
41
+ ],
42
+ alphabetical: false,
43
+ },
44
+ ],
45
+ "vue/html-self-closing": [
46
+ "error",
47
+ {
48
+ html: {
49
+ void: "always",
50
+ normal: "never",
51
+ component: "always",
52
+ },
53
+ svg: "always",
54
+ math: "always",
55
+ },
56
+ ],
57
+ "vue/component-name-in-template-casing": [
58
+ "error",
59
+ "PascalCase",
60
+ {
61
+ registeredComponentsOnly: false,
62
+ },
63
+ ],
64
+ "vue/html-button-has-type": [
65
+ "warn",
66
+ {
67
+ button: true,
68
+ submit: true,
69
+ reset: true,
70
+ },
71
+ ],
72
+ "vue/no-multi-spaces": ["error"],
73
+ "vue/no-reserved-component-names": [
74
+ "error",
75
+ {
76
+ disallowVueBuiltInComponents: true,
77
+ disallowVue3BuiltInComponents: true,
78
+ },
79
+ ],
80
+ "vue/no-restricted-component-options": [
81
+ "error",
82
+ "init",
83
+ "beforeCompile",
84
+ "compiled",
85
+ "activate",
86
+ "ready",
87
+ "/^(?:at|de)tached$/",
88
+ ],
89
+ "vue/no-undef-components": [
90
+ "error",
91
+ {
92
+ ignorePatterns: [
93
+ "custom(\\-\\w+)+",
94
+ "app(\\-\\w+)+",
95
+ "b(\\-\\w+)+",
96
+ "font(\\-\\w+)+",
97
+ "nuxt",
98
+ "nuxt(\\-\\w+)+",
99
+ "router(\\-\\w+)+",
100
+ "VGuard",
101
+ ],
102
+ },
103
+ ],
104
+ "vue/no-useless-mustaches": [
105
+ "error",
106
+ {
107
+ ignoreIncludesComment: false,
108
+ ignoreStringEscape: false,
109
+ },
110
+ ],
111
+ "vue/no-useless-v-bind": [
112
+ "error",
113
+ {
114
+ ignoreIncludesComment: false,
115
+ ignoreStringEscape: false,
116
+ },
117
+ ],
118
+ "vue/padding-line-between-blocks": ["error", "always"],
119
+ "vue/v-on-event-hyphenation": [
120
+ "error",
121
+ "always",
122
+ {
123
+ autofix: false,
124
+ ignore: [],
125
+ },
126
+ ],
127
+ "vue/v-on-function-call": [
128
+ "error",
129
+ "never",
130
+ {
131
+ ignoreIncludesComment: false,
132
+ },
133
+ ],
134
+ "vue/define-macros-order": [
135
+ "error",
136
+ {
137
+ order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"],
138
+ },
139
+ ],
140
+ "vue/prefer-separate-static-class": "error",
141
+ "vue/prefer-template": "error",
142
+ "vue/prop-name-casing": ["error", "camelCase"],
143
+ // "vue/custom-event-name-casing": ["error", "camelCase"],
144
+ "no-restricted-syntax": [
145
+ "error",
146
+ {
147
+ selector:
148
+ "VariableDeclarator[init.type='CallExpression'][init.callee.name='ref'][init.arguments.0.raw=/^(true|false)$/][id.name=/^(?!is|are|was|were|has|did|can|should)[a-z]/]",
149
+ message: "Boolean ref variables must start with is/are/was/were/has/did/can/should",
150
+ },
151
+ ],
152
+ };
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /* eslint-disable import-x/extensions */
2
2
  import pluginVue from "eslint-plugin-vue";
3
3
  import globals from "globals";
4
- import { vueRules } from "./configs/rules.js";
4
+ import { rules as vueRules } from "./configs/rules.js";
5
5
 
6
- export const rules = [...vueRules];
6
+ export const rules = { ...vueRules };
7
7
 
8
8
  export default [
9
9
  ...pluginVue.configs["flat/recommended"],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eset-gdd/code-styleguide-eslint-vue3",
3
3
  "type": "module",
4
- "version": "1.1.2",
4
+ "version": "1.1.4",
5
5
  "description": "Vue 3 ESLint configuration for ESET's Frontend Coding Styleguide",
6
6
  "author": "ESET GWD Team",
7
7
  "license": "ISC",
@@ -29,8 +29,8 @@
29
29
  "main": "index.js",
30
30
  "files": [
31
31
  "README.md",
32
+ "configs",
32
33
  "index.js",
33
- "rules.js",
34
34
  "typescript.js"
35
35
  ],
36
36
  "peerDependencies": {
@@ -38,7 +38,7 @@
38
38
  "vue": ">=3.0.0"
39
39
  },
40
40
  "dependencies": {
41
- "@eset-gdd/code-styleguide-eslint-base-typescript": "^1.1.2",
41
+ "@eset-gdd/code-styleguide-eslint-base-typescript": "^1.1.4",
42
42
  "eslint-plugin-vue": "^9.31.0",
43
43
  "globals": "^16.4.0",
44
44
  "typescript-eslint": "^8.18.2"
package/typescript.js CHANGED
@@ -2,10 +2,10 @@
2
2
  import pluginVue from "eslint-plugin-vue";
3
3
  import globals from "globals";
4
4
  import tseslint from "typescript-eslint";
5
- import { vueRules } from "./configs/rules.js";
6
- import { flatConfigRules as tsFlatConfig } from "@eset-gdd/code-styleguide-eslint-base-typescript";
5
+ import { rules as vueRules } from "./configs/rules.js";
6
+ import { rules as tsFlatConfig } from "@eset-gdd/code-styleguide-eslint-base-typescript";
7
7
 
8
- export const rules = [...vueRules, ...tsFlatConfig];
8
+ export const rules = { ...vueRules, ...tsFlatConfig };
9
9
 
10
10
  export default [
11
11
  ...pluginVue.configs["flat/recommended"],