main
js 29 lines 701 Bytes
Raw
1 /**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 'use strict';
9
10 const minimist = require('minimist');
11 const runESLint = require('../eslint');
12
13 async function main() {
14 console.log('Linting all files...');
15 if (!process.env.CI) {
16 console.log('Hint: run `yarn linc` to only lint changed files.');
17 }
18
19 const {_: paths, ...cliOptions} = minimist(process.argv.slice(2));
20
21 if (await runESLint({onlyChanged: false, ...cliOptions, paths})) {
22 console.log('Lint passed.');
23 } else {
24 console.log('Lint failed.');
25 process.exit(1);
26 }
27 }
28
29 main();