react/scripts/tasks/linc.js
Andrew Clark 73bf2d68ef
Pass extra CLI args through to ESLint (#20250)
These now work:

```
yarn run lint --fix
yarn run linc --fix
```
2020-11-13 11:00:45 -08:00

22 lines
559 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
const minimist = require('minimist');
const runESLint = require('../eslint');
console.log('Linting changed files...');
const cliOptions = minimist(process.argv.slice(2));
if (runESLint({onlyChanged: true, ...cliOptions})) {
console.log('Lint passed for changed files.');
} else {
console.log('Lint failed for changed files.');
process.exit(1);
}