Repository navigation
Expand file tree
/
Copy pathrstack.config.ts
More file actions
78 lines (73 loc) · 1.9 KB
/
Copy pathrstack.config.ts
File metadata and controls
78 lines (73 loc) · 1.9 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
74
75
76
77
78
// Configuration guide: https://rstack.rs/config
import { define } from 'rstack';
import type { ProjectConfig } from 'rstack/test';
const commonProjectConfig: ProjectConfig = {
globals: true,
testTimeout: process.env.CI ? 60000 : 30000,
snapshotFormat: {
escapeString: true,
printBasicPrototype: true,
},
env: {
UPDATE_SNAPSHOT:
process.argv.includes('-u') || process.argv.includes('--updateSnapshot')
? 'true'
: undefined,
},
};
define.test({
projects: [
{
extends: commonProjectConfig,
name: 'node',
include: ['**/*.test.js', '**/*.test.mjs', '**/*.test.ts'],
exclude: ['**/css-extract/HMR.test.js'],
testEnvironment: 'node',
},
{
extends: commonProjectConfig,
name: 'jsdom',
include: ['**/css-extract/HMR.test.js'],
testEnvironment: 'jsdom',
},
],
});
define.lint(({ js, ts }) => [
js.configs.recommended,
ts.configs.recommended,
{
files: ['css-extract/cases/**/expected/**/*.js'],
rules: {
'no-constant-condition': 'off',
'no-useless-escape': 'off',
},
},
{
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-unnecessary-type-constraint': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'no-redeclare': 'off',
'no-useless-assignment': 'off',
'preserve-caught-error': 'off',
},
},
]);
define.fmt({
singleQuote: true,
sortPackageJson: true,
// Keep upstream fixtures, examples, and expected output unchanged.
ignorePatterns: [
'**/__fixtures__/**',
'**/__snapshots__/**',
'**/fixtures/**',
'css-extract/cases/**',
'css-extract/manual/**',
'sri-plugin/examples/**',
],
});
define.staged({
'*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}': ['rs lint', 'rs fmt'],
'*.{json,jsonc,md,mdx,css,scss,less,html,yml,yaml}': 'rs fmt',
});