Skip to content

Commit ccea691

Browse files
committedDec 17, 2023
list-item-indent: change default to one
1 parent 07140bd commit ccea691

File tree

3 files changed

+81
-34
lines changed

3 files changed

+81
-34
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
"remark-validate-links",
191191
[
192192
"remark-lint-list-item-indent",
193-
"space"
193+
"one"
194194
],
195195
"./script/plugin/list-of-plugins.js",
196196
"./script/plugin/list-of-presets.js"

‎packages/remark-lint-list-item-indent/index.js

+37-18
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
* ###### Parameters
2121
*
22-
* * `options` ([`Options`][api-options], default: `'tab'`)
22+
* * `options` ([`Options`][api-options], default: `'one'`)
2323
* — preferred style
2424
*
2525
* ###### Returns
@@ -30,12 +30,12 @@
3030
*
3131
* Configuration (TypeScript type).
3232
*
33-
* * `'one'`
34-
* — prefer a single space
35-
* * `'tab'`
36-
* — prefer spaces the size of the next tab stop
3733
* * `'mixed'`
3834
* — prefer `'one'` for tight lists and `'tab'` for loose lists
35+
* * `'one'`
36+
* — prefer the size of the bullet and a single space
37+
* * `'tab'`
38+
* — prefer the size of the bullet and a single space to the next tab stop
3939
*
4040
* ###### Type
4141
*
@@ -70,11 +70,11 @@
7070
* CommonMark made that a *lot* better,
7171
* but there remain (documented but complex) edge cases and some behavior
7272
* intuitive.
73-
* Due to this, the default of this list is `'tab'`, which worked the best
74-
* in most markdown parsers *and* in CommonMark.
73+
* Due to this, `'tab'` works the best in most markdown parsers *and* in
74+
* CommonMark.
7575
* Currently the situation between markdown parsers is better,
76-
* so choosing `'one'`, which seems to be the most common style used by
77-
* authors,
76+
* so the default `'one'`,
77+
* which seems to be the most common style used by authors,
7878
* is okay.
7979
*
8080
* ## Fix
@@ -95,8 +95,8 @@
9595
* @example
9696
* {"name": "ok.md"}
9797
*
98-
* *␠␠␠List
99-
* ␠␠␠␠item.
98+
* *␠List
99+
* ␠␠item.
100100
*
101101
* Paragraph.
102102
*
@@ -105,11 +105,11 @@
105105
*
106106
* Paragraph.
107107
*
108-
* *␠␠␠List
109-
* ␠␠␠␠item.
108+
* *␠List
109+
* ␠␠item.
110110
*
111-
* *␠␠␠List
112-
* ␠␠␠␠item.
111+
* *␠List
112+
* ␠␠item.
113113
*
114114
* @example
115115
* {"name": "ok.md", "config": "mixed"}
@@ -146,6 +146,25 @@
146146
* ␠␠item.
147147
*
148148
* @example
149+
* {"config": "tab", "name": "ok.md"}
150+
*
151+
* *␠␠␠List
152+
* ␠␠␠␠item.
153+
*
154+
* Paragraph.
155+
*
156+
* 11.␠List
157+
* ␠␠␠␠item.
158+
*
159+
* Paragraph.
160+
*
161+
* *␠␠␠List
162+
* ␠␠␠␠item.
163+
*
164+
* *␠␠␠List
165+
* ␠␠␠␠item.
166+
*
167+
* @example
149168
* {"name": "not-ok.md", "config": "one", "label": "input"}
150169
*
151170
* *␠␠␠List
@@ -205,14 +224,14 @@ const remarkLintListItemIndent = lintRule(
205224
/**
206225
* @param {Root} tree
207226
* Tree.
208-
* @param {Options | null | undefined} [options='tab']
209-
* Configuration (default: `'tab'`).
227+
* @param {Options | null | undefined} [options='one']
228+
* Configuration (default: `'one'`).
210229
* @returns {undefined}
211230
* Nothing.
212231
*/
213232
function (tree, file, options) {
214233
const value = String(file)
215-
const option = options || 'tab'
234+
const option = options || 'one'
216235

217236
/* c8 ignore next 13 -- previous names. */
218237
// @ts-expect-error: old name.

‎packages/remark-lint-list-item-indent/readme.md

+43-15
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Warn when the whitespace after list item markers violate a given style.
132132

133133
###### Parameters
134134

135-
* `options` ([`Options`][api-options], default: `'tab'`)
135+
* `options` ([`Options`][api-options], default: `'one'`)
136136
— preferred style
137137

138138
###### Returns
@@ -143,12 +143,12 @@ Transform ([`Transformer` from `unified`][github-unified-transformer]).
143143

144144
Configuration (TypeScript type).
145145

146-
* `'one'`
147-
— prefer a single space
148-
* `'tab'`
149-
— prefer spaces the size of the next tab stop
150146
* `'mixed'`
151147
— prefer `'one'` for tight lists and `'tab'` for loose lists
148+
* `'one'`
149+
— prefer the size of the bullet and a single space
150+
* `'tab'`
151+
— prefer the size of the bullet and a single space to the next tab stop
152152

153153
###### Type
154154

@@ -183,11 +183,11 @@ especially with how they interact with indented code.
183183
CommonMark made that a *lot* better,
184184
but there remain (documented but complex) edge cases and some behavior
185185
intuitive.
186-
Due to this, the default of this list is `'tab'`, which worked the best
187-
in most markdown parsers *and* in CommonMark.
186+
Due to this, `'tab'` works the best in most markdown parsers *and* in
187+
CommonMark.
188188
Currently the situation between markdown parsers is better,
189-
so choosing `'one'`, which seems to be the most common style used by
190-
authors,
189+
so the default `'one'`,
190+
which seems to be the most common style used by authors,
191191
is okay.
192192
193193
## Fix
@@ -203,8 +203,8 @@ by default.
203203
###### In
204204
205205
```markdown
206-
*␠␠␠List
207-
␠␠␠␠item.
206+
*␠List
207+
␠␠item.
208208

209209
Paragraph.
210210

@@ -213,11 +213,11 @@ Paragraph.
213213

214214
Paragraph.
215215

216-
*␠␠List
217-
␠␠␠␠item.
216+
*List
217+
␠␠item.
218218

219-
*␠␠List
220-
␠␠␠␠item.
219+
*List
220+
␠␠item.
221221
```
222222

223223
###### Out
@@ -276,6 +276,34 @@ Paragraph.
276276

277277
No messages.
278278

279+
##### `ok.md`
280+
281+
When configured with `'tab'`.
282+
283+
###### In
284+
285+
```markdown
286+
*␠␠␠List
287+
␠␠␠␠item.
288+
289+
Paragraph.
290+
291+
11.␠List
292+
␠␠␠␠item.
293+
294+
Paragraph.
295+
296+
*␠␠␠List
297+
␠␠␠␠item.
298+
299+
*␠␠␠List
300+
␠␠␠␠item.
301+
```
302+
303+
###### Out
304+
305+
No messages.
306+
279307
##### `not-ok.md`
280308

281309
When configured with `'one'`.

0 commit comments

Comments
 (0)
Please sign in to comment.