-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
67 lines (62 loc) · 2.87 KB
/
eslint.config.mjs
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
// @ts-check
import eslint from "@eslint/js";
// import rxjs from "@smarttools/eslint-plugin-rxjs";
import prettier from "eslint-plugin-prettier/recommended";
// import react from "eslint-plugin-react";
import tseslint from "typescript-eslint";
// const eslint = require("@eslint/js");
// const rxjs = require("@smarttools/eslint-plugin-rxjs");
// const prettier = require("eslint-plugin-prettier/recommended");
// const tseslint = require("typescript-eslint");
export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.strict,
tseslint.configs.stylistic,
prettier,
{
languageOptions: {
ecmaVersion: 2020,
sourceType: "module",
parserOptions: { project: ["./tsconfig.json", "./tsconfig.server.json"] },
},
// plugins: { rxjs },
rules: {
strict: "error",
"no-console": "off",
"no-unsafe-optional-chaining": "error",
"no-unused-vars": "off", // off required as we use the @typescript-eslint/no-unused-vars rule
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
// "@typescript-eslint/ban-types": "error",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-explicit-any": "off", // We allow explicit any
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-non-null-assertion": "off", // behavior mismatch between TSlint and TScompiler. I make a valid usage of non null assertions
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "off", // behavior mismatch between TSlint and TScompiler. giving too many useless errors and we allow unnecessary type assertions
"@typescript-eslint/no-unsafe-argument": "error",
"@typescript-eslint/no-unsafe-assignment": "off", // off for the moment because we have too many warnings
"@typescript-eslint/no-unsafe-call": "error",
"@typescript-eslint/no-unsafe-member-access": "off", // off for the moment because we have too many warnings
"@typescript-eslint/no-unsafe-return": "error",
"@typescript-eslint/require-await": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/restrict-template-expressions": "error",
"@typescript-eslint/unbound-method": "error",
"@typescript-eslint/promise-function-async": "error",
// "rxjs/no-async-subscribe": "warn",
// "rxjs/no-ignored-observable": "warn",
// "rxjs/no-ignored-subscription": "warn",
// "rxjs/no-unbound-methods": "warn",
// "rxjs/throw-error": "warn",
},
},
{ ignores: ["node_modules/*", ".storybook/", "build/*", "dist/*", "**/*.spec.ts", "*.config.mjs"] },
);