Skip to content

Commit 4629f54

Browse files
committed
added react-scripts lint
1 parent 69babbb commit 4629f54

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/react-scripts/bin/react-scripts.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,22 @@ switch (script) {
5555
process.exit(result.status);
5656
break;
5757
}
58+
case 'lint': {
59+
const eslintConfigPath = require.resolve('eslint-config-react-app');
60+
spawn(
61+
'node',
62+
[
63+
require.resolve('eslint/bin/eslint'),
64+
'--config',
65+
eslintConfigPath,
66+
'src/**/*.{js,jsx,.mjs}',
67+
],
68+
{ stdio: 'inherit' }
69+
).on('error', err => {
70+
console.log('Error running ESLint: ' + err);
71+
process.exit(results.status);
72+
});
73+
}
5874
default:
5975
console.log('Unknown script "' + script + '".');
6076
console.log('Perhaps you need to update react-scripts?');

0 commit comments

Comments
 (0)