fix some useless console.log
This commit is contained in:
@@ -3,58 +3,7 @@
|
||||
|
||||
module.exports = {
|
||||
plugins: [ 'plugins/markdown' ],
|
||||
markdown: {
|
||||
// tags: ['examples']
|
||||
/*
|
||||
// "The highlighter function should escape the code block's contents and wrap them in <pre><code> tags"
|
||||
highlight (code, language) {
|
||||
function ret () {
|
||||
// Default:
|
||||
return '<pre><code>' + code + ' in this language: ' + language + '</code></pre>';
|
||||
}
|
||||
if (language !== 'js') { // E.g., we have one URL in some tutorial Markdown
|
||||
// Seems to be only for full triple-backticked fences
|
||||
// console.log('lll', code);
|
||||
return ret();
|
||||
}
|
||||
|
||||
// Programmatic ESLint API: https://eslint.org/docs/developer-guide/nodejs-api
|
||||
const {CLIEngine} = require('eslint');
|
||||
const cli = new CLIEngine({
|
||||
useEslintrc: true,
|
||||
rules: {
|
||||
'no-undef': 0, // Many variables in examples will be undefined
|
||||
'padded-blocks': 0 // Can look nicer
|
||||
}
|
||||
});
|
||||
|
||||
// Undo escaping done by node_modules/jsdoc/lib/jsdoc/util/markdown.js
|
||||
code = code
|
||||
.replace(/\s+$/, '')
|
||||
.replace(/'/g, "'")
|
||||
.replace(/(https?):\\\/\\\//g, '$1://')
|
||||
.replace(/\{@[^}\r\n]+\}/g, function (wholeMatch) {
|
||||
return wholeMatch.replace(/"/g, '"');
|
||||
});
|
||||
|
||||
// lint the supplied text and optionally set
|
||||
// a filename that is displayed in the report
|
||||
const report = cli.executeOnText(code + '\n');
|
||||
if (!report.errorCount && !report.warningCount) {
|
||||
return ret();
|
||||
}
|
||||
|
||||
// Although we don't get the file, at least we can report the source code
|
||||
const {messages} = report.results[0];
|
||||
messages.forEach(({message, line, column, severity, ruleId}) => {
|
||||
console.log(`${ruleId}: ${message} (Severity: ${severity}; ${line}:${column})`);
|
||||
});
|
||||
console.log('\n' + code);
|
||||
|
||||
return ret();
|
||||
}
|
||||
*/
|
||||
},
|
||||
markdown: {},
|
||||
recurseDepth: 10,
|
||||
source: {
|
||||
exclude: [
|
||||
|
||||
Reference in New Issue
Block a user