-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
code-blocks.ts
34 lines (30 loc) · 1 KB
/
code-blocks.ts
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
import type { Linter } from 'eslint'
export const codeBlocks = {
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',
},
} satisfies Linter.Config