This repository has been archived by the owner on Aug 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
54 lines (54 loc) · 1.7 KB
/
.eslintrc.js
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
module.exports = {
root: true,
extends: [
"nava",
// Disable ESLint code formatting rules which conflict with Prettier
"prettier",
// `next` should be extended last according to their docs
// https://nextjs.org/docs/basic-features/eslint
"next/core-web-vitals",
],
// Additional lint rules. These get layered onto the top-level rules.
overrides: [
// Lint config specific to Test files
{
files: ["tests/**"],
plugins: ["jest"],
extends: ["plugin:jest/recommended"],
},
// Lint config specific to TypeScript files
{
files: "**/*.+(ts|tsx)",
parserOptions: {
// These paths need defined to support rules that require type information
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
extends: [
"plugin:@typescript-eslint/recommended",
// Disable vanilla ESLint rules that conflict with those in @typescript-eslint
"plugin:@typescript-eslint/eslint-recommended",
// Rules that specifically require type information
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
plugins: ["@typescript-eslint"],
rules: {
// Prevent dead code accumulation
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "^_",
},
],
// The usage of `any` defeats the purpose of typescript. Consider using `unknown` type instead instead.
"@typescript-eslint/no-explicit-any": "error",
},
},
],
settings: {
// Support projects where Next.js isn't installed in the root directory (such as a monorepo)
next: {
rootDir: __dirname,
},
},
};