Add lint rules from eslint-plugin-node.

This commit is contained in:
David Anson 2020-09-06 19:49:35 -07:00
parent 6525c36f1e
commit e1eb81cd21
11 changed files with 61 additions and 19 deletions

View file

@ -4,7 +4,6 @@
const fs = require("fs");
const path = require("path");
const { URL } = require("url");
const markdownIt = require("markdown-it");
const rules = require("./rules");
const helpers = require("../helpers");
@ -681,6 +680,7 @@ function lintFile(
}
// Make a/synchronous call to read file
if (synchronous) {
// @ts-ignore
lintContentWrapper(null, fs.readFileSync(file, helpers.utf8Encoding));
} else {
fs.readFile(file, helpers.utf8Encoding, lintContentWrapper);
@ -889,6 +889,7 @@ function readConfig(file, parsers, callback) {
*/
function readConfigSync(file, parsers) {
// Read file
// @ts-ignore
const content = fs.readFileSync(file, helpers.utf8Encoding);
// Try to parse file
const { config, message } = parseConfiguration(file, content, parsers);