@storm-software/markdownlint
Version:
An opinionated collection of markdownlint rules used by Storm Software.
144 lines (134 loc) • 4.03 kB
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
var _chunkJ4SXAUTHjs = require('./chunk-J4SXAUTH.js');
require('./chunk-LJKIR7QG.js');
require('./chunk-XHKGFYKR.js');
require('./chunk-WMAPY4ND.js');
require('./chunk-JSBRDJBE.js');
// src/index.ts
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
// src/markdownlint.ts
var markdownlintConfig = {
$schema: "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.37.4/schema/markdownlint-config-schema.json",
"header-increment": true,
"first-header-h1": false,
"heading-style": {
style: "atx"
},
"ul-style": {
style: "dash"
},
"list-indent": true,
"ul-start-left": false,
"ul-indent": {
indent: 2,
start_indented: true
},
"no-trailing-spaces": {
br_spaces: 0,
list_item_empty_lines: false
},
"no-hard-tabs": {
code_blocks: true
},
"no-reversed-links": true,
"no-multiple-blanks": {
maximum: 1
},
"line-length": {
tables: false,
code_blocks: false,
headings: false
},
"commands-show-output": true,
"no-missing-space-atx": true,
"no-multiple-space-atx": true,
"no-missing-space-closed-atx": true,
"no-multiple-space-closed-atx": true,
"blanks-around-headers": false,
"header-start-left": true,
"no-duplicate-heading": false,
"single-h1": false,
"no-trailing-punctuation": {
punctuation: ".,:!?"
},
"no-multiple-space-blockquote": true,
"no-blanks-blockquote": false,
"ol-prefix": {
style: "one_or_ordered"
},
"list-marker-space": {
ul_single: 1,
ol_single: 1,
ul_multi: 1,
ol_multi: 1
},
"no-empty-code-blocks": true,
"no-empty-lists": true,
"no-inline-html": false,
"no-bare-urls": true,
"hr-style": {
style: "---"
},
"no-emphasis-as-header": false,
"no-space-in-emphasis": true,
"no-space-in-code": true,
"no-space-in-links": false,
"fenced-code-language": true,
"first-line-h1": false,
"no-empty-links": true,
"required-headers": false,
"proper-names": false,
"no-alt-text": false,
"code-block-style": {
style: "fenced"
},
"single-trailing-newline": true,
"code-fence-style": {
style: "backtick"
},
"emphasis-style": {
style: "consistent"
},
"strong-style": {
style: "asterisk"
},
"link-fragments": true,
"reference-links-images": {
shortcut_syntax: false
},
"link-image-reference-definitions": {
ignored_definitions: ["//"]
},
"link-image-style": {
autolink: true,
collapsed: true,
full: true,
inline: true,
shortcut: true,
url_inline: true
},
"table-pipe-style": {
style: "consistent"
},
"table-column-count": true,
"blanks-around-tables": true,
"spaces-around-links": {
both: true
}
};
// src/index.ts
var offByDefault = [];
var baseConfig = { ...markdownlintConfig };
for (const rule of _chunkJ4SXAUTHjs.rules) {
const ruleName = _optionalChain([rule, 'optionalAccess', _ => _.names, 'access', _2 => _2[1]]);
if (ruleName) {
baseConfig[ruleName] = offByDefault.includes(ruleName) ? false : true;
}
}
var init = function init2(defaultConfig) {
return _defu2.default.call(void 0, defaultConfig, baseConfig);
};
var rules2 = [..._chunkJ4SXAUTHjs.rules];
var config = baseConfig;
var index_default = config;
exports.config = config; exports.default = index_default; exports.init = init; exports.rules = rules2;