mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-22 08:50:13 +01:00
Update all rules to better handle wrongly-typed configuration parameters.
This commit is contained in:
parent
26ad0550ec
commit
3238ed4249
25 changed files with 134 additions and 39 deletions
|
|
@ -27,9 +27,11 @@ module.exports = {
|
|||
"description": "Line length",
|
||||
"tags": [ "line_length" ],
|
||||
"function": function MD013(params, onError) {
|
||||
const lineLength = params.config.line_length || 80;
|
||||
const headingLineLength = params.config.heading_line_length || lineLength;
|
||||
const codeLineLength = params.config.code_block_line_length || lineLength;
|
||||
const lineLength = Number(params.config.line_length || 80);
|
||||
const headingLineLength =
|
||||
Number(params.config.heading_line_length || lineLength);
|
||||
const codeLineLength =
|
||||
Number(params.config.code_block_line_length || lineLength);
|
||||
const strict = !!params.config.strict;
|
||||
const longLineRePostfix =
|
||||
strict ? longLineRePostfixStrict : longLineRePostfixRelaxed;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue