node/tools/node_modules/eslint-plugin-markdown/lib/index.js
Luigi Pinca 5de911eeaf
tools: make update-eslint.sh work with npm@7
Install `eslint-plugin-markdown` at the same level of `eslint` without
cd'ing into `eslint` directory, otherwise the following error is raised:

```
npm ERR! code ERESOLVE
npm ERR! Cannot destructure property 'name' of 'node' as it is null.
```

PR-URL: https://github.com/nodejs/node/pull/37566
Fixes: https://github.com/nodejs/node/issues/37560
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruy Adorno <ruyadorno@github.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-06-11 09:30:19 +02:00

60 lines
2 KiB
JavaScript

/**
* @fileoverview Enables the processor for Markdown file extensions.
* @author Brandon Mills
*/
"use strict";
const processor = require("./processor");
module.exports = {
configs: {
recommended: {
plugins: ["markdown"],
overrides: [
{
files: ["*.md"],
processor: "markdown/markdown"
},
{
files: ["**/*.md/**"],
parserOptions: {
ecmaFeatures: {
// Adding a "use strict" directive at the top of
// every code block is tedious and distracting, so
// opt into strict mode parsing without the
// directive.
impliedStrict: true
}
},
rules: {
// The Markdown parser automatically trims trailing
// newlines from code blocks.
"eol-last": "off",
// In code snippets and examples, these rules are often
// counterproductive to clarity and brevity.
"no-undef": "off",
"no-unused-expressions": "off",
"no-unused-vars": "off",
"padded-blocks": "off",
// Adding a "use strict" directive at the top of every
// code block is tedious and distracting. The config
// opts into strict mode parsing without the directive.
strict: "off",
// The processor will not receive a Unicode Byte Order
// Mark from the Markdown parser.
"unicode-bom": "off"
}
}
]
}
},
processors: {
markdown: processor
}
};