| | import fs from 'fs' |
| | import yaml from 'js-yaml' |
| |
|
| | const allowedCodeFenceLanguages = Object.keys( |
| | yaml.load(fs.readFileSync('data/code-languages.yml', 'utf8')) as Record<string, unknown>, |
| | ) |
| |
|
| | type RuleConfig = { |
| | severity: 'error' | 'warning' |
| | 'partial-markdown-files': boolean |
| | 'yml-files': boolean |
| | [key: string]: any |
| | } |
| |
|
| | type BaseConfig = { |
| | [key: string]: boolean | RuleConfig |
| | } |
| |
|
| | export const baseConfig: BaseConfig = { |
| | |
| | |
| | default: false, |
| | 'heading-increment': { |
| | |
| | severity: 'error', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | }, |
| | 'first-heading-h1': { |
| | |
| | severity: 'error', |
| | level: 2, |
| | 'partial-markdown-files': false, |
| | 'yml-files': false, |
| | }, |
| | 'no-reversed-links': { |
| | |
| | severity: 'error', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | }, |
| | 'commands-show-output': { |
| | |
| | severity: 'error', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | }, |
| | 'no-missing-space-atx': { |
| | |
| | severity: 'error', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | }, |
| | 'no-multiple-space-atx': { |
| | |
| | severity: 'error', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | }, |
| | 'heading-start-left': { |
| | |
| | severity: 'error', |
| | 'partial-markdown-files': false, |
| | 'yml-files': false, |
| | }, |
| | 'no-multiple-space-blockquote': { |
| | |
| | severity: 'error', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | }, |
| | 'ol-prefix': { |
| | |
| | severity: 'error', |
| | style: 'one', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | }, |
| | 'list-marker-space': { |
| | |
| | severity: 'error', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | }, |
| | 'blanks-around-fences': { |
| | |
| | severity: 'error', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | }, |
| | 'no-space-in-emphasis': { |
| | |
| | severity: 'error', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | }, |
| | 'no-space-in-links': { |
| | |
| | severity: 'error', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | }, |
| | 'fenced-code-language': { |
| | |
| | severity: 'error', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | allowed_languages: allowedCodeFenceLanguages, |
| | context: `When you add a fenced code block, you must specify the code language. Allowed languages are: ${allowedCodeFenceLanguages.join(', ')}. You can add allowed languages by updating data/code-languages.yml.`, |
| | }, |
| | 'no-empty-links': { |
| | |
| | severity: 'error', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | }, |
| | 'strong-style': { |
| | |
| | severity: 'error', |
| | style: 'asterisk', |
| | 'partial-markdown-files': true, |
| | 'yml-files': true, |
| | }, |
| | } |
| |
|