feat(lint): enforce definePage layout meta on pages-v2

Adds a custom ESLint rule (local-rules/require-v2-layout-meta) that
fails any src/pages-v2/**.vue page missing
definePage({ meta: { layout: 'OrganizerLayoutV2' } }) (or PortalLayoutV2
under pages-v2/portal), preventing a silent wrong-shell fallback to the
default layout (RFC-WS-GUI-REDESIGN AD-G2). Wires eslint-plugin-local-rules
+ a pages-v2 override. The RuleTester spec is called at top level (ESLint
RuleTester self-manages describe/it under Vitest) and vitest.config.ts
gains the eslint-rules test glob so the spec is discovered.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-16 11:30:03 +02:00
parent 2465290614
commit 93e4fe398b
7 changed files with 124 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ module.exports = {
'regex',
'regexp',
'boundaries',
'local-rules',
],
ignorePatterns: [
'src/plugins/iconify/*.js',
@@ -328,6 +329,12 @@ module.exports = {
'boundaries/include': ['src/**/*.{ts,vue,tsx}'],
},
overrides: [
{
files: ['src/pages-v2/**/*.vue'],
rules: {
'local-rules/require-v2-layout-meta': 'error',
},
},
// Vue SFCs: the base lines-around-comment rule conflicts with
// vue/block-tag-newline at the <script setup>/comment boundary
// (the <script> tag isn't a JS block-start so allowBlockStart