|
| 1 | +// Source: https://github.com/codacy/codacy-remark-lint/raw/master/.remarkrc.js |
| 2 | + |
| 3 | +const fs = require("fs"); |
| 4 | +const path = require("path"); |
| 5 | + |
| 6 | +exports.settings = { |
| 7 | + gfm: true, |
| 8 | + commonmark: true, |
| 9 | + looseTable: false, |
| 10 | + spacedTable: false, |
| 11 | + paddedTable: false, |
| 12 | + fences: true, |
| 13 | + rule: '-', |
| 14 | + ruleRepetition: 3, |
| 15 | + emphasis: "*", |
| 16 | + strong: "*", |
| 17 | + bullet: "-", |
| 18 | + listItemIndent: 'tab', |
| 19 | + incrementListMarker: true |
| 20 | +}; |
| 21 | + |
| 22 | +const personalDictionaryPath = path.join(__dirname, ".dictionary"); |
| 23 | +const personalDictionary = fs.existsSync(personalDictionaryPath) |
| 24 | + ? { |
| 25 | + personal: fs.readFileSync(personalDictionaryPath, "utf8") |
| 26 | + } |
| 27 | + : {}; |
| 28 | + |
| 29 | +const remarkPresetLintMarkdownStyleGuide = { |
| 30 | + plugins: require("remark-preset-lint-markdown-style-guide").plugins.filter( |
| 31 | + function(elem) { |
| 32 | + return elem != require("remark-lint-no-duplicate-headings"); |
| 33 | + } |
| 34 | + ) |
| 35 | +}; |
| 36 | + |
| 37 | +exports.plugins = [ |
| 38 | + require("remark-preset-lint-consistent"), |
| 39 | + require("remark-preset-lint-recommended"), |
| 40 | + remarkPresetLintMarkdownStyleGuide, |
| 41 | + [require("remark-lint-no-dead-urls"), { skipOffline: true }], |
| 42 | + require("remark-lint-heading-whitespace"), |
| 43 | + [require("remark-lint-maximum-line-length"), 120], |
| 44 | + [require("remark-lint-maximum-heading-length"), 120], |
| 45 | + [require("remark-lint-list-item-indent"), "tab-size"], |
| 46 | + [require("remark-lint-list-item-spacing"), false], |
| 47 | + [require("remark-lint-strong-marker"), "*"], |
| 48 | + [require("remark-lint-emphasis-marker"), "_"], |
| 49 | + [require("remark-lint-unordered-list-marker-style"), "-"], |
| 50 | + [require("remark-lint-ordered-list-marker-style"), "."], |
| 51 | + [require("remark-lint-ordered-list-marker-value"), "ordered"], |
| 52 | + /*[ |
| 53 | + require("remark-lint-write-good"), |
| 54 | + [ |
| 55 | + "warn", |
| 56 | + { |
| 57 | + passive: false, |
| 58 | + illusion: true, |
| 59 | + so: true, |
| 60 | + thereIs: true, |
| 61 | + weasel: true, |
| 62 | + adverb: true, |
| 63 | + tooWordy: true, |
| 64 | + cliches: true, |
| 65 | + eprime: false |
| 66 | + } |
| 67 | + ] |
| 68 | + ],*/ |
| 69 | + require("remark-validate-links"), |
| 70 | + require("remark-frontmatter"), |
| 71 | + /*[ |
| 72 | + require("remark-retext"), |
| 73 | + require("unified")().use({ |
| 74 | + plugins: [ |
| 75 | + require("retext-english"), |
| 76 | + require("retext-syntax-urls"), |
| 77 | + [ |
| 78 | + require("retext-spell"), |
| 79 | + { |
| 80 | + ignoreLiteral: true, |
| 81 | + dictionary: require("dictionary-en-us"), |
| 82 | + ...personalDictionary |
| 83 | + } |
| 84 | + ], |
| 85 | + [ |
| 86 | + require("retext-sentence-spacing"), |
| 87 | + { |
| 88 | + preferred: 1 |
| 89 | + } |
| 90 | + ], |
| 91 | + require("retext-repeated-words"), |
| 92 | + require("retext-usage"), |
| 93 | + require("retext-indefinite-article"), |
| 94 | + require("retext-redundant-acronyms"), |
| 95 | + [ |
| 96 | + require("retext-contractions"), |
| 97 | + { |
| 98 | + straight: true, |
| 99 | + allowLiteral: true |
| 100 | + } |
| 101 | + ], |
| 102 | + require("retext-diacritics"), |
| 103 | + [ |
| 104 | + require("retext-quotes"), |
| 105 | + { |
| 106 | + preferred: "straight" |
| 107 | + } |
| 108 | + ], |
| 109 | + require("retext-equality"), |
| 110 | + require("retext-passive"), |
| 111 | + require("retext-profanities"), |
| 112 | + [ |
| 113 | + require("retext-readability"), |
| 114 | + { |
| 115 | + age: 20 |
| 116 | + } |
| 117 | + ] |
| 118 | + ] |
| 119 | + }) |
| 120 | + ]*/ |
| 121 | +]; |
0 commit comments