Skip to content

Commit

Permalink
fix(eslint-config): handle app.vue and error.vue in custom `srcDi…
Browse files Browse the repository at this point in the history
…r` (#335)

Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 19, 2024
1 parent a833e1d commit adda0f1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/eslint-config/src/flat/configs/disables.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { join, relative } from 'pathe'
import { join } from 'pathe'
import { GLOB_EXTS } from '../constants'
import type { FlatConfig, NuxtESLintConfigOptions } from '../types'

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

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

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

0 comments on commit adda0f1

Please sign in to comment.