@putout/processor-markdown 7.0.2 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/markdown.js +13 -3
- package/lib/rules/{index.mjs → index.js} +1 -14
- package/lib/rules/{merge-heading-spaces.mjs → merge-heading-spaces.js} +0 -0
- package/lib/rules/{remove-dependencies-status-badge.mjs → remove-dependencies-status-badge.js} +0 -0
- package/lib/rules/{remove-trailing-whitespaces-from-heading.mjs → remove-trailing-whitespaces-from-heading.js} +0 -0
- package/package.json +1 -1
package/lib/markdown.js
CHANGED
|
@@ -5,7 +5,17 @@ import {
|
|
|
5
5
|
import stringify from 'remark-stringify';
|
|
6
6
|
import preset from 'remark-preset-lint-consistent';
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import removeDependenciesStatusBadge from './rules/remove-dependencies-status-badge.js';
|
|
9
|
+
import removeTrailingWhitespacesFromHeading from './rules/remove-trailing-whitespaces-from-heading.js';
|
|
10
|
+
import mergeHeadingSpceces from './rules/merge-heading-spaces.js';
|
|
11
|
+
|
|
12
|
+
const plugins = [
|
|
13
|
+
removeDependenciesStatusBadge,
|
|
14
|
+
removeTrailingWhitespacesFromHeading,
|
|
15
|
+
mergeHeadingSpceces,
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
import {run} from './rules/index.js';
|
|
9
19
|
import {visit} from 'unist-util-visit';
|
|
10
20
|
import {unified} from 'unified';
|
|
11
21
|
|
|
@@ -35,7 +45,7 @@ export const find = async (rawSource) => {
|
|
|
35
45
|
const {messages} = await unified()
|
|
36
46
|
.use(parseStore)
|
|
37
47
|
.use(preset)
|
|
38
|
-
.use(run, {fix: false})
|
|
48
|
+
.use(run, {plugins, fix: false})
|
|
39
49
|
.use(stringify, stringifyOptions)
|
|
40
50
|
.process(rawSource);
|
|
41
51
|
|
|
@@ -49,7 +59,7 @@ export const fix = async (rawSource) => {
|
|
|
49
59
|
const {value} = await unified()
|
|
50
60
|
.use(parseStore)
|
|
51
61
|
.use(preset)
|
|
52
|
-
.use(run, {fix: true})
|
|
62
|
+
.use(run, {plugins, fix: true})
|
|
53
63
|
.use(stringify, stringifyOptions)
|
|
54
64
|
.process(rawSource);
|
|
55
65
|
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import {lintRule} from 'unified-lint-rule';
|
|
2
|
-
import removeDependenciesStatusBadge from './remove-dependencies-status-badge.mjs';
|
|
3
|
-
import removeTrailingWhitespacesFromHeading from './remove-trailing-whitespaces-from-heading.mjs';
|
|
4
|
-
import mergeHeadingSpceces from './merge-heading-spaces.mjs';
|
|
5
|
-
|
|
6
|
-
const plugins = [
|
|
7
|
-
removeDependenciesStatusBadge,
|
|
8
|
-
removeTrailingWhitespacesFromHeading,
|
|
9
|
-
mergeHeadingSpceces,
|
|
10
|
-
];
|
|
11
2
|
|
|
12
3
|
export const run = lintRule('remark-lint:run', (tree, file, options) => {
|
|
13
|
-
for (const {fix, traverse, report, name} of plugins) {
|
|
4
|
+
for (const {fix, traverse, report, name} of options.plugins) {
|
|
14
5
|
const nodes = [];
|
|
15
6
|
const push = nodes.push.bind(nodes);
|
|
16
7
|
|
|
@@ -30,7 +21,3 @@ export const run = lintRule('remark-lint:run', (tree, file, options) => {
|
|
|
30
21
|
}
|
|
31
22
|
});
|
|
32
23
|
|
|
33
|
-
export const rules = {
|
|
34
|
-
plugins,
|
|
35
|
-
};
|
|
36
|
-
|
|
File without changes
|
package/lib/rules/{remove-dependencies-status-badge.mjs → remove-dependencies-status-badge.js}
RENAMED
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/processor-markdown",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊Putout processor adds ability to parse markdown files and lint js snippets",
|