Skip to content

Commit d4b5c10

Browse files
committed
chore: clean up lint configuration
1 parent 3764bf6 commit d4b5c10

1 file changed

Lines changed: 40 additions & 54 deletions

File tree

‎rstack.config.ts‎

Lines changed: 40 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,51 @@
22
import { define } from 'rstack';
33
import skillsLock from './skills-lock.json' with { type: 'json' };
44

5-
define.lint(({ globals, js, ts, rstestPlugin }) => {
6-
return [
7-
js.configs.recommended,
8-
ts.configs.recommendedTypeChecked,
9-
{
10-
files: ['**/*.{js,jsx,cjs,mjs}'],
11-
languageOptions: {
12-
globals: {
13-
...globals.browser,
14-
...globals.nodeBuiltin,
15-
DEFINE_APP_TEST_VALUE: 'readonly',
16-
DEFINE_LIB_TEST_VALUE: 'readonly',
17-
DEFINE_VALUE: 'readonly',
18-
},
19-
},
20-
},
21-
{
22-
files: ['**/*.test.{ts,tsx}'],
23-
...rstestPlugin.configs.recommended,
24-
rules: {
25-
'rstest/expect-expect': ['error', { assertFunctionNames: ['expect*'] }],
26-
'rstest/no-standalone-expect': [
27-
'error',
28-
{ additionalTestBlockFunctions: ['test'] },
29-
],
30-
},
5+
define.lint(({ js, ts, rstestPlugin }) => [
6+
js.configs.recommended,
7+
ts.configs.recommendedTypeChecked,
8+
{
9+
files: ['**/*.test.{ts,tsx}'],
10+
...rstestPlugin.configs.recommended,
11+
rules: {
12+
'rstest/expect-expect': ['error', { assertFunctionNames: ['expect*'] }],
13+
'rstest/no-standalone-expect': [
14+
'error',
15+
{ additionalTestBlockFunctions: ['test'] },
16+
],
3117
},
32-
// Source imports use .ts for Node.js native TypeScript execution; builds rewrite them to .js.
33-
{
34-
files: ['packages/rstack/src/**/*.ts'],
35-
rules: {
36-
'@typescript-eslint/no-restricted-imports': [
37-
'error',
38-
{
39-
patterns: [
40-
{
41-
regex: String.raw`^\.{1,2}/.*\.js$`,
42-
message: 'Use the .ts extension for relative imports.',
43-
},
44-
],
45-
},
46-
],
47-
},
48-
},
49-
{
50-
languageOptions: {
51-
parserOptions: {
52-
project: [
53-
'./packages/*/tsconfig.json',
54-
'./packages/*/tests/tsconfig.json',
55-
'./packages/rstack/tests/types/*/tsconfig.json',
56-
'./examples/*/tsconfig.json',
57-
'./website/tsconfig.json',
18+
},
19+
// Source imports use .ts for Node.js native TypeScript execution; builds rewrite them to .js.
20+
{
21+
files: ['packages/rstack/src/**/*.ts'],
22+
rules: {
23+
'@typescript-eslint/no-restricted-imports': [
24+
'error',
25+
{
26+
patterns: [
27+
{
28+
regex: String.raw`^\.{1,2}/.*\.js$`,
29+
message: 'Use the .ts extension for relative imports.',
30+
},
5831
],
5932
},
33+
],
34+
},
35+
},
36+
{
37+
languageOptions: {
38+
parserOptions: {
39+
project: [
40+
'./packages/*/tsconfig.json',
41+
'./packages/*/tests/tsconfig.json',
42+
'./packages/rstack/tests/types/*/tsconfig.json',
43+
'./examples/*/tsconfig.json',
44+
'./website/tsconfig.json',
45+
],
6046
},
6147
},
62-
];
63-
});
48+
},
49+
]);
6450

6551
define.fmt({
6652
ignorePatterns: [

0 commit comments

Comments
 (0)