-
-
Notifications
You must be signed in to change notification settings - Fork 280
Expand file tree
/
Copy pathrstack.config.ts
More file actions
61 lines (58 loc) · 1.97 KB
/
Copy pathrstack.config.ts
File metadata and controls
61 lines (58 loc) · 1.97 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
import { define } from 'rstack';
import skillsLock from './skills-lock.json' with { type: 'json' };
define.fmt({
singleQuote: true,
sortPackageJson: true,
ignorePatterns: [
// Avoid parser errors in intentionally invalid or unsupported fixtures.
'e2e/cases/plugin-less/inline-js/src/*.less',
'e2e/cases/browser-logs/skip-build-error/src/**',
'e2e/cases/syntax-es/using-declaration/src/index.ts',
// Preserve uppercase DOCTYPE in create-rsbuild templates.
'packages/create-rsbuild/**/*.html',
// Ignore installed Skills because their formatting may differ from this repository.
...Object.keys(skillsLock.skills).map((name) => `.agents/skills/${name}`),
],
plugins: ['heading-case'],
});
define.staged({
'*.{md,mdx,json,css,less,scss}': 'rs fmt',
'*.{js,jsx,ts,tsx,mjs,cjs}': ['rs lint --type-check', 'rs fmt'],
});
define.lint(({ globalIgnores, importPlugin, js, rstestPlugin, ts }) => [
globalIgnores([
'e2e/cases/browser-logs/skip-build-error/src/index.js',
'e2e/cases/wasm/wasm-source-import/src/index.js',
]),
js.configs.recommended,
importPlugin.configs.recommended,
ts.configs.recommendedTypeChecked,
{
files: ['**/*.test.{ts,tsx}'],
...rstestPlugin.configs.recommended,
},
{
plugins: ['unicorn'],
languageOptions: {
parserOptions: {
project: [
'./packages/*/tsconfig.json',
'./scripts/*/tsconfig.json',
'./examples/*/tsconfig.json',
'./e2e/tsconfig.json',
'./e2e/type-tests/*/tsconfig.json',
],
},
},
rules: {
// Rslint does not recognize default exports from text imports yet.
// https://github.com/web-infra-dev/rslint/issues/2083
'import/default': 'off',
'import/no-duplicates': 'off',
'unicorn/prefer-array-some': 'error',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
]);