1 | module.exports = {
|
2 | env: {
|
3 | node: true,
|
4 | es2020: true,
|
5 | "jest/globals": true,
|
6 | },
|
7 | extends: [
|
8 | "eslint:recommended",
|
9 | "plugin:@typescript-eslint/eslint-recommended",
|
10 | "plugin:@typescript-eslint/recommended",
|
11 | "plugin:prettier/recommended",
|
12 | "plugin:jest/recommended",
|
13 | "plugin:json/recommended",
|
14 | ],
|
15 | parserOptions: {
|
16 | ecmaVersion: 2020,
|
17 | sourceType: "module",
|
18 | ecmaFeatures: {
|
19 | jsx: true,
|
20 | },
|
21 | },
|
22 | plugins: [
|
23 | "@typescript-eslint",
|
24 | "@typescript-eslint/tslint",
|
25 | "jest",
|
26 | "prettier",
|
27 | "import",
|
28 | "json",
|
29 | ],
|
30 | overrides: [
|
31 | {
|
32 | files: ["*.ts"],
|
33 | parser: "@typescript-eslint/parser",
|
34 | parserOptions: {
|
35 | project: "tsconfig.json",
|
36 | },
|
37 | },
|
38 | ],
|
39 | rules: {
|
40 | "@typescript-eslint/no-redeclare": "error",
|
41 | "@typescript-eslint/no-shadow": "error",
|
42 | "@typescript-eslint/no-explicit-any": "error",
|
43 | "@typescript-eslint/explicit-function-return-type": "off",
|
44 | "@typescript-eslint/explicit-module-boundary-types": "off",
|
45 | "@typescript-eslint/no-unused-vars": [
|
46 | "error",
|
47 | {
|
48 | varsIgnorePattern: "^_",
|
49 | argsIgnorePattern: "^_",
|
50 | ignoreRestSiblings: true,
|
51 | },
|
52 | ],
|
53 | "@typescript-eslint/camelcase": "off",
|
54 | "@typescript-eslint/naming-convention": [
|
55 | "error",
|
56 | {
|
57 | selector: "default",
|
58 | format: ["camelCase"],
|
59 | },
|
60 | {
|
61 | selector: "memberLike",
|
62 | format: ["camelCase", "PascalCase"],
|
63 | leadingUnderscore: "allow",
|
64 | },
|
65 | {
|
66 | selector: "variableLike",
|
67 | format: ["camelCase", "PascalCase"],
|
68 | leadingUnderscore: "allow",
|
69 | },
|
70 | {
|
71 | selector: "property",
|
72 | format: ["camelCase", "snake_case", "PascalCase"],
|
73 | leadingUnderscore: "allow",
|
74 | },
|
75 | {
|
76 | selector: "property",
|
77 | format: null,
|
78 | filter: {
|
79 | regex: "^__html$",
|
80 | match: true,
|
81 | },
|
82 | },
|
83 | {
|
84 | selector: "method",
|
85 | format: null,
|
86 | filter: {
|
87 | regex: "^UNSAFE_",
|
88 | match: true,
|
89 | },
|
90 | },
|
91 | {
|
92 | selector: "typeLike",
|
93 | format: ["PascalCase"],
|
94 | },
|
95 | ],
|
96 | "@typescript-eslint/no-use-before-define": [
|
97 | "error",
|
98 | { functions: false, variables: false },
|
99 | ],
|
100 | "no-redeclare": "off",
|
101 | "no-shadow": "off",
|
102 | "prettier/prettier": "error",
|
103 | "sort-keys": "off",
|
104 | "no-console": "error",
|
105 | "json/*": "error",
|
106 | "import/no-internal-modules": "error",
|
107 | "import/order": [
|
108 | "error",
|
109 | {
|
110 | "newlines-between": "always-and-inside-groups",
|
111 | groups: [
|
112 | ["builtin", "external"],
|
113 | "internal",
|
114 | ["parent", "sibling"],
|
115 | ["index", "object"],
|
116 | ],
|
117 | pathGroups: [
|
118 | {
|
119 | pattern: "@carforyou/**",
|
120 | group: "external",
|
121 | position: "after",
|
122 | },
|
123 | {
|
124 | pattern: "~/**",
|
125 | group: "internal",
|
126 | position: "after",
|
127 | },
|
128 | ],
|
129 | alphabetize: {
|
130 | order: "desc",
|
131 | caseInsensitive: true,
|
132 | },
|
133 | },
|
134 | ],
|
135 | "sort-imports": [
|
136 | "error",
|
137 | {
|
138 | ignoreCase: true,
|
139 | ignoreDeclarationSort: true,
|
140 | ignoreMemberSort: false,
|
141 | memberSyntaxSortOrder: ["none", "single", "all", "multiple"],
|
142 | allowSeparatedGroups: true,
|
143 | },
|
144 | ],
|
145 | },
|
146 | }
|