@adbayb/stack 2.40.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/bin/index.js +2 -4
- package/configs/{prettier → oxfmt}/README.md +6 -14
- package/configs/oxfmt/index.ts +41 -0
- package/configs/{eslint → oxlint}/README.md +4 -4
- package/configs/oxlint/index.ts +317 -0
- package/configs/typescript/index.json +1 -7
- package/dist/configs/oxfmt.d.ts +32 -0
- package/dist/configs/oxfmt.js +37 -0
- package/dist/configs/oxlint.d.ts +271 -0
- package/dist/configs/oxlint.js +323 -0
- package/dist/index.js +261 -249
- package/package.json +42 -48
- package/templates/multi-projects/.github/workflows/continuous_delivery.yml +3 -3
- package/templates/multi-projects/.github/workflows/dependency_changelog.yml +1 -1
- package/templates/multi-projects/.github/workflows/workflow.yml +3 -3
- package/templates/multi-projects/.vscode/extensions.json +1 -1
- package/templates/multi-projects/.vscode/settings.json +7 -13
- package/templates/multi-projects/libraries/{{projectName}}/package.json +10 -10
- package/templates/multi-projects/oxfmt.config.ts +1 -0
- package/templates/multi-projects/oxlint.config.ts +1 -0
- package/templates/multi-projects/package.json +3 -4
- package/templates/multi-projects/pnpm-workspace.yaml +8 -9
- package/templates/single-project/.github/workflows/continuous_delivery.yml +3 -3
- package/templates/single-project/.github/workflows/dependency_changelog.yml +1 -1
- package/templates/single-project/.github/workflows/workflow.yml +3 -3
- package/templates/single-project/.vscode/extensions.json +1 -1
- package/templates/single-project/.vscode/settings.json +7 -13
- package/templates/single-project/oxfmt.config.ts +1 -0
- package/templates/single-project/oxlint.config.ts +1 -0
- package/templates/single-project/package.json +3 -4
- package/templates/single-project/pnpm-workspace.yaml +8 -9
- package/templates/single-project/{{projectName}}/package.json +10 -10
- package/configs/eslint/constants.js +0 -37
- package/configs/eslint/helpers.js +0 -5
- package/configs/eslint/index.js +0 -30
- package/configs/eslint/presets/dependencies.js +0 -14
- package/configs/eslint/presets/eslint.js +0 -133
- package/configs/eslint/presets/import.js +0 -65
- package/configs/eslint/presets/jsdoc.js +0 -78
- package/configs/eslint/presets/markdown.js +0 -1
- package/configs/eslint/presets/node.js +0 -51
- package/configs/eslint/presets/prettier.js +0 -1
- package/configs/eslint/presets/react.js +0 -111
- package/configs/eslint/presets/sonar.js +0 -201
- package/configs/eslint/presets/stylistic.js +0 -79
- package/configs/eslint/presets/test.js +0 -87
- package/configs/eslint/presets/typescript.js +0 -198
- package/configs/eslint/presets/unicorn.js +0 -257
- package/configs/prettier/index.js +0 -25
- package/templates/multi-projects/.nvmrc +0 -1
- package/templates/multi-projects/eslint.config.js.tmpl +0 -1
- package/templates/single-project/.nvmrc +0 -1
- package/templates/single-project/eslint.config.js.tmpl +0 -1
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { OxlintConfig } from "oxlint";
|
|
2
|
+
//#region configs/oxlint/index.d.ts
|
|
3
|
+
declare const config: {
|
|
4
|
+
categories: {
|
|
5
|
+
correctness: "error";
|
|
6
|
+
nursery: "error";
|
|
7
|
+
pedantic: "error";
|
|
8
|
+
perf: "error";
|
|
9
|
+
restriction: "error";
|
|
10
|
+
style: "error";
|
|
11
|
+
suspicious: "error";
|
|
12
|
+
};
|
|
13
|
+
jsPlugins: string[];
|
|
14
|
+
options: {
|
|
15
|
+
denyWarnings: true;
|
|
16
|
+
reportUnusedDisableDirectives: "error";
|
|
17
|
+
respectEslintDisableDirectives: false;
|
|
18
|
+
typeAware: true;
|
|
19
|
+
typeCheck: true;
|
|
20
|
+
};
|
|
21
|
+
overrides: ({
|
|
22
|
+
files: string[];
|
|
23
|
+
rules: {
|
|
24
|
+
"unicorn/require-module-specifiers": "off";
|
|
25
|
+
"typescript/no-unsafe-assignment"?: never;
|
|
26
|
+
"typescript/no-unsafe-call"?: never;
|
|
27
|
+
"typescript/no-unsafe-member-access"?: never;
|
|
28
|
+
"typescript/no-unsafe-return"?: never;
|
|
29
|
+
"vitest/consistent-test-it"?: never;
|
|
30
|
+
"vitest/max-expects"?: never;
|
|
31
|
+
"vitest/no-hooks"?: never;
|
|
32
|
+
"vitest/no-importing-vitest-globals"?: never;
|
|
33
|
+
"vitest/prefer-expect-assertions"?: never;
|
|
34
|
+
"vitest/prefer-to-be-falsy"?: never;
|
|
35
|
+
"vitest/prefer-to-be-truthy"?: never;
|
|
36
|
+
"vitest/require-mock-type-parameters"?: never;
|
|
37
|
+
"vitest/require-test-timeout"?: never;
|
|
38
|
+
"vitest/valid-title"?: never;
|
|
39
|
+
"e18e/prefer-static-regex"?: never;
|
|
40
|
+
"import/no-anonymous-default-export"?: never;
|
|
41
|
+
"import/no-default-export"?: never;
|
|
42
|
+
"react/forbid-component-props"?: never;
|
|
43
|
+
};
|
|
44
|
+
plugins?: never;
|
|
45
|
+
} | {
|
|
46
|
+
files: string[];
|
|
47
|
+
rules: {
|
|
48
|
+
"typescript/no-unsafe-assignment": "off";
|
|
49
|
+
"typescript/no-unsafe-call": "off";
|
|
50
|
+
"typescript/no-unsafe-member-access": "off";
|
|
51
|
+
"typescript/no-unsafe-return": "off";
|
|
52
|
+
"unicorn/require-module-specifiers"?: never;
|
|
53
|
+
"vitest/consistent-test-it"?: never;
|
|
54
|
+
"vitest/max-expects"?: never;
|
|
55
|
+
"vitest/no-hooks"?: never;
|
|
56
|
+
"vitest/no-importing-vitest-globals"?: never;
|
|
57
|
+
"vitest/prefer-expect-assertions"?: never;
|
|
58
|
+
"vitest/prefer-to-be-falsy"?: never;
|
|
59
|
+
"vitest/prefer-to-be-truthy"?: never;
|
|
60
|
+
"vitest/require-mock-type-parameters"?: never;
|
|
61
|
+
"vitest/require-test-timeout"?: never;
|
|
62
|
+
"vitest/valid-title"?: never;
|
|
63
|
+
"e18e/prefer-static-regex"?: never;
|
|
64
|
+
"import/no-anonymous-default-export"?: never;
|
|
65
|
+
"import/no-default-export"?: never;
|
|
66
|
+
"react/forbid-component-props"?: never;
|
|
67
|
+
};
|
|
68
|
+
plugins?: never;
|
|
69
|
+
} | {
|
|
70
|
+
files: string[];
|
|
71
|
+
plugins: "vitest"[];
|
|
72
|
+
rules: {
|
|
73
|
+
"vitest/consistent-test-it": ["error", {
|
|
74
|
+
fn: "test";
|
|
75
|
+
withinDescribe: "test";
|
|
76
|
+
}];
|
|
77
|
+
"vitest/max-expects": "off";
|
|
78
|
+
"vitest/no-hooks": "off";
|
|
79
|
+
"vitest/no-importing-vitest-globals": "off";
|
|
80
|
+
"vitest/prefer-expect-assertions": "off";
|
|
81
|
+
"vitest/prefer-to-be-falsy": "off";
|
|
82
|
+
"vitest/prefer-to-be-truthy": "off";
|
|
83
|
+
"vitest/require-mock-type-parameters": "off";
|
|
84
|
+
"vitest/require-test-timeout": "off";
|
|
85
|
+
"vitest/valid-title": ["error", {
|
|
86
|
+
allowArguments: boolean;
|
|
87
|
+
mustMatch: {
|
|
88
|
+
test: string[];
|
|
89
|
+
};
|
|
90
|
+
}];
|
|
91
|
+
"unicorn/require-module-specifiers"?: never;
|
|
92
|
+
"typescript/no-unsafe-assignment"?: never;
|
|
93
|
+
"typescript/no-unsafe-call"?: never;
|
|
94
|
+
"typescript/no-unsafe-member-access"?: never;
|
|
95
|
+
"typescript/no-unsafe-return"?: never;
|
|
96
|
+
"e18e/prefer-static-regex"?: never;
|
|
97
|
+
"import/no-anonymous-default-export"?: never;
|
|
98
|
+
"import/no-default-export"?: never;
|
|
99
|
+
"react/forbid-component-props"?: never;
|
|
100
|
+
};
|
|
101
|
+
} | {
|
|
102
|
+
files: string[];
|
|
103
|
+
rules: {
|
|
104
|
+
"e18e/prefer-static-regex": "off";
|
|
105
|
+
"import/no-anonymous-default-export": "off";
|
|
106
|
+
"import/no-default-export": "off";
|
|
107
|
+
"react/forbid-component-props": "off";
|
|
108
|
+
"unicorn/require-module-specifiers"?: never;
|
|
109
|
+
"typescript/no-unsafe-assignment"?: never;
|
|
110
|
+
"typescript/no-unsafe-call"?: never;
|
|
111
|
+
"typescript/no-unsafe-member-access"?: never;
|
|
112
|
+
"typescript/no-unsafe-return"?: never;
|
|
113
|
+
"vitest/consistent-test-it"?: never;
|
|
114
|
+
"vitest/max-expects"?: never;
|
|
115
|
+
"vitest/no-hooks"?: never;
|
|
116
|
+
"vitest/no-importing-vitest-globals"?: never;
|
|
117
|
+
"vitest/prefer-expect-assertions"?: never;
|
|
118
|
+
"vitest/prefer-to-be-falsy"?: never;
|
|
119
|
+
"vitest/prefer-to-be-truthy"?: never;
|
|
120
|
+
"vitest/require-mock-type-parameters"?: never;
|
|
121
|
+
"vitest/require-test-timeout"?: never;
|
|
122
|
+
"vitest/valid-title"?: never;
|
|
123
|
+
};
|
|
124
|
+
plugins?: never;
|
|
125
|
+
})[];
|
|
126
|
+
plugins: ("eslint" | "react" | "unicorn" | "typescript" | "oxc" | "import" | "jsdoc" | "jsx-a11y" | "promise" | "node")[];
|
|
127
|
+
rules: {
|
|
128
|
+
"@stylistic/jsx-pascal-case": "error";
|
|
129
|
+
"@stylistic/jsx-self-closing-comp": "error";
|
|
130
|
+
"@stylistic/lines-between-class-members": "error";
|
|
131
|
+
"@stylistic/multiline-comment-style": "error";
|
|
132
|
+
"@stylistic/padded-blocks": ["error", string];
|
|
133
|
+
"@stylistic/padding-line-between-statements": ["error", {
|
|
134
|
+
blankLine: string;
|
|
135
|
+
next: string;
|
|
136
|
+
prev: string;
|
|
137
|
+
}, {
|
|
138
|
+
blankLine: string;
|
|
139
|
+
next: string[];
|
|
140
|
+
prev: string[];
|
|
141
|
+
}, {
|
|
142
|
+
blankLine: string;
|
|
143
|
+
next: string[];
|
|
144
|
+
prev: string[];
|
|
145
|
+
}, {
|
|
146
|
+
blankLine: string;
|
|
147
|
+
next: string[];
|
|
148
|
+
prev: string[];
|
|
149
|
+
}, {
|
|
150
|
+
blankLine: string;
|
|
151
|
+
next: string[];
|
|
152
|
+
prev: string[];
|
|
153
|
+
}, {
|
|
154
|
+
blankLine: string;
|
|
155
|
+
next: string[];
|
|
156
|
+
prev: string[];
|
|
157
|
+
}, {
|
|
158
|
+
blankLine: string;
|
|
159
|
+
next: string[];
|
|
160
|
+
prev: string[];
|
|
161
|
+
}, {
|
|
162
|
+
blankLine: string;
|
|
163
|
+
next: string;
|
|
164
|
+
prev: string;
|
|
165
|
+
}, {
|
|
166
|
+
blankLine: string;
|
|
167
|
+
next: string[];
|
|
168
|
+
prev: string[];
|
|
169
|
+
}, {
|
|
170
|
+
blankLine: string;
|
|
171
|
+
next: string;
|
|
172
|
+
prev: string[];
|
|
173
|
+
}];
|
|
174
|
+
"@stylistic/quotes": ["error", string, {
|
|
175
|
+
allowTemplateLiterals: string;
|
|
176
|
+
avoidEscape: boolean;
|
|
177
|
+
}];
|
|
178
|
+
"@stylistic/spaced-comment": "error";
|
|
179
|
+
"arrow-body-style": ["error", "always"];
|
|
180
|
+
"class-methods-use-this": "off";
|
|
181
|
+
"id-length": "off";
|
|
182
|
+
"import/exports-last": "off";
|
|
183
|
+
"import/group-exports": "off";
|
|
184
|
+
"import/max-dependencies": "off";
|
|
185
|
+
"import/no-dynamic-require": "off";
|
|
186
|
+
"import/no-named-export": "off";
|
|
187
|
+
"import/no-nodejs-modules": "off";
|
|
188
|
+
"import/no-relative-parent-imports": "off";
|
|
189
|
+
"import/prefer-default-export": "off";
|
|
190
|
+
"import/unambiguous": "off";
|
|
191
|
+
"init-declarations": "off";
|
|
192
|
+
"jsdoc/require-param-type": "off";
|
|
193
|
+
"jsdoc/require-property-type": "off";
|
|
194
|
+
"jsdoc/require-returns-type": "off";
|
|
195
|
+
"max-classes-per-file": "off";
|
|
196
|
+
"max-lines": "off";
|
|
197
|
+
"max-lines-per-function": "off";
|
|
198
|
+
"max-params": "off";
|
|
199
|
+
"max-statements": "off";
|
|
200
|
+
"nextjs/google-font-display": "error";
|
|
201
|
+
"nextjs/google-font-preconnect": "error";
|
|
202
|
+
"nextjs/no-sync-scripts": "error";
|
|
203
|
+
"nextjs/no-unwanted-polyfillio": "error";
|
|
204
|
+
"no-async-await": "off";
|
|
205
|
+
"no-await-in-loop": "off";
|
|
206
|
+
"no-bitwise": "off";
|
|
207
|
+
"no-console": "off";
|
|
208
|
+
"no-continue": "off";
|
|
209
|
+
"no-duplicate-imports": ["error", {
|
|
210
|
+
allowSeparateTypeImports: true;
|
|
211
|
+
}];
|
|
212
|
+
"no-inline-comments": "off";
|
|
213
|
+
"no-magic-numbers": "off";
|
|
214
|
+
"no-optional-chaining": "off";
|
|
215
|
+
"no-param-reassign": "off";
|
|
216
|
+
"no-rest-spread-properties": "off";
|
|
217
|
+
"no-ternary": "off";
|
|
218
|
+
"no-undef": "off";
|
|
219
|
+
"no-undefined": "off";
|
|
220
|
+
"no-underscore-dangle": "off";
|
|
221
|
+
"no-use-before-define": "off";
|
|
222
|
+
"no-useless-return": "off";
|
|
223
|
+
"no-void": "off";
|
|
224
|
+
"no-warning-comments": "off";
|
|
225
|
+
"node/no-process-env": "off";
|
|
226
|
+
"node/no-sync": "off";
|
|
227
|
+
"node/no-top-level-await": ["error", {
|
|
228
|
+
ignoreBin: true;
|
|
229
|
+
}];
|
|
230
|
+
"oxc/no-async-endpoint-handlers": "off";
|
|
231
|
+
"perfectionist/sort-imports": "off";
|
|
232
|
+
"perfectionist/sort-named-imports": "off";
|
|
233
|
+
"prefer-named-capture-group": "off";
|
|
234
|
+
"prefer-readonly-parameter-types": "off";
|
|
235
|
+
"promise/avoid-new": "off";
|
|
236
|
+
"react/function-component-definition": "off";
|
|
237
|
+
"react/jsx-filename-extension": ["error", {
|
|
238
|
+
extensions: string[];
|
|
239
|
+
}];
|
|
240
|
+
"react/jsx-max-depth": "off";
|
|
241
|
+
"react/jsx-no-literals": "off";
|
|
242
|
+
"react/jsx-props-no-spreading": "off";
|
|
243
|
+
"react/no-multi-comp": "off";
|
|
244
|
+
"react/prefer-function-component": ["error", {
|
|
245
|
+
allowErrorBoundary: true;
|
|
246
|
+
allowJsxUtilityClass: true;
|
|
247
|
+
}];
|
|
248
|
+
"react/react-in-jsx-scope": "off";
|
|
249
|
+
"require-await": "off";
|
|
250
|
+
"sort-imports": "off";
|
|
251
|
+
"sort-keys": "off";
|
|
252
|
+
"sort-vars": "off";
|
|
253
|
+
"strict-boolean-expressions": "off";
|
|
254
|
+
"typescript/ban-types": "off";
|
|
255
|
+
"typescript/consistent-return": "off";
|
|
256
|
+
"typescript/consistent-type-definitions": ["error", "type"];
|
|
257
|
+
"typescript/explicit-function-return-type": "off";
|
|
258
|
+
"typescript/explicit-module-boundary-types": "off";
|
|
259
|
+
"typescript/no-unsafe-type-assertion": "off";
|
|
260
|
+
"typescript/non-nullable-type-assertion-style": "off";
|
|
261
|
+
"unicorn/filename-case": "off";
|
|
262
|
+
"unicorn/import-style": "off";
|
|
263
|
+
"unicorn/no-array-for-each": "off";
|
|
264
|
+
"unicorn/no-array-reduce": "off";
|
|
265
|
+
"unicorn/no-useless-switch-case": "off";
|
|
266
|
+
"unicorn/no-useless-undefined": "off";
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
declare const createConfig: ({ ignorePatterns }: Required<Pick<OxlintConfig, "ignorePatterns">>) => OxlintConfig;
|
|
270
|
+
//#endregion
|
|
271
|
+
export { createConfig, config as default };
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import e18ePlugin from "@e18e/eslint-plugin";
|
|
2
|
+
import { configs } from "eslint-plugin-perfectionist";
|
|
3
|
+
import { defineConfig } from "oxlint";
|
|
4
|
+
|
|
5
|
+
//#region configs/oxlint/index.ts
|
|
6
|
+
const JAVASCRIPT_EXTENSIONS = [
|
|
7
|
+
"js",
|
|
8
|
+
"jsx",
|
|
9
|
+
"cjs",
|
|
10
|
+
"mjs",
|
|
11
|
+
"mjsx"
|
|
12
|
+
];
|
|
13
|
+
const JAVASCRIPT_FILES = [`**/*.{${JAVASCRIPT_EXTENSIONS.join(",")}}`];
|
|
14
|
+
const TYPESCRIPT_EXTENSIONS = [
|
|
15
|
+
"ts",
|
|
16
|
+
"tsx",
|
|
17
|
+
"cts",
|
|
18
|
+
"mts",
|
|
19
|
+
"mtsx"
|
|
20
|
+
];
|
|
21
|
+
const JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING = [...JAVASCRIPT_EXTENSIONS, ...TYPESCRIPT_EXTENSIONS].join(",");
|
|
22
|
+
const TEST_LIKE_FILES = [`**/{test,test-d}.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`, `**/*.{test,test-d}.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`];
|
|
23
|
+
const config = defineConfig({
|
|
24
|
+
categories: {
|
|
25
|
+
correctness: "error",
|
|
26
|
+
nursery: "error",
|
|
27
|
+
pedantic: "error",
|
|
28
|
+
perf: "error",
|
|
29
|
+
restriction: "error",
|
|
30
|
+
style: "error",
|
|
31
|
+
suspicious: "error"
|
|
32
|
+
},
|
|
33
|
+
jsPlugins: [
|
|
34
|
+
"@e18e/eslint-plugin",
|
|
35
|
+
"@stylistic/eslint-plugin",
|
|
36
|
+
"eslint-plugin-perfectionist"
|
|
37
|
+
],
|
|
38
|
+
options: {
|
|
39
|
+
denyWarnings: true,
|
|
40
|
+
reportUnusedDisableDirectives: "error",
|
|
41
|
+
respectEslintDisableDirectives: false,
|
|
42
|
+
typeAware: true,
|
|
43
|
+
typeCheck: true
|
|
44
|
+
},
|
|
45
|
+
overrides: [
|
|
46
|
+
{
|
|
47
|
+
files: ["**/*.d.ts"],
|
|
48
|
+
rules: { "unicorn/require-module-specifiers": "off" }
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
files: JAVASCRIPT_FILES,
|
|
52
|
+
rules: {
|
|
53
|
+
"typescript/no-unsafe-assignment": "off",
|
|
54
|
+
"typescript/no-unsafe-call": "off",
|
|
55
|
+
"typescript/no-unsafe-member-access": "off",
|
|
56
|
+
"typescript/no-unsafe-return": "off"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
files: TEST_LIKE_FILES,
|
|
61
|
+
plugins: ["vitest"],
|
|
62
|
+
rules: {
|
|
63
|
+
"vitest/consistent-test-it": ["error", {
|
|
64
|
+
fn: "test",
|
|
65
|
+
withinDescribe: "test"
|
|
66
|
+
}],
|
|
67
|
+
"vitest/max-expects": "off",
|
|
68
|
+
"vitest/no-hooks": "off",
|
|
69
|
+
"vitest/no-importing-vitest-globals": "off",
|
|
70
|
+
"vitest/prefer-expect-assertions": "off",
|
|
71
|
+
"vitest/prefer-to-be-falsy": "off",
|
|
72
|
+
"vitest/prefer-to-be-truthy": "off",
|
|
73
|
+
"vitest/require-mock-type-parameters": "off",
|
|
74
|
+
"vitest/require-test-timeout": "off",
|
|
75
|
+
"vitest/valid-title": ["error", {
|
|
76
|
+
allowArguments: true,
|
|
77
|
+
mustMatch: { test: ["^should "] }
|
|
78
|
+
}]
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
files: [
|
|
83
|
+
...TEST_LIKE_FILES,
|
|
84
|
+
"**/.config/**",
|
|
85
|
+
"**/.configs/**",
|
|
86
|
+
"**/config/**",
|
|
87
|
+
"**/configs/**",
|
|
88
|
+
"**/examples/**",
|
|
89
|
+
"**/scripts/**",
|
|
90
|
+
"**/tools/**",
|
|
91
|
+
`**/config.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
92
|
+
`**/configs.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
93
|
+
`**/*.config.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
94
|
+
`**/*.configs.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
95
|
+
`**/stories.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
|
|
96
|
+
`**/*.stories.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`
|
|
97
|
+
],
|
|
98
|
+
rules: {
|
|
99
|
+
"e18e/prefer-static-regex": "off",
|
|
100
|
+
"import/no-anonymous-default-export": "off",
|
|
101
|
+
"import/no-default-export": "off",
|
|
102
|
+
"react/forbid-component-props": "off"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
plugins: [
|
|
107
|
+
"eslint",
|
|
108
|
+
"import",
|
|
109
|
+
"jsdoc",
|
|
110
|
+
"jsx-a11y",
|
|
111
|
+
"node",
|
|
112
|
+
"oxc",
|
|
113
|
+
"promise",
|
|
114
|
+
"react",
|
|
115
|
+
"typescript",
|
|
116
|
+
"unicorn"
|
|
117
|
+
],
|
|
118
|
+
rules: {
|
|
119
|
+
...e18ePlugin.configs.recommended.rules,
|
|
120
|
+
...configs["recommended-natural"].rules,
|
|
121
|
+
...Object.fromEntries([
|
|
122
|
+
"sort-export-attributes",
|
|
123
|
+
"sort-import-attributes",
|
|
124
|
+
"sort-interfaces",
|
|
125
|
+
"sort-jsx-props",
|
|
126
|
+
"sort-maps",
|
|
127
|
+
"sort-object-types",
|
|
128
|
+
"sort-objects",
|
|
129
|
+
"sort-union-types",
|
|
130
|
+
"sort-variable-declarations"
|
|
131
|
+
].map((ruleName) => {
|
|
132
|
+
return [`perfectionist/${ruleName}`, ["error", {
|
|
133
|
+
customGroups: [
|
|
134
|
+
{
|
|
135
|
+
elementNamePattern: "^(as|children|id|identifier|htmlFor|key|ref)$",
|
|
136
|
+
groupName: "id-like"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
elementNamePattern: "^(label|name|title)$",
|
|
140
|
+
groupName: "name-like"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
elementNamePattern: "^(description|metadata)$",
|
|
144
|
+
groupName: "metadata-like"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
groups: [
|
|
148
|
+
"id-like",
|
|
149
|
+
"name-like",
|
|
150
|
+
"metadata-like",
|
|
151
|
+
"unknown"
|
|
152
|
+
],
|
|
153
|
+
type: "natural"
|
|
154
|
+
}]];
|
|
155
|
+
})),
|
|
156
|
+
"@stylistic/jsx-pascal-case": "error",
|
|
157
|
+
"@stylistic/jsx-self-closing-comp": "error",
|
|
158
|
+
"@stylistic/lines-between-class-members": "error",
|
|
159
|
+
"@stylistic/multiline-comment-style": "error",
|
|
160
|
+
"@stylistic/padded-blocks": ["error", "never"],
|
|
161
|
+
"@stylistic/padding-line-between-statements": [
|
|
162
|
+
"error",
|
|
163
|
+
{
|
|
164
|
+
blankLine: "always",
|
|
165
|
+
next: "*",
|
|
166
|
+
prev: "*"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
blankLine: "never",
|
|
170
|
+
next: [
|
|
171
|
+
"singleline-const",
|
|
172
|
+
"singleline-let",
|
|
173
|
+
"singleline-var"
|
|
174
|
+
],
|
|
175
|
+
prev: [
|
|
176
|
+
"singleline-const",
|
|
177
|
+
"singleline-let",
|
|
178
|
+
"singleline-var"
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
blankLine: "never",
|
|
183
|
+
next: ["singleline-export"],
|
|
184
|
+
prev: ["singleline-export"]
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
blankLine: "never",
|
|
188
|
+
next: ["cjs-export"],
|
|
189
|
+
prev: ["cjs-export"]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
blankLine: "never",
|
|
193
|
+
next: ["singleline-expression"],
|
|
194
|
+
prev: ["singleline-expression"]
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
blankLine: "never",
|
|
198
|
+
next: ["import"],
|
|
199
|
+
prev: ["import"]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
blankLine: "never",
|
|
203
|
+
next: ["cjs-import"],
|
|
204
|
+
prev: ["cjs-import"]
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
blankLine: "never",
|
|
208
|
+
next: "directive",
|
|
209
|
+
prev: "directive"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
blankLine: "never",
|
|
213
|
+
next: ["case", "default"],
|
|
214
|
+
prev: ["case", "default"]
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
blankLine: "never",
|
|
218
|
+
next: "*",
|
|
219
|
+
prev: ["case", "default"]
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
"@stylistic/quotes": [
|
|
223
|
+
"error",
|
|
224
|
+
"double",
|
|
225
|
+
{
|
|
226
|
+
allowTemplateLiterals: "avoidEscape",
|
|
227
|
+
avoidEscape: true
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"@stylistic/spaced-comment": "error",
|
|
231
|
+
"arrow-body-style": ["error", "always"],
|
|
232
|
+
"class-methods-use-this": "off",
|
|
233
|
+
"id-length": "off",
|
|
234
|
+
"import/exports-last": "off",
|
|
235
|
+
"import/group-exports": "off",
|
|
236
|
+
"import/max-dependencies": "off",
|
|
237
|
+
"import/no-dynamic-require": "off",
|
|
238
|
+
"import/no-named-export": "off",
|
|
239
|
+
"import/no-nodejs-modules": "off",
|
|
240
|
+
"import/no-relative-parent-imports": "off",
|
|
241
|
+
"import/prefer-default-export": "off",
|
|
242
|
+
"import/unambiguous": "off",
|
|
243
|
+
"init-declarations": "off",
|
|
244
|
+
"jsdoc/require-param-type": "off",
|
|
245
|
+
"jsdoc/require-property-type": "off",
|
|
246
|
+
"jsdoc/require-returns-type": "off",
|
|
247
|
+
"max-classes-per-file": "off",
|
|
248
|
+
"max-lines": "off",
|
|
249
|
+
"max-lines-per-function": "off",
|
|
250
|
+
"max-params": "off",
|
|
251
|
+
"max-statements": "off",
|
|
252
|
+
"nextjs/google-font-display": "error",
|
|
253
|
+
"nextjs/google-font-preconnect": "error",
|
|
254
|
+
"nextjs/no-sync-scripts": "error",
|
|
255
|
+
"nextjs/no-unwanted-polyfillio": "error",
|
|
256
|
+
"no-async-await": "off",
|
|
257
|
+
"no-await-in-loop": "off",
|
|
258
|
+
"no-bitwise": "off",
|
|
259
|
+
"no-console": "off",
|
|
260
|
+
"no-continue": "off",
|
|
261
|
+
"no-duplicate-imports": ["error", { allowSeparateTypeImports: true }],
|
|
262
|
+
"no-inline-comments": "off",
|
|
263
|
+
"no-magic-numbers": "off",
|
|
264
|
+
"no-optional-chaining": "off",
|
|
265
|
+
"no-param-reassign": "off",
|
|
266
|
+
"no-rest-spread-properties": "off",
|
|
267
|
+
"no-ternary": "off",
|
|
268
|
+
"no-undef": "off",
|
|
269
|
+
"no-undefined": "off",
|
|
270
|
+
"no-underscore-dangle": "off",
|
|
271
|
+
"no-use-before-define": "off",
|
|
272
|
+
"no-useless-return": "off",
|
|
273
|
+
"no-void": "off",
|
|
274
|
+
"no-warning-comments": "off",
|
|
275
|
+
"node/no-process-env": "off",
|
|
276
|
+
"node/no-sync": "off",
|
|
277
|
+
"node/no-top-level-await": ["error", { ignoreBin: true }],
|
|
278
|
+
"oxc/no-async-endpoint-handlers": "off",
|
|
279
|
+
"perfectionist/sort-imports": "off",
|
|
280
|
+
"perfectionist/sort-named-imports": "off",
|
|
281
|
+
"prefer-named-capture-group": "off",
|
|
282
|
+
"prefer-readonly-parameter-types": "off",
|
|
283
|
+
"promise/avoid-new": "off",
|
|
284
|
+
"react/function-component-definition": "off",
|
|
285
|
+
"react/jsx-filename-extension": ["error", { extensions: ["jsx", "tsx"] }],
|
|
286
|
+
"react/jsx-max-depth": "off",
|
|
287
|
+
"react/jsx-no-literals": "off",
|
|
288
|
+
"react/jsx-props-no-spreading": "off",
|
|
289
|
+
"react/no-multi-comp": "off",
|
|
290
|
+
"react/prefer-function-component": ["error", {
|
|
291
|
+
allowErrorBoundary: true,
|
|
292
|
+
allowJsxUtilityClass: true
|
|
293
|
+
}],
|
|
294
|
+
"react/react-in-jsx-scope": "off",
|
|
295
|
+
"require-await": "off",
|
|
296
|
+
"sort-imports": "off",
|
|
297
|
+
"sort-keys": "off",
|
|
298
|
+
"sort-vars": "off",
|
|
299
|
+
"strict-boolean-expressions": "off",
|
|
300
|
+
"typescript/ban-types": "off",
|
|
301
|
+
"typescript/consistent-return": "off",
|
|
302
|
+
"typescript/consistent-type-definitions": ["error", "type"],
|
|
303
|
+
"typescript/explicit-function-return-type": "off",
|
|
304
|
+
"typescript/explicit-module-boundary-types": "off",
|
|
305
|
+
"typescript/no-unsafe-type-assertion": "off",
|
|
306
|
+
"typescript/non-nullable-type-assertion-style": "off",
|
|
307
|
+
"unicorn/filename-case": "off",
|
|
308
|
+
"unicorn/import-style": "off",
|
|
309
|
+
"unicorn/no-array-for-each": "off",
|
|
310
|
+
"unicorn/no-array-reduce": "off",
|
|
311
|
+
"unicorn/no-useless-switch-case": "off",
|
|
312
|
+
"unicorn/no-useless-undefined": "off"
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
const createConfig = ({ ignorePatterns }) => {
|
|
316
|
+
return {
|
|
317
|
+
...config,
|
|
318
|
+
ignorePatterns
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
//#endregion
|
|
323
|
+
export { createConfig, config as default };
|