mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 00:20:28 +01:00
* (build infrastructure): unify lint and linc buid task; * Fail on warnings * Fail on warnings
20 lines
524 B
JavaScript
20 lines
524 B
JavaScript
/**
|
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
*
|
|
* 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 CLIEngine = require('eslint').CLIEngine;
|
|
const cli = new CLIEngine();
|
|
const formatter = cli.getFormatter();
|
|
|
|
module.exports = function lintOnFiles(filePatterns) {
|
|
const report = cli.executeOnFiles(filePatterns);
|
|
const formatedResults = formatter(report.results);
|
|
console.log(formatedResults);
|
|
return report;
|
|
};
|