Update dependencies: eslint to 8.5.0, eslint-plugin-jsdoc to 37.4.0.

This commit is contained in:
David Anson 2021-12-27 04:37:51 +00:00 committed by GitHub
parent fd24b9552b
commit 528758e962
3 changed files with 19 additions and 15 deletions

View file

@ -105,7 +105,7 @@
"jsdoc/check-access": "error",
"jsdoc/check-alignment": "error",
"jsdoc/check-examples": "error",
"jsdoc/check-examples": "off",
"jsdoc/check-indentation": "error",
"jsdoc/check-line-alignment": "error",
"jsdoc/check-param-names": "error",

View file

@ -52,8 +52,8 @@
"devDependencies": {
"ava": "~3.15.0",
"c8": "~7.10.0",
"eslint": "~7.32.0",
"eslint-plugin-jsdoc": "~37.2.8",
"eslint": "~8.5.0",
"eslint-plugin-jsdoc": "~37.4.0",
"eslint-plugin-node": "~11.1.0",
"eslint-plugin-unicorn": "~39.0.0",
"globby": "~11.0.4",

View file

@ -4,7 +4,7 @@
const { filterTokens } = require("markdownlint-rule-helpers");
const eslint = require("eslint");
const cliEngine = new eslint.CLIEngine({});
const eslintInstance = new eslint.ESLint();
const linter = new eslint.Linter();
const languageJavaScript = /js|javascript/i;
@ -28,10 +28,12 @@ module.exports = {
"names": [ "lint-javascript" ],
"description": "Rule that lints JavaScript code",
"tags": [ "test", "lint", "javascript" ],
"asynchronous": true,
"function": (params, onError) => {
filterTokens(params, "fence", (fence) => {
if (languageJavaScript.test(fence.info)) {
let config = cliEngine.getConfigForFile(params.name);
return eslintInstance.calculateConfigForFile(params.name)
.then((config) => {
config = cleanJsdocRulesFromEslintConfig(config);
const results = linter.verify(fence.content, config);
results.forEach((result) => {
@ -42,9 +44,11 @@ module.exports = {
"context": params.lines[lineNumber - 1]
});
});
}
});
// Unused:
}
return Promise.resolve();
});
// Unsupported:
// filterTokens("code_block"), language unknown
// filterTokens("code_inline"), too brief
}