mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-18 15:00:13 +01:00
Remove helpers.utf8Encoding because it annoys the latest TypeScript compiler.
This commit is contained in:
parent
f87f9d0800
commit
dce5dd5e71
3 changed files with 8 additions and 13 deletions
|
|
@ -52,8 +52,6 @@ module.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/;
|
||||||
var emphasisMarkersRe = /[_*]/g;
|
var emphasisMarkersRe = /[_*]/g;
|
||||||
// Regular expression for inline links and shortcut reference links
|
// Regular expression for inline links and shortcut reference links
|
||||||
var linkRe = /\[(?:[^[\]]|\[[^\]]*\])*\](?:\(\S*\))?/g;
|
var linkRe = /\[(?:[^[\]]|\[[^\]]*\])*\](?:\(\S*\))?/g;
|
||||||
// readFile options for reading with the UTF-8 encoding
|
|
||||||
module.exports.utf8Encoding = "utf8";
|
|
||||||
// All punctuation characters (normal and full-width)
|
// All punctuation characters (normal and full-width)
|
||||||
var allPunctuation = ".,;:!?。,;:!?";
|
var allPunctuation = ".,;:!?。,;:!?";
|
||||||
module.exports.allPunctuation = allPunctuation;
|
module.exports.allPunctuation = allPunctuation;
|
||||||
|
|
@ -1423,10 +1421,10 @@ function lintFile(ruleList, file, md, config, frontMatter, handleRuleFailures, n
|
||||||
// Make a/synchronous call to read file
|
// Make a/synchronous call to read file
|
||||||
if (synchronous) {
|
if (synchronous) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
lintContentWrapper(null, fs.readFileSync(file, helpers.utf8Encoding));
|
lintContentWrapper(null, fs.readFileSync(file, "utf8"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fs.readFile(file, helpers.utf8Encoding, lintContentWrapper);
|
fs.readFile(file, "utf8", lintContentWrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
@ -1643,7 +1641,7 @@ function readConfig(file, parsers, callback) {
|
||||||
parsers = null;
|
parsers = null;
|
||||||
}
|
}
|
||||||
// Read file
|
// Read file
|
||||||
fs.readFile(file, helpers.utf8Encoding, function (err, content) {
|
fs.readFile(file, "utf8", function (err, content) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
@ -1690,7 +1688,7 @@ function readConfigPromise(file, parsers) {
|
||||||
function readConfigSync(file, parsers) {
|
function readConfigSync(file, parsers) {
|
||||||
// Read file
|
// Read file
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
var content = fs.readFileSync(file, helpers.utf8Encoding);
|
var content = fs.readFileSync(file, "utf8");
|
||||||
// Try to parse file
|
// Try to parse file
|
||||||
var _a = parseConfiguration(file, content, parsers), config = _a.config, message = _a.message;
|
var _a = parseConfiguration(file, content, parsers), config = _a.config, message = _a.message;
|
||||||
if (!config) {
|
if (!config) {
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,6 @@ const emphasisMarkersRe = /[_*]/g;
|
||||||
// Regular expression for inline links and shortcut reference links
|
// Regular expression for inline links and shortcut reference links
|
||||||
const linkRe = /\[(?:[^[\]]|\[[^\]]*\])*\](?:\(\S*\))?/g;
|
const linkRe = /\[(?:[^[\]]|\[[^\]]*\])*\](?:\(\S*\))?/g;
|
||||||
|
|
||||||
// readFile options for reading with the UTF-8 encoding
|
|
||||||
module.exports.utf8Encoding = "utf8";
|
|
||||||
|
|
||||||
// All punctuation characters (normal and full-width)
|
// All punctuation characters (normal and full-width)
|
||||||
const allPunctuation = ".,;:!?。,;:!?";
|
const allPunctuation = ".,;:!?。,;:!?";
|
||||||
module.exports.allPunctuation = allPunctuation;
|
module.exports.allPunctuation = allPunctuation;
|
||||||
|
|
|
||||||
|
|
@ -710,9 +710,9 @@ function lintFile(
|
||||||
// Make a/synchronous call to read file
|
// Make a/synchronous call to read file
|
||||||
if (synchronous) {
|
if (synchronous) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
lintContentWrapper(null, fs.readFileSync(file, helpers.utf8Encoding));
|
lintContentWrapper(null, fs.readFileSync(file, "utf8"));
|
||||||
} else {
|
} else {
|
||||||
fs.readFile(file, helpers.utf8Encoding, lintContentWrapper);
|
fs.readFile(file, "utf8", lintContentWrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -967,7 +967,7 @@ function readConfig(file, parsers, callback) {
|
||||||
parsers = null;
|
parsers = null;
|
||||||
}
|
}
|
||||||
// Read file
|
// Read file
|
||||||
fs.readFile(file, helpers.utf8Encoding, (err, content) => {
|
fs.readFile(file, "utf8", (err, content) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
@ -1020,7 +1020,7 @@ function readConfigPromise(file, parsers) {
|
||||||
function readConfigSync(file, parsers) {
|
function readConfigSync(file, parsers) {
|
||||||
// Read file
|
// Read file
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const content = fs.readFileSync(file, helpers.utf8Encoding);
|
const content = fs.readFileSync(file, "utf8");
|
||||||
// Try to parse file
|
// Try to parse file
|
||||||
const { config, message } = parseConfiguration(file, content, parsers);
|
const { config, message } = parseConfiguration(file, content, parsers);
|
||||||
if (!config) {
|
if (!config) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue