2017-11-05 02:09:28 +08:00
|
|
|
/**
|
2018-09-08 06:11:23 +08:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2017-11-05 02:09:28 +08:00
|
|
|
*
|
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
2017-12-11 23:52:46 +08:00
|
|
|
const runESLint = require('../eslint');
|
2017-11-28 07:30:36 +08:00
|
|
|
|
2017-12-11 23:52:46 +08:00
|
|
|
console.log('Linting changed files...');
|
2017-11-05 02:09:28 +08:00
|
|
|
|
2017-12-11 23:52:46 +08:00
|
|
|
if (runESLint({onlyChanged: true})) {
|
|
|
|
|
console.log('Lint passed for changed files.');
|
|
|
|
|
} else {
|
2017-11-05 02:09:28 +08:00
|
|
|
console.log('Lint failed for changed files.');
|
|
|
|
|
process.exit(1);
|
2017-11-28 21:54:46 +08:00
|
|
|
}
|