generated from NHSDigital/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
54 lines (48 loc) · 1.38 KB
/
eslint.config.mjs
File metadata and controls
54 lines (48 loc) · 1.38 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
import { FlatCompat } from "@eslint/eslintrc";
import compat_plugin from "eslint-plugin-compat";
import { dirname } from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});
const eslintConfig = [
{
ignores: [
"node_modules/**",
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
"public/**",
"dist/**",
"docs/**",
"coverage/**",
"**/.terraform/**",
".open-next/**",
"playwright-report/**",
"pact/**",
"performance/report",
],
},
...compat.extends("next/core-web-vitals", "next/typescript", "prettier", "next"),
compat_plugin.configs["flat/recommended"],
{
rules: {
"@typescript-eslint/no-unused-vars": "error",
// nhsuk-frontend: https://github.com/nhsuk/nhsuk-frontend/blob/main/docs/contributing/browser-support.md
// Ref: https://github.com/nhsuk/nhsuk-frontend/blob/main/packages/nhsuk-frontend/.browserslistrc
// supported browsers are listed in package.json
"compat/compat": "warn",
},
},
// Override for test files: turn off compat
{
files: ["**/*.test.{js,jsx,ts,tsx}", "**/*.spec.{js,jsx,ts,tsx}", "test-data/**"],
rules: {
"compat/compat": "off",
},
},
];
export default eslintConfig;