From aed0b234e155f85eb1c3df694f47b6f931f53d43 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Tue, 27 Oct 2020 03:16:40 -0400 Subject: [PATCH] change: by default lint all dirs, not just src and test - BREAKING: change the default lint args from 'src test' to './' - this is the same arg that's used internally and there isn't really a reason to skip some files arbitrarily; it's best practice to lint everything - this also lines up with changes to make `tsc` type-check all files, instead of just 'src' and 'types' --- src/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index c9b0399eb..ff4cdfdec 100755 --- a/src/index.ts +++ b/src/index.ts @@ -540,17 +540,17 @@ prog prog .command('lint') .describe('Run eslint with Prettier') - .example('lint src test') + .example('lint ./') .option('--fix', 'Fixes fixable errors and warnings') - .example('lint src test --fix') + .example('lint ./ --fix') .option('--ignore-pattern', 'Ignore a pattern') - .example('lint src test --ignore-pattern test/foobar.ts') + .example('lint ./ --ignore-pattern test/foobar.ts') .option( '--max-warnings', 'Exits with non-zero error code if number of warnings exceed this number', Infinity ) - .example('lint src test --max-warnings 10') + .example('lint ./ --max-warnings 10') .option('--write-file', 'Write the config file locally') .example('lint --write-file') .option('--report-file', 'Write JSON report to file locally') @@ -565,11 +565,11 @@ prog _: string[]; }) => { if (opts['_'].length === 0 && !opts['write-file']) { - const defaultInputs = ['src', 'test'].filter(fs.existsSync); + const defaultInputs = ['./']; opts['_'] = defaultInputs; console.log( chalk.yellow( - `Defaulting to "tsdx lint ${defaultInputs.join(' ')}"`, + `Defaulting to "tsdx lint ${defaultInputs}"`, '\nYou can override this in the package.json scripts, like "lint": "tsdx lint src otherDir"' ) );