Skip to content

Commit

Permalink
Refactor remark config
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 10, 2023
1 parent f8be2e3 commit db4810d
Show file tree
Hide file tree
Showing 77 changed files with 1,236 additions and 1,249 deletions.
32 changes: 0 additions & 32 deletions .remarkrc.js

This file was deleted.

30 changes: 15 additions & 15 deletions doc/create-a-custom-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ getting started to create your first linting plugin for `remark`.

## Contents

* [Set up the project](#set-up-the-project)
* [Set up remark](#set-up-remark)
* [The `no-invalid-gif` rule](#the-no-invalid-gif-rule)
* [Create the custom rule](#create-the-custom-rule)
* [Rule arguments](#rule-arguments)
* [Rule implementation](#rule-implementation)
* [Import the rule in your remark config](#import-the-rule-in-your-remark-config)
* [Apply the rule on the Markdown file](#apply-the-rule-on-the-markdown-file)
* [Set up the project](#set-up-the-project)
* [Set up remark](#set-up-remark)
* [The `no-invalid-gif` rule](#the-no-invalid-gif-rule)
* [Create the custom rule](#create-the-custom-rule)
* [Rule arguments](#rule-arguments)
* [Rule implementation](#rule-implementation)
* [Import the rule in your remark config](#import-the-rule-in-your-remark-config)
* [Apply the rule on the Markdown file](#apply-the-rule-on-the-markdown-file)

## Set up the project

Expand All @@ -32,10 +32,10 @@ Now we can start installing our dependencies:
npm install remark-lint remark-cli
```

* [`remark-lint`][remark-lint]
— core lint plugin
* [`remark-cli`][remark-cli]
— command line interface
* [`remark-lint`][remark-lint]
— core lint plugin
* [`remark-cli`][remark-cli]
— command line interface

We will also use some utilities:

Expand Down Expand Up @@ -171,9 +171,9 @@ Your rule function will receive three arguments:
(tree, file, options) => {}
```

* `tree` (*required*): [mdast][]
* `file` (*required*): [virtual file][vfile]
* `options` (*optional*): additional info passed to the rule by users
* `tree` (*required*): [mdast][]
* `file` (*required*): [virtual file][vfile]
* `options` (*optional*): additional info passed to the rule by users

## Rule implementation

Expand Down
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,33 @@
"trailingComma": "none",
"useTabs": false
},
"remarkConfig": {
"plugins": [
"remark-comment-config",
[
"remark-gfm",
{
"tablePipeAlign": false
}
],
"remark-github",
"remark-preset-lint-consistent",
"remark-preset-lint-recommended",
[
"remark-toc",
{
"maxDepth": 3
}
],
"remark-validate-links",
[
"remark-lint-list-item-indent",
"space"
],
"./script/plugin/list-of-presets.js",
"./script/plugin/list-of-rules.js"
]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
Expand Down
32 changes: 16 additions & 16 deletions packages/remark-lint-blockquote-indentation/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ too little.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Presets](#presets)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`unified().use(remarkLintBlockquoteIndentation[, config])`](#unifieduseremarklintblockquoteindentation-config)
* [Recommendation](#recommendation)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Presets](#presets)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`unified().use(remarkLintBlockquoteIndentation[, config])`](#unifieduseremarklintblockquoteindentation-config)
* [Recommendation](#recommendation)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)

## What is this?

Expand Down Expand Up @@ -128,10 +128,10 @@ This rule supports standard configuration that all remark lint rules accept

The following options (default: `'consistent'`) are accepted:

* `number` (example: `2`)
— preferred indent of `>` and spaces before content
* `'consistent'`
— detect the first used style and warn when further block quotes differ
* `number` (example: `2`)
— preferred indent of `>` and spaces before content
* `'consistent'`
— detect the first used style and warn when further block quotes differ

## Recommendation

Expand Down
42 changes: 21 additions & 21 deletions packages/remark-lint-checkbox-character-style/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ style.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Presets](#presets)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`unified().use(remarkLintCheckboxCharacterStyle[, config])`](#unifieduseremarklintcheckboxcharacterstyle-config)
* [Recommendation](#recommendation)
* [Fix](#fix)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Presets](#presets)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`unified().use(remarkLintCheckboxCharacterStyle[, config])`](#unifieduseremarklintcheckboxcharacterstyle-config)
* [Recommendation](#recommendation)
* [Fix](#fix)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)

## What is this?

Expand Down Expand Up @@ -127,14 +127,14 @@ This rule supports standard configuration that all remark lint rules accept

The following options (default: `'consistent'`) are accepted:

* `Object` with the following fields:
* `checked` (`'x'`, `'X'`, or `'consistent'`, default: `'consistent'`)
— preferred character to use for checked checkboxes
* `unchecked` (`'·'` (a space), `'»'` (a tab), or `'consistent'`,
default: `'consistent'`)
— preferred character to use for unchecked checkboxes
* `'consistent'`
— detect the first used styles and warn when further checkboxes differ
* `Object` with the following fields:
* `checked` (`'x'`, `'X'`, or `'consistent'`, default: `'consistent'`)
— preferred character to use for checked checkboxes
* `unchecked` (`'·'` (a space), `'»'` (a tab), or `'consistent'`,
default: `'consistent'`)
— preferred character to use for unchecked checkboxes
* `'consistent'`
— detect the first used styles and warn when further checkboxes differ

## Recommendation

Expand Down
26 changes: 13 additions & 13 deletions packages/remark-lint-checkbox-content-indent/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ more than one space.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Presets](#presets)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`unified().use(remarkLintCheckboxContentIndent[, config])`](#unifieduseremarklintcheckboxcontentindent-config)
* [Recommendation](#recommendation)
* [Fix](#fix)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Presets](#presets)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`unified().use(remarkLintCheckboxContentIndent[, config])`](#unifieduseremarklintcheckboxcontentindent-config)
* [Recommendation](#recommendation)
* [Fix](#fix)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)

## What is this?

Expand Down
54 changes: 27 additions & 27 deletions packages/remark-lint-code-block-style/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Presets](#presets)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`unified().use(remarkLintCodeBlockStyle[, config])`](#unifieduseremarklintcodeblockstyle-config)
* [Recommendation](#recommendation)
* [Fix](#fix)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Presets](#presets)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`unified().use(remarkLintCodeBlockStyle[, config])`](#unifieduseremarklintcodeblockstyle-config)
* [Recommendation](#recommendation)
* [Fix](#fix)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)

## What is this?

Expand Down Expand Up @@ -126,20 +126,20 @@ This rule supports standard configuration that all remark lint rules accept

The following options (default: `'consistent'`) are accepted:

* `'fenced'`
— prefer fenced code blocks:
````markdown
```js
code()
```
````
* `'indented'`
— prefer indented code blocks:
```markdown
code()
```
* `'consistent'`
— detect the first used style and warn when further code blocks differ
* `'fenced'`
— prefer fenced code blocks:
````markdown
```js
code()
```
````
* `'indented'`
— prefer indented code blocks:
```markdown
code()
```
* `'consistent'`
— detect the first used style and warn when further code blocks differ

## Recommendation

Expand Down
24 changes: 12 additions & 12 deletions packages/remark-lint-definition-case/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Presets](#presets)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`unified().use(remarkLintDefinitionCase[, config])`](#unifieduseremarklintdefinitioncase-config)
* [Recommendation](#recommendation)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Presets](#presets)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`unified().use(remarkLintDefinitionCase[, config])`](#unifieduseremarklintdefinitioncase-config)
* [Recommendation](#recommendation)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)

## What is this?

Expand Down
24 changes: 12 additions & 12 deletions packages/remark-lint-definition-spacing/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ a definition label.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Presets](#presets)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`unified().use(remarkLintDefinitionSpacing[, config])`](#unifieduseremarklintdefinitionspacing-config)
* [Recommendation](#recommendation)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Presets](#presets)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`unified().use(remarkLintDefinitionSpacing[, config])`](#unifieduseremarklintdefinitionspacing-config)
* [Recommendation](#recommendation)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)

## What is this?

Expand Down

0 comments on commit db4810d

Please sign in to comment.