forked from microwavenby/shoegaze-stack
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
57 lines (57 loc) · 1.84 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
55
56
57
/** @type {import('@types/eslint').Linter.BaseConfig} */
module.exports = {
root: true,
extends: [
// Disable ESLint code formatting rules which conflict with Prettier
"prettier",
"@remix-run/eslint-config",
"@remix-run/eslint-config/node",
],
ignorePatterns: ["**/storybook-static"],
// Additional lint rules. These get layered onto the top-level rules.
overrides: [
{
files: "tests/*.test.*",
extends: ["@remix-run/eslint-config/jest-testing-library"],
},
{
files: "e2e/*.spec.*",
extends: ["plugin:playwright/playwright-test"],
},
// 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",
// 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,
},
},
};