Skip to content

Commit

Permalink
fix: drop shell for lint
Browse files Browse the repository at this point in the history
we can node it ourselves; triggered by nodejs/node#29532
  • Loading branch information
Artoria2e5 authored and Jack-Works committed Sep 16, 2019
1 parent f550344 commit d393c1d
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions scripts/lint.js
Expand Up @@ -8,20 +8,30 @@ process.chdir(base)
const reportOnly = argv.reportOnly

;(async () => {
!argv.noEslint
? await spawn('eslint', [
'--ignore-path',
'.prettierignore',
'--ext',
'tsx,ts,jsx,js',
...(argv._.length ? argv._ : ['./src/']),
...(reportOnly ? [] : ['--cache', '--fix']),
])
: null
!argv.noPrettier
? await spawn('prettier', [
...(argv._.length ? argv._ : ['./**/*.{ts,tsx,jsx,js}']),
...(reportOnly ? ['--check', '--loglevel', 'log'] : ['--write', '--loglevel', 'warn']),
])
: null
if (!argv.noEslint)
await spawn(
'node',
[
// Guess what happens if you don't do this?
// Path resolution makes a \n, which becomes...
path.join(base, 'node_modules/eslint/bin/eslint.js'),
'--ignore-path',
'.prettierignore',
'--ext',
'tsx,ts,jsx,js',
...(argv._.length ? argv._ : ['./src/']),
...(reportOnly ? [] : ['--cache', '--fix']),
],
{ shell: false },
)
if (!argv.noPrettier)
await spawn(
'node',
[
path.join(base, 'node_modules/prettier/bin-prettier.js'),
...(argv._.length ? argv._ : ['./**/*.{ts,tsx,jsx,js}']),
...(reportOnly ? ['--check', '--loglevel', 'log'] : ['--write', '--loglevel', 'warn']),
],
{ shell: false },
)
})()

0 comments on commit d393c1d

Please sign in to comment.