|
1 | | -'use strict'; |
| 1 | +import remarkLint from 'remark-lint'; |
| 2 | +import blockquoteIndentation from 'remark-lint-blockquote-indentation'; |
| 3 | +import checkboxCharacterStyle from 'remark-lint-checkbox-character-style'; |
| 4 | +import checkboxContentIndent from 'remark-lint-checkbox-content-indent'; |
| 5 | +import codeBlockStyle from 'remark-lint-code-block-style'; |
| 6 | +import definitionCase from 'remark-lint-definition-case'; |
| 7 | +import definitionSpacing from 'remark-lint-definition-spacing'; |
| 8 | +import emphasisMarker from 'remark-lint-emphasis-marker'; |
| 9 | +import fencedCodeMarker from 'remark-lint-fenced-code-marker'; |
| 10 | +import fileExtension from 'remark-lint-file-extension'; |
| 11 | +import finalNewline from 'remark-lint-final-newline'; |
| 12 | +import hardBreakSpaces from 'remark-lint-hard-break-spaces'; |
| 13 | +import headingStyle from 'remark-lint-heading-style'; |
| 14 | +import linkTitleStyle from 'remark-lint-link-title-style'; |
| 15 | +import listItemBulletIndent from 'remark-lint-list-item-bullet-indent'; |
| 16 | +import listItemIndent from 'remark-lint-list-item-indent'; |
| 17 | +import noAutoLinkWithoutProtocol from 'remark-lint-no-auto-link-without-protocol'; |
| 18 | +import noBlockquoteWithoutMarker from 'remark-lint-no-blockquote-without-marker'; |
| 19 | +import noEmphasisAsHeading from 'remark-lint-no-emphasis-as-heading'; |
| 20 | +import noFileNameArticles from 'remark-lint-no-file-name-articles'; |
| 21 | +import noFileNameConsecutiveDashes from 'remark-lint-no-file-name-consecutive-dashes'; |
| 22 | +import noFileNameIrregularCharacters from 'remark-lint-no-file-name-irregular-characters'; |
| 23 | +import noFileNameMixedCase from 'remark-lint-no-file-name-mixed-case'; |
| 24 | +import noFileNameOuterDashes from 'remark-lint-no-file-name-outer-dashes'; |
| 25 | +import noHeadingContentIndent from 'remark-lint-no-heading-content-indent'; |
| 26 | +import noHeadingIndent from 'remark-lint-no-heading-indent'; |
| 27 | +import noHeadingPunctuation from 'remark-lint-no-heading-punctuation'; |
| 28 | +import noInlinePadding from 'remark-lint-no-inline-padding'; |
| 29 | +import noMultipleToplevelHeadings from 'remark-lint-no-multiple-toplevel-headings'; |
| 30 | +import noShellDollars from 'remark-lint-no-shell-dollars'; |
| 31 | +import noTableIndentation from 'remark-lint-no-table-indentation'; |
| 32 | +import noUndefinedReferences from 'remark-lint-no-undefined-references'; |
| 33 | +import noUnneededFullReferenceImage from 'remark-lint-no-unneeded-full-reference-image'; |
| 34 | +import noUnneededFullReferenceLink from 'remark-lint-no-unneeded-full-reference-link'; |
| 35 | +import noUnusedDefinitions from 'remark-lint-no-unused-definitions'; |
| 36 | +import orderedListMarkerStyle from 'remark-lint-ordered-list-marker-style'; |
| 37 | +import orderedListMarkerValue from 'remark-lint-ordered-list-marker-value'; |
| 38 | +import ruleStyle from 'remark-lint-rule-style'; |
| 39 | +import strongMarker from 'remark-lint-strong-marker'; |
| 40 | +import tableCellPadding from 'remark-lint-table-cell-padding'; |
| 41 | +import tablePipeAlignment from 'remark-lint-table-pipe-alignment'; |
| 42 | +import tablePipes from 'remark-lint-table-pipes'; |
| 43 | +import unorderedListMarkerStyle from 'remark-lint-unordered-list-marker-style'; |
| 44 | +import matchPunctuation from 'remark-lint-match-punctuation'; |
| 45 | +import noRepeatPunctuation from 'remark-lint-no-repeat-punctuation'; |
| 46 | +import doubleLink from 'remark-lint-double-link'; |
| 47 | +import customRules from './rules/index.js'; |
2 | 48 |
|
3 | | -exports.plugins = [ |
4 | | - require('remark-lint'), |
| 49 | +const plugins = [ |
| 50 | + remarkLint, |
5 | 51 |
|
6 | 52 | // Official plugins |
7 | | - [require('remark-lint-blockquote-indentation'), 2], |
8 | | - [require('remark-lint-checkbox-character-style'), 'consistent'], |
9 | | - require('remark-lint-checkbox-content-indent'), |
10 | | - [require('remark-lint-code-block-style'), 'fenced'], |
11 | | - require('remark-lint-definition-case'), |
12 | | - require('remark-lint-definition-spacing'), |
13 | | - [require('remark-lint-emphasis-marker'), 'consistent'], |
14 | | - [require('remark-lint-fenced-code-marker'), '`'], |
15 | | - require('remark-lint-file-extension'), |
16 | | - require('remark-lint-final-newline'), |
17 | | - require('remark-lint-hard-break-spaces'), |
18 | | - [require('remark-lint-heading-style'), 'atx'], |
19 | | - [require('remark-lint-link-title-style'), '\''], |
20 | | - require('remark-lint-list-item-bullet-indent'), |
| 53 | + [blockquoteIndentation, 2], |
| 54 | + [checkboxCharacterStyle, 'consistent'], |
| 55 | + checkboxContentIndent, |
| 56 | + [codeBlockStyle, 'fenced'], |
| 57 | + definitionCase, |
| 58 | + definitionSpacing, |
| 59 | + [emphasisMarker, 'consistent'], |
| 60 | + [fencedCodeMarker, '`'], |
| 61 | + fileExtension, |
| 62 | + finalNewline, |
| 63 | + hardBreakSpaces, |
| 64 | + [headingStyle, 'atx'], |
| 65 | + [linkTitleStyle, '\''], |
21 | 66 | // TODO: this rule doesn't properly handle tab indents |
22 | 67 | // require('remark-lint-list-item-content-indent'), |
23 | | - [require('remark-lint-list-item-indent'), 'space'], |
24 | | - require('remark-lint-no-auto-link-without-protocol'), |
25 | | - require('remark-lint-no-blockquote-without-marker'), |
26 | | - require('remark-lint-no-emphasis-as-heading'), |
27 | | - require('remark-lint-no-file-name-articles'), |
28 | | - require('remark-lint-no-file-name-consecutive-dashes'), |
29 | | - require('remark-lint-no-file-name-irregular-characters'), |
30 | | - require('remark-lint-no-file-name-mixed-case'), |
31 | | - require('remark-lint-no-file-name-outer-dashes'), |
32 | | - require('remark-lint-no-heading-content-indent'), |
33 | | - require('remark-lint-no-heading-indent'), |
34 | | - require('remark-lint-no-heading-punctuation'), |
35 | | - require('remark-lint-no-inline-padding'), |
36 | | - [require('remark-lint-no-multiple-toplevel-headings'), 1], |
37 | | - require('remark-lint-no-shell-dollars'), |
38 | | - require('remark-lint-no-table-indentation'), |
39 | | - require('remark-lint-no-undefined-references'), |
40 | | - require('remark-lint-no-unneeded-full-reference-image'), |
41 | | - require('remark-lint-no-unneeded-full-reference-link'), |
42 | | - require('remark-lint-no-unused-definitions'), |
43 | | - [require('remark-lint-ordered-list-marker-style'), 'consistent'], |
44 | | - [require('remark-lint-ordered-list-marker-value'), 'ordered'], |
45 | | - [require('remark-lint-rule-style'), '---'], |
46 | | - [require('remark-lint-strong-marker'), 'consistent'], |
47 | | - [require('remark-lint-table-cell-padding'), 'consistent'], |
48 | | - require('remark-lint-table-pipe-alignment'), |
49 | | - require('remark-lint-table-pipes'), |
50 | | - [require('remark-lint-unordered-list-marker-style'), 'consistent'], |
| 68 | + listItemBulletIndent, |
| 69 | + [listItemIndent, 'space'], |
| 70 | + noAutoLinkWithoutProtocol, |
| 71 | + noBlockquoteWithoutMarker, |
| 72 | + noEmphasisAsHeading, |
| 73 | + noFileNameArticles, |
| 74 | + noFileNameConsecutiveDashes, |
| 75 | + noFileNameIrregularCharacters, |
| 76 | + noFileNameMixedCase, |
| 77 | + noFileNameOuterDashes, |
| 78 | + noHeadingContentIndent, |
| 79 | + noHeadingIndent, |
| 80 | + noHeadingPunctuation, |
| 81 | + noInlinePadding, |
| 82 | + [noMultipleToplevelHeadings, 1], |
| 83 | + noShellDollars, |
| 84 | + noTableIndentation, |
| 85 | + noUndefinedReferences, |
| 86 | + noUnneededFullReferenceImage, |
| 87 | + noUnneededFullReferenceLink, |
| 88 | + noUnusedDefinitions, |
| 89 | + [orderedListMarkerStyle, 'consistent'], |
| 90 | + [orderedListMarkerValue, 'ordered'], |
| 91 | + [ruleStyle, '---'], |
| 92 | + [strongMarker, 'consistent'], |
| 93 | + [tableCellPadding, 'consistent'], |
| 94 | + tablePipeAlignment, |
| 95 | + tablePipes, |
| 96 | + [unorderedListMarkerStyle, 'consistent'], |
51 | 97 |
|
52 | 98 | // Third-party plugins |
53 | 99 | // Disabled as it throws `file.warn is not a function` |
54 | 100 | // require('remark-lint-no-empty-sections'), |
55 | 101 |
|
56 | | - require('remark-lint-match-punctuation'), |
57 | | - require('remark-lint-no-repeat-punctuation'), |
58 | | - require('remark-lint-double-link'), |
| 102 | + matchPunctuation, |
| 103 | + noRepeatPunctuation, |
| 104 | + doubleLink, |
59 | 105 |
|
60 | 106 | // Custom plugins |
61 | | - ...require('./rules/index.js') |
| 107 | + ...customRules, |
62 | 108 | ]; |
| 109 | + |
| 110 | +export default plugins; |
| 111 | + |
0 commit comments