Repository navigation
Expand file tree
/
Copy patheslint.config.mjs
More file actions
51 lines (50 loc) · 1.9 KB
/
Copy patheslint.config.mjs
File metadata and controls
51 lines (50 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
/**
* Correctness-only lint.
*
* `stylistic: false` is deliberate: the codebase is already consistently formatted,
* and enabling the stylistic ruleset would rewrite every file and bury real changes
* in whitespace. What's wanted here is the class of bug that typecheck and tests
* both miss — and it earned its place immediately: it caught a `const xml` in
* `rss.xml.get.ts` shadowing a same-named helper in the same scope, which would have
* thrown a TDZ `ReferenceError` on every request to the feed.
*/
export default createConfigForNuxt({
features: {
stylistic: false,
tooling: true,
},
dirs: {
src: ['./playground', '.'],
},
})
.append({
ignores: ['playground/.nuxt/**', 'playground/.output/**', 'playground/.vercel/**', 'dist/**'],
})
.append({
rules: {
// `any` here marks genuinely untyped boundaries — markdown frontmatter (whose
// shape is content, not code), `appConfig` before the consumer's app.config is
// generated, and `catch` bindings. Kept visible as a warning rather than
// silenced per-site, so a careless new one still shows up.
'@typescript-eslint/no-explicit-any': 'warn',
},
})
.append({
// Page, layout and error component names come from Nuxt's file-based routing —
// `index.vue`, `docs.vue`, `[...slug].vue` are the framework's naming, not ours.
// `app/components/content/` is exempt for a different reason: Markdown addresses those
// components by name (`::browser`), so their names are part of the content API.
files: [
'app/pages/**/*.vue',
'playground/app/pages/**/*.vue',
'app/layouts/**/*.vue',
'playground/app/layouts/**/*.vue',
'app/error.vue',
'playground/app/error.vue',
'app/components/content/**/*.vue',
],
rules: {
'vue/multi-word-component-names': 'off',
},
})