diff --git a/packages/@n8n_io/eslint-config/frontend.js b/packages/@n8n_io/eslint-config/frontend.js index 9e202c14a5..f4aae5fa26 100644 --- a/packages/@n8n_io/eslint-config/frontend.js +++ b/packages/@n8n_io/eslint-config/frontend.js @@ -4,7 +4,7 @@ module.exports = { plugins: ['vue'], - extends: ['plugin:vue/vue3-essential', '@vue/typescript', './base'], + extends: ['plugin:vue/vue3-recommended', '@vue/typescript', './base'], env: { browser: true, @@ -37,6 +37,22 @@ module.exports = { 'vue/no-unused-components': 'error', 'vue/multi-word-component-names': 'off', '@typescript-eslint/no-explicit-any': 'error', + 'vue/component-name-in-template-casing': [ + 'error', + 'PascalCase', + { + registeredComponentsOnly: true, + }, + ], + 'vue/no-reserved-component-names': [ + 'error', + { + disallowVueBuiltInComponents: true, + disallowVue3BuiltInComponents: false, + }, + ], + 'vue/prop-name-casing': ['error', 'camelCase'], + 'vue/attribute-hyphenation': ['error', 'always'], // TODO: fix these '@typescript-eslint/no-unsafe-call': 'off', diff --git a/packages/design-system/src/components/N8nActionBox/ActionBox.vue b/packages/design-system/src/components/N8nActionBox/ActionBox.vue index d3ec2bb29f..8230d1fbc5 100644 --- a/packages/design-system/src/components/N8nActionBox/ActionBox.vue +++ b/packages/design-system/src/components/N8nActionBox/ActionBox.vue @@ -1,37 +1,37 @@ @@ -43,7 +43,7 @@ import N8nCallout from '../N8nCallout'; import { defineComponent } from 'vue'; export default defineComponent({ - name: 'n8n-action-box', + name: 'N8nActionBox', components: { N8nButton, N8nHeading, diff --git a/packages/design-system/src/components/N8nActionDropdown/ActionDropdown.vue b/packages/design-system/src/components/N8nActionDropdown/ActionDropdown.vue index 77a212c20c..db7487f655 100644 --- a/packages/design-system/src/components/N8nActionDropdown/ActionDropdown.vue +++ b/packages/design-system/src/components/N8nActionDropdown/ActionDropdown.vue @@ -1,27 +1,27 @@ @@ -75,7 +75,7 @@ export interface IActionDropdownItem { // It can be used in different parts of editor UI while ActionToggle // is designed to be used in card components. export default defineComponent({ - name: 'n8n-action-dropdown', + name: 'N8nActionDropdown', components: { ElDropdown, ElDropdownMenu, @@ -83,10 +83,6 @@ export default defineComponent({ N8nIcon, N8nKeyboardShortcut, }, - data() { - const testIdPrefix = this.$attrs['data-test-id']; - return { testIdPrefix }; - }, props: { items: { type: Array as PropType, @@ -121,6 +117,10 @@ export default defineComponent({ default: false, }, }, + data() { + const testIdPrefix = this.$attrs['data-test-id']; + return { testIdPrefix }; + }, methods: { getItemClasses(item: IActionDropdownItem): Record { return { diff --git a/packages/design-system/src/components/N8nActionToggle/ActionToggle.vue b/packages/design-system/src/components/N8nActionToggle/ActionToggle.vue index 29087d9b6a..799f4c09c4 100644 --- a/packages/design-system/src/components/N8nActionToggle/ActionToggle.vue +++ b/packages/design-system/src/components/N8nActionToggle/ActionToggle.vue @@ -1,6 +1,6 @@ @@ -49,7 +49,7 @@ import N8nIcon from '../N8nIcon'; import type { UserAction } from '@/types'; export default defineComponent({ - name: 'n8n-action-toggle', + name: 'N8nActionToggle', components: { ElDropdown, ElDropdownMenu, diff --git a/packages/design-system/src/components/N8nAlert/Alert.vue b/packages/design-system/src/components/N8nAlert/Alert.vue index b48be58892..c2f64a245b 100644 --- a/packages/design-system/src/components/N8nAlert/Alert.vue +++ b/packages/design-system/src/components/N8nAlert/Alert.vue @@ -2,7 +2,7 @@
- +
diff --git a/packages/design-system/src/components/N8nAvatar/Avatar.vue b/packages/design-system/src/components/N8nAvatar/Avatar.vue index a8f49733c0..5460717d4c 100644 --- a/packages/design-system/src/components/N8nAvatar/Avatar.vue +++ b/packages/design-system/src/components/N8nAvatar/Avatar.vue @@ -24,7 +24,10 @@ const sizes: { [size: string]: number } = { import { defineComponent } from 'vue'; export default defineComponent({ - name: 'n8n-avatar', + name: 'N8nAvatar', + components: { + Avatar, + }, props: { firstName: { type: String, @@ -48,9 +51,6 @@ export default defineComponent({ ], }, }, - components: { - Avatar, - }, computed: { initials() { return ( diff --git a/packages/design-system/src/components/N8nBadge/Badge.vue b/packages/design-system/src/components/N8nBadge/Badge.vue index 7c6aed8b2f..b370b138cb 100644 --- a/packages/design-system/src/components/N8nBadge/Badge.vue +++ b/packages/design-system/src/components/N8nBadge/Badge.vue @@ -1,8 +1,8 @@ @@ -12,6 +12,9 @@ import N8nText from '../N8nText'; import { defineComponent } from 'vue'; export default defineComponent({ + components: { + N8nText, + }, props: { theme: { type: String, @@ -30,9 +33,6 @@ export default defineComponent({ default: false, }, }, - components: { - N8nText, - }, }); diff --git a/packages/design-system/src/components/N8nButton/Button.vue b/packages/design-system/src/components/N8nButton/Button.vue index bc794cf01d..779a7add0f 100644 --- a/packages/design-system/src/components/N8nButton/Button.vue +++ b/packages/design-system/src/components/N8nButton/Button.vue @@ -9,9 +9,9 @@ aria-live="polite" v-bind="$attrs" > - - - + + + {{ label }} diff --git a/packages/design-system/src/components/N8nCallout/Callout.vue b/packages/design-system/src/components/N8nCallout/Callout.vue index dfb98ab612..3c93e3bfac 100644 --- a/packages/design-system/src/components/N8nCallout/Callout.vue +++ b/packages/design-system/src/components/N8nCallout/Callout.vue @@ -1,12 +1,12 @@