-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrstack.config.ts
More file actions
73 lines (70 loc) · 1.85 KB
/
Copy pathrstack.config.ts
File metadata and controls
73 lines (70 loc) · 1.85 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
// Rstack configuration guide: https://rstack.rs/config
import { define } from 'rstack';
define.lint(async () => {
const { default: globals } = await import('globals');
const { js, ts } = await import('rstack/lint');
return [
js.configs.recommended,
ts.configs.recommended,
{
files: ['**/*.{js,jsx,cjs,mjs}'],
languageOptions: {
globals: {
...globals.browser,
...globals.nodeBuiltin,
DEFINE_APP_TEST_VALUE: 'readonly',
DEFINE_LIB_TEST_VALUE: 'readonly',
DEFINE_VALUE: 'readonly',
},
},
},
// Source imports use .ts for Node.js native TypeScript execution; builds rewrite them to .js.
{
files: ['packages/rstack/src/**/*.ts'],
rules: {
'@typescript-eslint/no-restricted-imports': [
'error',
{
patterns: [
{
regex: String.raw`^\.{1,2}/.*\.js$`,
message: 'Use the .ts extension for relative imports.',
},
],
},
],
},
},
{
languageOptions: {
parserOptions: {
project: [
'./packages/*/tsconfig.json',
'./packages/*/tests/tsconfig.json',
'./packages/rstack/tests/types/*/tsconfig.json',
'./examples/*/tsconfig.json',
'./website/tsconfig.json',
],
},
},
},
];
});
define.fmt({
ignorePatterns: ['packages/rstack/binding.cjs', 'packages/rstack/binding.d.cts'],
overrides: [
{
files: 'packages/create-rstack/template-*/**/*',
options: {
printWidth: 80,
},
},
],
printWidth: 100,
singleQuote: true,
sortPackageJson: true,
});
define.staged({
'*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}': ['rs lint --fix', 'rs fmt'],
'*.{json,jsonc,md,mdx,css,html,yml,yaml}': 'rs fmt',
});