File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,17 +2,22 @@ import { existsSync } from 'node:fs';
22import { join } from 'node:path' ;
33import { loadRstackConfig , type LoadedRstackConfig } from './config.ts' ;
44import type { RslintConfig } from '@rslint/core' ;
5+ import { color , logger } from 'rslog' ;
56
67// Expose the loaded config so `rs check` can pass it to fmt instead of loading
78// and executing the Rstack config a second time.
89export const loadedConfig : LoadedRstackConfig = await loadRstackConfig ( ) ;
910const { configs } = loadedConfig ;
10- const lintDefinition = configs . lint ?? [ ] ;
11+ const lintDefinition = configs . lint ;
1112
1213let lintConfig : RslintConfig ;
1314
14- // TODO: support function in Rslint core
15- if ( typeof lintDefinition === 'function' ) {
15+ if ( lintDefinition === undefined ) {
16+ logger . error (
17+ `No lint configuration found. Add ${ color . cyan ( 'define.lint(...)' ) } to your Rstack config file.` ,
18+ ) ;
19+ process . exit ( 1 ) ;
20+ } else if ( typeof lintDefinition === 'function' ) {
1621 lintConfig = await lintDefinition ( ) ;
1722} else {
1823 lintConfig = lintDefinition ;
You can’t perform that action at this time.
0 commit comments