forked from saleor/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
74 lines (73 loc) 路 2.15 KB
/
Copy patheslint.config.js
File metadata and controls
74 lines (73 loc) 路 2.15 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
67
68
69
70
71
72
73
74
import { config } from "@saleor/eslint-config-apps/index.js";
import nodePlugin from "eslint-plugin-n";
/** @type {import("eslint").Linter.Config} */
export default [
...config,
{
name: "saleor-app-avatax/custom-config",
files: ["**/*.ts"],
plugins: {
n: nodePlugin,
},
rules: {
"n/no-process-env": "error",
"@typescript-eslint/no-restricted-imports": [
"error",
{
paths: [
{
name: "@opentelemetry/api",
importNames: ["trace"],
message:
"Importing trace from @opentelemetry/api is not allowed. Use `@lib/tracing` module instead.",
},
],
},
],
},
},
{
// TODO: remove this override once the recommended rules are fixed
name: "saleor-app-avatax/override-recommended",
files: ["**/*.{ts,tsx}"],
rules: {
"@typescript-eslint/no-empty-object-type": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
"no-fallthrough": "warn",
},
},
{
name: "saleor-app-avatax/override-no-process-env",
files: ["next.config.ts", "src/env*.ts", "src/instrumentation.ts", "e2e/env-e2e.ts"],
rules: {
"n/no-process-env": "off",
},
},
{
// TODO: remove this override once we rename all ts/tsx files to kebab-case
name: "saleor-app-avatax/override-react-naming-convention/filename",
files: ["**/*.{ts,tsx}"],
rules: {
"react-naming-convention/filename": ["warn", { rule: "kebab-case" }],
},
},
{
// TODO: remove this override once we rename all graphql files to kebab-case
name: "saleor-app-avatax/override-@graphql-eslint/match-document-filename",
files: ["**/*.graphql"],
rules: {
"@graphql-eslint/match-document-filename": [
"warn",
{
fileExtension: ".graphql",
fragment: { style: "kebab-case" },
query: { style: "kebab-case" },
subscription: { style: "kebab-case" },
mutation: { style: "kebab-case" },
},
],
},
},
];