Skip to content

Commit

Permalink
Update .markdownlint.json to set line-length/code_blocks to false and…
Browse files Browse the repository at this point in the history
… remove unnecessary inline comments to disable/restore.
  • Loading branch information
DavidAnson committed Dec 23, 2022
1 parent a5d9f29 commit bbbb63c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
3 changes: 2 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"style": "---"
},
"line-length": {
"strict": true
"strict": true,
"code_blocks": false
},
"no-duplicate-heading": {
"siblings_only": true
Expand Down
20 changes: 0 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,14 +510,10 @@ specify a custom `RegExp` or use the value `null` to disable the feature.

The default value:

<!-- markdownlint-disable line-length -->

```javascript
/((^---\s*$[\s\S]*?^---\s*)|(^\+\+\+\s*$[\s\S]*?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]*?^\}\s*))(\r\n|\r|\n|$)/m
```

<!-- markdownlint-restore -->

Ignores [YAML](https://en.wikipedia.org/wiki/YAML),
[TOML](https://en.wikipedia.org/wiki/TOML), and
[JSON](https://en.wikipedia.org/wiki/JSON) front matter such as:
Expand Down Expand Up @@ -778,8 +774,6 @@ markdownlint(options, function callback(err, result) {

Output:

<!-- markdownlint-disable line-length -->

```text
bad.string: 3: MD010/no-hard-tabs Hard tabs [Column: 19]
bad.string: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.string"]
Expand All @@ -791,8 +785,6 @@ bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style heading [
bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "#bad.md"]
```

<!-- markdownlint-restore -->

Or invoke `markdownlint.sync` for a synchronous call:

```javascript
Expand All @@ -812,8 +804,6 @@ markdownlint(options, function callback(err, result) {

Output:

<!-- markdownlint-disable line-length -->

```json
{
"good.md": [],
Expand Down Expand Up @@ -850,8 +840,6 @@ Output:
}
```

<!-- markdownlint-restore -->

Integration with the [gulp](https://gulpjs.com/) build system is
straightforward:

Expand All @@ -878,8 +866,6 @@ gulp.task("markdownlint", function task() {

Output:

<!-- markdownlint-disable line-length -->

```text
[00:00:00] Starting 'markdownlint'...
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
Expand All @@ -889,8 +875,6 @@ bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be
[00:00:00] Finished 'markdownlint' after 10 ms
```

<!-- markdownlint-restore -->

Integration with the [Grunt](https://gruntjs.com/) build system is similar:

```javascript
Expand Down Expand Up @@ -922,8 +906,6 @@ module.exports = function wrapper(grunt) {

Output:

<!-- markdownlint-disable line-length -->

```text
Running "markdownlint:example" (markdownlint) task
Warning:
Expand All @@ -934,8 +916,6 @@ bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be
Use --force to continue.
```

<!-- markdownlint-restore -->

### Fixing

Rules that can be fixed automatically include a `fixInfo` property which is
Expand Down
2 changes: 1 addition & 1 deletion example/typescript/type-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ assert(/^\d+\.\d+\.\d+$/.test(version));

function assertConfiguration(config: markdownlint.Configuration) {
assert(!!config);
assert.deepEqual(config["line-length"], { "strict": true });
assert.deepEqual(config["line-length"], { "strict": true, "code_blocks": false });
// config assignment is covered by markdownlint.Options
}

Expand Down

0 comments on commit bbbb63c

Please sign in to comment.