-
Notifications
You must be signed in to change notification settings - Fork 0
/
markdown.js
60 lines (53 loc) · 2.06 KB
/
markdown.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"use strict";
const dirtySharedConfig = require("./shared/dirty");
module.exports = {
overrides: [
{
// In v2, explicitly apply eslint-plugin-markdown's `markdown`
// processor on any Markdown files you want to lint.
files: ["**/*.{md,markdown,mdown,mkdn,mkd,mdwn,mkdown,ron}"],
processor: "markdown/markdown",
},
{
...dirtySharedConfig,
// In v2, configuration for fenced code blocks is separate from the
// containing Markdown file. Each code block has a virtual filename
// appended to the Markdown file's path.
files: ["**/*.{md,markdown,mdown,mkdn,mkd,mdwn,mkdown,ron}/**"],
// Configuration for fenced code blocks goes with the override for
// the code block's virtual filename, for example:
parserOptions: {
...dirtySharedConfig.parserOptions,
ecmaFeatures: {
...dirtySharedConfig.parserOptions.ecmaFeatures,
impliedStrict: true,
},
babelOptions: undefined,
},
plugins: ["markdown"],
rules: {
...dirtySharedConfig.rules,
// The Markdown parser automatically trims trailing newlines from code blocks.
"eol-last": "off",
// For example
"no-console": "off",
// In code snippets and examples, these rules are often counterproductive to clarity and brevity.
"no-undef": "off",
"no-unused-vars": "off",
"no-unused-expressions": "off",
"import/no-unresolved": "off",
"import/no-extraneous-dependencies": "off",
"n/no-unpublished-require": "off",
"n/no-unpublished-import": "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",
// Avoid naming nested blocks
"unicorn/filename-case": "off",
"unicorn/no-empty-file": "off",
},
},
],
};