-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
115 lines (114 loc) · 3.09 KB
/
eslint.config.mjs
File metadata and controls
115 lines (114 loc) · 3.09 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import globals from "globals";
import tseslint from "typescript-eslint";
import importPlugin from "eslint-plugin-import";
import jestPlugin from "eslint-plugin-jest";
/** @type {import('eslint').Linter.Config[]} */
export default [
...tseslint.configs.recommendedTypeChecked,
importPlugin.flatConfigs.recommended,
{
files: ["apps/**/*.{js,mjs,cjs,ts,jsx,tsx}", "scripts/**/*.{js,mjs,cjs}"],
ignores: ["eslint.config.mjs"],
},
{
files: ["scripts/**/*.js"],
languageOptions: {
sourceType: "module",
parserOptions: {
ecmaVersion: "latest",
},
globals: {
...globals.node,
},
},
rules: {
"@typescript-eslint/no-var-requires": "off",
"no-undef": "error",
},
},
{
files: ["**/*.test.ts", "**/*.test.tsx", "**/*.spec.ts", "**/*.spec.tsx"],
plugins: {
jest: jestPlugin,
},
rules: {
...jestPlugin.configs.recommended.rules,
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
},
},
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
globals: {
...globals.node,
...globals.jest,
},
},
},
{
settings: {
"import/resolver": {
typescript: {
project: ["./tsconfig.json"],
alwaysTryTypes: true,
extensions: [".ts", ".tsx", ".js", ".jsx"],
},
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
alias: {
map: [
["@lambda", "./apps/lho-lambda/src"],
["@lambda-test", "./apps/lho-lambda/src/test"],
["@authorizer", "./apps/lho-authorizer/src"],
["@authorizer-test", "./apps/lho-authorizer/src/test"],
],
extensions: [".ts", ".tsx", ".js", ".jsx", ".json"],
},
},
react: {
version: "detect",
},
},
},
{
rules: {
"arrow-parens": 0,
camelcase: 0,
"comma-dangle": ["error", "always-multiline"],
"consistent-return": 0,
"function-paren-newline": 0,
"global-require": 0,
"implicit-arrow-linebreak": 0,
"import/no-cycle": 0,
"no-console": ["off"],
"no-extra-boolean-cast": 0,
"no-nested-ternary": 0,
"import/no-cycle": "error",
"no-return-assign": 0,
"no-undef": ["warn"],
"no-underscore-dangle": 0,
"no-unused-expressions": 0,
"no-fallthrough": "error",
"@typescript-eslint/no-unused-vars": ["error"],
"object-curly-newline": 0,
"object-curly-spacing": ["error", "always"],
"operator-linebreak": 0,
"quote-props": 0,
quotes: ["error", "single", {avoidEscape: true}],
semi: ["error", "always"],
"spaced-comment": 0,
"no-console": "warn",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
},
},
];