Skip to content

Commit adda0f1

Browse files
danielroeantfuautofix-ci[bot]
authoredMar 19, 2024··
fix(eslint-config): handle app.vue and error.vue in custom srcDir (#335)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent a833e1d commit adda0f1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

Diff for: ‎packages/eslint-config/src/flat/configs/disables.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { join, relative } from 'pathe'
1+
import { join } from 'pathe'
22
import { GLOB_EXTS } from '../constants'
33
import type { FlatConfig, NuxtESLintConfigOptions } from '../types'
44

@@ -7,8 +7,11 @@ export default function disables(options: NuxtESLintConfigOptions): FlatConfig[]
77
const nestedGlobPattern = `**/*.${GLOB_EXTS}`
88

99
const fileRoutes = [
10-
relative(dirs.src || '', `app.${GLOB_EXTS}`),
11-
relative(dirs.src || '', `error.${GLOB_EXTS}`),
10+
// These files must have one-word names as they have a special meaning in Nuxt.
11+
...dirs.layers?.flatMap(layersDir => [
12+
join(layersDir, `app.${GLOB_EXTS}`),
13+
join(layersDir, `error.${GLOB_EXTS}`),
14+
]) || [],
1215

1316
// Layouts and pages are not used directly by users so they can have one-word names.
1417
...(dirs.layouts?.map(layoutsDir => join(layoutsDir, nestedGlobPattern)) || []),

0 commit comments

Comments
 (0)
Please sign in to comment.