|
2 | 2 | import { define } from 'rstack'; |
3 | 3 | import skillsLock from './skills-lock.json' with { type: 'json' }; |
4 | 4 |
|
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 | + ], |
31 | 17 | }, |
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 | + }, |
58 | 31 | ], |
59 | 32 | }, |
| 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 | + ], |
60 | 46 | }, |
61 | 47 | }, |
62 | | - ]; |
63 | | -}); |
| 48 | + }, |
| 49 | +]); |
64 | 50 |
|
65 | 51 | define.fmt({ |
66 | 52 | ignorePatterns: [ |
|
0 commit comments