Skip to content

Commit adb5498

Browse files
authored
Make dreact lint js exiting with correct exit code when eslint find errors (#35)
1 parent c8b543f commit adb5498

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

cli/scripts/lint.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@ const getConfigPath = name => path.resolve(__dirname, '..', 'environment', name)
88
module.exports = function (argv) {
99
if (argv[0] === 'js') {
1010
const configPath = getConfigPath('eslint.config.js')
11-
process.exitCode = eslintCli.execute([
12-
'eslint',
13-
'--no-eslintrc',
14-
'--config',
15-
configPath,
16-
'--ignore-path',
17-
path.resolve(process.cwd(), '.gitignore'),
18-
...argv.slice(1),
19-
'./',
20-
])
11+
12+
;(async function main() {
13+
process.exitCode = await eslintCli.execute([
14+
'eslint',
15+
'--no-eslintrc',
16+
'--config',
17+
configPath,
18+
'--ignore-path',
19+
path.resolve(process.cwd(), '.gitignore'),
20+
...argv.slice(1),
21+
'./',
22+
])
23+
})()
24+
2125
return
2226
}
2327

0 commit comments

Comments
 (0)