UNPKG

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