-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheslint.config.mjs
More file actions
66 lines (62 loc) · 2.42 KB
/
Copy patheslint.config.mjs
File metadata and controls
66 lines (62 loc) · 2.42 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Flat ESLint config for the Next.js web app and the connector web
// workspaces. Lives at the repo root (rather than inside
// `src/Cvoya.Spring.Web/`) because ESLint 9 flat config enforces a
// "base path" rule: only files under the directory containing the
// config can be linted. Connector web packages live in sibling
// directories (`src/Cvoya.Spring.Connector.*/web/`), so the config must
// sit above both.
//
// Next 16 removed the built-in `next lint` command; the official
// migration guidance is to invoke `eslint` directly against a flat
// config that extends `eslint-config-next`. See
// https://nextjs.org/docs/app/api-reference/config/eslint.
//
// The config is kept intentionally minimal: it reuses whatever
// eslint-config-next ships (react, react-hooks, next, import,
// jsx-a11y, typescript-eslint) and layers only project-specific
// overrides on top. Rule disables are documented inline with a
// reference to the follow-up cleanup issue.
import nextConfig from "eslint-config-next";
const config = [
...nextConfig,
{
name: "spring-voyage/files",
// Only lint the JS/TS source trees owned by the web app and the
// connector web workspaces. Everything else in the repo (.NET,
// scripts, deployment, docs) is outside ESLint's remit.
files: [
"src/Cvoya.Spring.Web/**/*.{ts,tsx,js,jsx,mjs,cjs,mts,cts}",
"src/Cvoya.Spring.Connector.*/web/**/*.{ts,tsx,js,jsx,mjs,cjs,mts,cts}",
],
},
{
name: "spring-voyage/ignores",
ignores: [
// Generated by `openapi-typescript` on every `npm run lint`;
// regenerating a schema file is not a place where
// developer-visible lint errors belong.
"src/Cvoya.Spring.Web/src/lib/api/schema.d.ts",
"src/Cvoya.Spring.Web/.next/**",
"src/Cvoya.Spring.Web/out/**",
"src/Cvoya.Spring.Web/coverage/**",
"src/Cvoya.Spring.Web/next-env.d.ts",
"**/.eslintcache",
"**/node_modules/**",
],
},
{
name: "spring-voyage/rules",
rules: {
// The Next app root is `src/Cvoya.Spring.Web`, not the repo root.
// Pass the app directory explicitly so `@next/next/no-html-link-for-pages`
// (which resolves URLs by scanning the Next project) doesn't warn
// about a missing `pages/` dir when ESLint is invoked from the
// workspace root.
"@next/next/no-html-link-for-pages": [
"error",
"src/Cvoya.Spring.Web",
],
},
},
];
export default config;