lib/cli.js
function lintFile(fileName, userConfig, errorReporter) {
    let sourceCode;

    try {
        sourceCode = fs.readFileSync(fileName, "utf8");
    } catch (e) {
        errorReporter.reportFatal("Unable to read " + fileName + ": " + e.message);
        process.exit(errorCodes.FILE_NOT_FOUND);
    }

    return lintString(sourceCode, userConfig, errorReporter, fileName);
}
function lintFile(fileName, userConfig, errorReporter) {
    let sourceCode;

    try {
        sourceCode = fs.readFileSync(fileName, "utf8");
    } catch (e) {
        errorReporter.reportFatal("Unable to read " + fileName + ": " + e.message);
        process.exit(errorCodes.FILE_NOT_FOUND);
    }

    return lintString(sourceCode, userConfig, errorReporter, fileName);
}
Lint a file based on user settings
@param {String} fileName The path to the file to be linted
@param {Object} userConfig User configuration
@param {Object} errorReporter The error reporter to use
@returns {Integer} numOfErrors Number of Lint ERRORS that occured (the result returned by lintString())