-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
83 lines (78 loc) · 2.12 KB
/
.eslintrc.cjs
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
const path = require("path");
const { defineConfig } = require("eslint-define-config");
module.exports = defineConfig({
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"prettier",
],
plugins: ["@typescript-eslint", "simple-import-sort"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 6,
project: [
path.resolve(__dirname, "./tsconfig.json"),
path.resolve(__dirname, "packages/core/tsconfig.json"),
path.resolve(__dirname, "packages/functions/tsconfig.json"),
],
sourceType: "module",
},
ignorePatterns: [".eslintrc.cjs", "lint-staged.config.cjs"],
rules: {
curly: ["error", "all"],
"default-param-last": ["error"],
"arrow-body-style": "error",
"function-paren-newline": "off",
"implicit-arrow-linebreak": "off",
"no-unused-expressions": "off",
"default-case": "off",
"consistent-return": "off",
"no-plusplus": "off",
"no-restricted-syntax": "off",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/consistent-type-imports": "error",
"simple-import-sort/imports": [
"error",
{
groups: [
["^@?\\w"],
["^@\\/"],
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
],
},
],
"simple-import-sort/exports": "error",
"import/extensions": [
"error",
{
ts: "never",
},
],
"import/no-unresolved": "off",
"import/order": "off",
"import/prefer-default-export": "off",
},
overrides: [
{
files: ["*.test.ts"],
rules: {
"simple-import-sort/imports": [
"error",
{
groups: [
["^\\u0000"],
["^@?\\w"],
["^@\\/"],
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
],
},
],
},
},
],
});