packages/cli: call eslint directly

This commit is contained in:
Patrik Oldsberg
2020-05-29 10:20:22 +02:00
parent 2fedc2320f
commit 9a6df0bf18
3 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ module.exports = {
ecmaVersion: 2018,
sourceType: 'module',
},
ignorePatterns: ['**/dist/**', '**/build/**'],
ignorePatterns: ['.eslintrc.js', '**/dist/**'],
rules: {
'no-console': 0, // Permitted in console programs
'new-cap': ['error', { capIsNew: false }], // Because Express constructs things e.g. like 'const r = express.Router()'
+1 -1
View File
@@ -39,7 +39,7 @@ module.exports = {
version: 'detect',
},
},
ignorePatterns: ['**/dist/**', '**/build/**'],
ignorePatterns: ['.eslintrc.js', '**/dist/**'],
rules: {
'import/no-duplicates': 'warn',
'import/no-extraneous-dependencies': [
+9 -2
View File
@@ -16,12 +16,19 @@
import { Command } from 'commander';
import { run } from '../lib/run';
import { paths } from '../lib/paths';
export default async (cmd: Command) => {
const args = ['lint', '--max-warnings=0', '--format=codeframe'];
const args = [
'--ext',
'js,jsx,ts,tsx',
'--max-warnings=0',
'--format=codeframe',
paths.targetDir,
];
if (cmd.fix) {
args.push('--fix');
}
await run('web-scripts', args);
await run('eslint', args);
};