Skip to content

Commit

Permalink
Fix new Remark support
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Aug 3, 2019
1 parent 60e5e66 commit 574a992
Show file tree
Hide file tree
Showing 4 changed files with 497 additions and 177 deletions.
6 changes: 3 additions & 3 deletions dist/blank-lines.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ function blankLines(tree, file) {
if (next && isApplicable(node) && isApplicable(next)) {
if (node.type === 'heading' && next.type === 'heading') {
if (position.start(next).line !== position.end(node).line + 2) {
file.warn('Incorrect number of blank lines between headings', node);
file.message('Incorrect number of blank lines between headings', node);
}
} else if (node.type === 'heading' && next.type !== 'heading') {
if (position.start(next).line - position.end(node).line !== 2) {
file.warn('Incorrect number of blank lines between heading and section', node);
file.message('Incorrect number of blank lines between heading and section', node);
}
} else if (node.type === 'list') {
if (position.start(next).line - position.end(node).line !== 3) {
file.warn('Incorrect number of blank lines between last section and next heading', node);
file.message('Incorrect number of blank lines between last section and next heading', node);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/blank-lines.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ function blankLines(tree, file) {
if (next && isApplicable(node) && isApplicable(next)) {
if (node.type === 'heading' && next.type === 'heading') {
if (position.start(next).line !== position.end(node).line + 2) {
file.warn('Incorrect number of blank lines between headings', node);
file.message('Incorrect number of blank lines between headings', node);
}
} else if (node.type === 'heading' && next.type !== 'heading') {
if (position.start(next).line - position.end(node).line !== 2) {
file.warn('Incorrect number of blank lines between heading and section', node);
file.message('Incorrect number of blank lines between heading and section', node);
}
} else if (node.type === 'list') {
if (position.start(next).line - position.end(node).line !== 3) {
file.warn('Incorrect number of blank lines between last section and next heading', node);
file.message('Incorrect number of blank lines between last section and next heading', node);
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
},
"license": "MIT",
"dependencies": {
"unified-lint-rule": "^1.0.0",
"unist-util-generated": "^1.1.0",
"unist-util-position": "^3.0.0",
"unist-util-visit": "^1.0.0"
"unified-lint-rule": "^1.0.4",
"unist-util-generated": "^1.1.4",
"unist-util-position": "^3.0.3",
"unist-util-visit": "^2.0.0"
},
"devDependencies": {
"babel-cli": "^6.23.0",
Expand All @@ -24,9 +24,9 @@
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.10.0",
"remark": "^7.0.0",
"remark-cli": "^3.0.0",
"remark-lint": "^6.0.0",
"remark": "^11.0.1",
"remark-cli": "^7.0.0",
"remark-lint": "^6.0.5",
"tape": "^4.6.3"
},
"scripts": {
Expand Down
Loading

0 comments on commit 574a992

Please sign in to comment.