@putout/processor-markdown 14.0.1 → 14.0.4

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/README.md CHANGED
@@ -25,8 +25,7 @@ npm i @putout/processor-markdown -D
25
25
 
26
26
  ## Rules
27
27
 
28
- - [Remove dependencies status badges](https://github.com/coderaiser/putout/tree/master/packages/processor-markdown/lib/rules/remove-dependencies-status-badge/README.md)
29
- - [Split link with title](https://github.com/coderaiser/putout/tree/master/packages/processor-markdown/lib/rules/split-link-with-title/README.md);
28
+ Checkout `markdown`-related rules in [`@putout/plugin-markdown`](https://github.com/coderaiser/putout/tree/master/packages/plugin-markdown)
30
29
 
31
30
  ## License
32
31
 
package/lib/plugins.js CHANGED
@@ -1,8 +1,5 @@
1
- import * as removeDependenciesStatusBadge from './rules/remove-dependencies-status-badge/index.js';
2
1
  import * as removeTrailingWhitespacesFromHeading from './rules/remove-trailing-whitespaces-from-heading/index.js';
3
2
 
4
3
  export const plugins = [
5
- removeDependenciesStatusBadge,
6
4
  removeTrailingWhitespacesFromHeading,
7
5
  ];
8
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/processor-markdown",
3
- "version": "14.0.1",
3
+ "version": "14.0.4",
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 JavaScript, JSX, TypeScript and JSON snippets",
@@ -1,14 +0,0 @@
1
- # Remove dependencies status badge (remove-dependencies-status-badge)
2
-
3
- ## Rule Details
4
-
5
- ```diff
6
- -# @putout/plugin-apply-replace-all [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL]
7
- +# @putout/plugin-apply-replace-all [![NPM version][NPMIMGURL]][NPMURL]
8
-
9
- [NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-replace-all.svg?style=flat&longCache=true
10
- [NPMURL]: https://npmjs.org/package/@putout/plugin-apply-replace-all "npm"
11
- -
12
- -[DependencyStatusURL]: https://david-dm.org/coderaiser/putout?path=packages/plugin-apply-replace-all
13
- -[DependencyStatusIMGURL]: https://david-dm.org/coderaiser/putout.svg?path=packages/plugin-apply-replace-all
14
- ```
@@ -1,43 +0,0 @@
1
- export const name = 'remove-dependencies-status-badge';
2
-
3
- export const report = () => 'Remove dependencies status badge';
4
-
5
- const noop = () => {};
6
-
7
- export const fix = (node, tree) => {
8
- const children = tree.children.filter(isDependencyStatus());
9
-
10
- tree.children = children;
11
-
12
- const [heading] = children;
13
-
14
- if (heading.type !== 'heading')
15
- return;
16
-
17
- const headingChildren = heading.children.filter(isDependencyLink);
18
-
19
- tree.children[0].children = headingChildren;
20
- };
21
-
22
- export const traverse = (tree, {push}) => {
23
- tree.children.filter(isDependencyStatus(push));
24
- };
25
-
26
- const isDependencyStatus = (push = noop) => (child) => {
27
- if (child.type !== 'definition')
28
- return true;
29
-
30
- if (child.label === 'DependencyStatusURL') {
31
- push(child);
32
- return false;
33
- }
34
-
35
- return child.label !== 'DependencyStatusIMGURL';
36
- };
37
-
38
- const isDependencyLink = (child) => {
39
- if (child.type !== 'linkReference')
40
- return true;
41
-
42
- return child.children[0].label !== 'DependencyStatusIMGURL';
43
- };