Repository navigation
Expand file tree
/
Copy pathrstack.config.ts
More file actions
73 lines (69 loc) · 2.2 KB
/
Copy pathrstack.config.ts
File metadata and controls
73 lines (69 loc) · 2.2 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
62
63
64
65
66
67
68
69
70
71
72
73
import { define } from 'rstack';
import skillsLock from './skills-lock.json' with { type: 'json' };
define.test({
pool: 'vmForks',
projects: ['./packages/*/rstack.config.ts'],
});
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',
// Preserve charset attribute syntax in regression fixtures.
'e2e/cases/html/meta/src/{unquoted,spaced}.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,
ts.configs.recommendedTypeChecked,
importPlugin.configs.recommended,
{
files: ['e2e/**', 'examples/**', 'packages/create-rsbuild/template-*/**'],
rules: {
'import/no-unresolved': 'off',
},
},
{
files: ['**/*.test.{ts,tsx}'],
...rstestPlugin.configs.recommended,
},
{
plugins: ['unicorn'],
languageOptions: {
parserOptions: {
projectService: true,
},
},
rules: {
'unicorn/prefer-array-some': 'error',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
// Templates lack installed dependencies, and e2e sources include intentional
// syntax fixtures. Keep ordinary lint rules without requiring type information.
files: ['packages/create-rsbuild/template-*/**', 'e2e/cases/**/src/**'],
languageOptions: {
parserOptions: {
projectService: false,
},
},
},
]);