remark-lint-maximum-line-length
Advanced tools
Comparing version 3.1.2 to 3.1.3
export default remarkLintMaximumLineLength | ||
export type Root = import('mdast').Root | ||
export type Parent = import('mdast').Parent | ||
/** | ||
* Options. | ||
*/ | ||
export type Options = number | ||
declare const remarkLintMaximumLineLength: import('unified').Plugin< | ||
| void[] | ||
| [number | 'warn' | 'on' | 'off' | 'error' | undefined] | ||
| [ | ||
( | ||
| boolean | ||
| import('unified-lint-rule').Label | ||
| import('unified-lint-rule').Severity | ||
), | ||
number | undefined | ||
| number | ||
| [ | ||
( | ||
| boolean | ||
| import('unified-lint-rule/lib/index.js').Label | ||
| import('unified-lint-rule/lib/index.js').Severity | ||
), | ||
(number | undefined)? | ||
] | ||
| undefined | ||
], | ||
@@ -16,0 +21,0 @@ import('mdast').Root, |
19
index.js
@@ -61,3 +61,3 @@ /** | ||
* @example | ||
* {"name": "not-ok.md", "setting": 80, "label": "input", "positionless": true} | ||
* {"name": "not-ok.md", "config": 80, "label": "input", "positionless": true} | ||
* | ||
@@ -78,3 +78,3 @@ * This line is simply not tooooooooooooooooooooooooooooooooooooooooooooooooooooooo | ||
* @example | ||
* {"name": "not-ok.md", "setting": 80, "label": "output", "positionless": true} | ||
* {"name": "not-ok.md", "config": 80, "label": "output", "positionless": true} | ||
* | ||
@@ -88,3 +88,3 @@ * 4:86: Line must be at most 80 characters | ||
* @example | ||
* {"name": "ok-mixed-line-endings.md", "setting": 10, "positionless": true} | ||
* {"name": "ok-mixed-line-endings.md", "config": 10, "positionless": true} | ||
* | ||
@@ -97,3 +97,3 @@ * 0123456789␍␊ | ||
* @example | ||
* {"name": "not-ok-mixed-line-endings.md", "setting": 10, "label": "input", "positionless": true} | ||
* {"name": "not-ok-mixed-line-endings.md", "config": 10, "label": "input", "positionless": true} | ||
* | ||
@@ -106,3 +106,3 @@ * 012345678901␍␊ | ||
* @example | ||
* {"name": "not-ok-mixed-line-endings.md", "setting": 10, "label": "output", "positionless": true} | ||
* {"name": "not-ok-mixed-line-endings.md", "config": 10, "label": "output", "positionless": true} | ||
* | ||
@@ -117,4 +117,7 @@ * 1:13: Line must be at most 10 characters | ||
* @typedef {import('mdast').Root} Root | ||
* @typedef {import('mdast').Parent} Parent | ||
*/ | ||
/** | ||
* @typedef {number} Options | ||
* Options. | ||
*/ | ||
@@ -169,5 +172,3 @@ | ||
// allowed. | ||
visit(tree, (node, pos, parent_) => { | ||
const parent = /** @type {Parent} */ (parent_) | ||
visit(tree, (node, pos, parent) => { | ||
if ( | ||
@@ -174,0 +175,0 @@ (node.type === 'link' || |
{ | ||
"name": "remark-lint-maximum-line-length", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"description": "remark-lint rule to warn when lines are too long", | ||
@@ -44,5 +44,3 @@ "license": "MIT", | ||
}, | ||
"scripts": { | ||
"build": "rimraf \"*.d.ts\" && tsc && type-coverage" | ||
}, | ||
"scripts": {}, | ||
"xo": false, | ||
@@ -49,0 +47,0 @@ "typeCoverage": { |
114
readme.md
@@ -57,13 +57,13 @@ <!--This file is generated--> | ||
In Deno with [Skypack][]: | ||
In Deno with [`esm.sh`][esmsh]: | ||
```js | ||
import remarkLintMaximumLineLength from 'https://cdn.skypack.dev/remark-lint-maximum-line-length@3?dts' | ||
import remarkLintMaximumLineLength from 'https://esm.sh/remark-lint-maximum-line-length@3' | ||
``` | ||
In browsers with [Skypack][]: | ||
In browsers with [`esm.sh`][esmsh]: | ||
```html | ||
<script type="module"> | ||
import remarkLintMaximumLineLength from 'https://cdn.skypack.dev/remark-lint-maximum-line-length@3?min' | ||
import remarkLintMaximumLineLength from 'https://esm.sh/remark-lint-maximum-line-length@3?bundle' | ||
</script> | ||
@@ -142,38 +142,37 @@ ``` | ||
##### `ok-mixed-line-endings.md` | ||
##### `ok.md` | ||
When configured with `10`. | ||
###### In | ||
> 👉 **Note**: `␍␊` represents a carriage return and a line feed. | ||
> 👉 **Note**: this example uses GFM ([`remark-gfm`][gfm]). | ||
> 👉 **Note**: `␊` represents a line feed. | ||
```markdown | ||
0123456789␍␊ | ||
0123456789␊ | ||
01234␍␊ | ||
01234␊ | ||
``` | ||
This line is simply not toooooooooooooooooooooooooooooooooooooooooooo | ||
long. | ||
###### Out | ||
This is also fine: <http://this-long-url-with-a-long-domain.co.uk/a-long-path?query=variables> | ||
No messages. | ||
<http://this-link-is-fine.com> | ||
##### `not-ok-mixed-line-endings.md` | ||
`alphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJuliettKiloLimaMikeNovemberOscarPapaQuebec.romeo()` | ||
When configured with `10`. | ||
[foo](http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables) | ||
###### In | ||
<http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables> | ||
> 👉 **Note**: `␍␊` represents a carriage return and a line feed. | ||
![foo](http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables) | ||
> 👉 **Note**: `␊` represents a line feed. | ||
| An | exception | is | line | length | in | long | tables | because | those | can’t | just | | ||
| -- | --------- | -- | ---- | ------ | -- | ---- | ------ | ------- | ----- | ----- | ---- | | ||
| be | helped | | | | | | | | | | . | | ||
```markdown | ||
012345678901␍␊ | ||
012345678901␊ | ||
01234567890␍␊ | ||
01234567890␊ | ||
<a><b><i><p><q><s><u>alpha bravo charlie delta echo foxtrot golf</u></s></q></p></i></b></a> | ||
The following is also fine (note the `.`), because there is no whitespace. | ||
<http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables>. | ||
In addition, definitions are also fine: | ||
[foo]: <http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables> | ||
``` | ||
@@ -183,8 +182,3 @@ | ||
```text | ||
1:13: Line must be at most 10 characters | ||
2:13: Line must be at most 10 characters | ||
3:12: Line must be at most 10 characters | ||
4:12: Line must be at most 10 characters | ||
``` | ||
No messages. | ||
@@ -222,37 +216,38 @@ ##### `not-ok.md` | ||
##### `ok.md` | ||
##### `ok-mixed-line-endings.md` | ||
When configured with `10`. | ||
###### In | ||
> 👉 **Note**: this example uses GFM ([`remark-gfm`][gfm]). | ||
> 👉 **Note**: `␍␊` represents a carriage return and a line feed. | ||
> 👉 **Note**: `␊` represents a line feed. | ||
```markdown | ||
This line is simply not toooooooooooooooooooooooooooooooooooooooooooo | ||
long. | ||
0123456789␍␊ | ||
0123456789␊ | ||
01234␍␊ | ||
01234␊ | ||
``` | ||
This is also fine: <http://this-long-url-with-a-long-domain.co.uk/a-long-path?query=variables> | ||
###### Out | ||
<http://this-link-is-fine.com> | ||
No messages. | ||
`alphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJuliettKiloLimaMikeNovemberOscarPapaQuebec.romeo()` | ||
##### `not-ok-mixed-line-endings.md` | ||
[foo](http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables) | ||
When configured with `10`. | ||
<http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables> | ||
###### In | ||
![foo](http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables) | ||
> 👉 **Note**: `␍␊` represents a carriage return and a line feed. | ||
| An | exception | is | line | length | in | long | tables | because | those | can’t | just | | ||
| -- | --------- | -- | ---- | ------ | -- | ---- | ------ | ------- | ----- | ----- | ---- | | ||
| be | helped | | | | | | | | | | . | | ||
> 👉 **Note**: `␊` represents a line feed. | ||
<a><b><i><p><q><s><u>alpha bravo charlie delta echo foxtrot golf</u></s></q></p></i></b></a> | ||
The following is also fine (note the `.`), because there is no whitespace. | ||
<http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables>. | ||
In addition, definitions are also fine: | ||
[foo]: <http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables> | ||
```markdown | ||
012345678901␍␊ | ||
012345678901␊ | ||
01234567890␍␊ | ||
01234567890␊ | ||
``` | ||
@@ -262,3 +257,8 @@ | ||
No messages. | ||
```text | ||
1:13: Line must be at most 10 characters | ||
2:13: Line must be at most 10 characters | ||
3:12: Line must be at most 10 characters | ||
4:12: Line must be at most 10 characters | ||
``` | ||
@@ -320,3 +320,3 @@ ## Compatibility | ||
[skypack]: https://www.skypack.dev | ||
[esmsh]: https://esm.sh | ||
@@ -323,0 +323,0 @@ [npm]: https://docs.npmjs.com/cli/install |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
234
17662