git.iko.soy/typeable/remark-validate-links
on main help sign in
Update dependencies, dev-dependencies
commit986797ad8a812810f01b2a4116b9954c060a0f5d authorTitus Wormer <tituswormer@gmail.com> dateThu 20 Aug 2015, 21:47 (11 years ago) parent4263320
9 files changed+66−61
.eslintrc+1 .jscs.json+11−19 .mdastrc+4−3 history.md+1−4 index.js+9−1 package.json+14−22 readme.md+1−1 screen-shot.png → screenshot.png test/index.js+25−11
.eslintrc+1
@@ -1,4 +1,5 @@
11{
2+ "extends": "eslint:recommended",
23 "env": {
34 "node": true
45 },
.jscs.json+11−19
@@ -3,21 +3,20 @@
33 "coverage/",
44 "node_modules/"
55 ],
6− "plugins": [
7− "jscs-jsdoc"
8− ],
96 "jsDoc": {
107 "checkAnnotations": "jsdoc3",
118 "checkParamNames": true,
12− "requireParamTypes": true,
9+ "checkRedundantAccess": true,
1310 "checkRedundantParams": true,
14− "checkReturnTypes": true,
1511 "checkRedundantReturns": true,
16− "requireReturnTypes": true,
12+ "checkReturnTypes": true,
1713 "checkTypes": "strictNativeCase",
18− "checkRedundantAccess": true,
1914 "enforceExistence": true,
20− "requireHyphenBeforeDescription": true
15+ "requireHyphenBeforeDescription": true,
16+ "requireNewlineAfterDescription": true,
17+ "requireParamTypes": true,
18+ "requireParamDescription": true,
19+ "requireReturnTypes": true
2120 },
2221 "requireCurlyBraces": [
2322 "if",
@@ -42,6 +41,9 @@
4241 "requireSpaceBeforeBlockStatements": true,
4342 "requireParenthesesAroundIIFE": true,
4443 "requireSpacesInConditionalExpression": true,
44+ "requireSpacesInFunctionExpression": {
45+ "beforeOpeningCurlyBrace": true
46+ },
4547 "requireSpacesInAnonymousFunctionExpression": {
4648 "beforeOpeningRoundBrace": true,
4749 "beforeOpeningCurlyBrace": true
@@ -50,11 +52,7 @@
5052 "beforeOpeningRoundBrace": true,
5153 "beforeOpeningCurlyBrace": true
5254 },
53− "requireSpacesInFunctionExpression": {
54− "beforeOpeningCurlyBrace": true
55− },
5655 "requireBlocksOnNewline": true,
57− "disallowPaddingNewlinesInBlocks": true,
5856 "disallowEmptyBlocks": true,
5957 "disallowSpacesInsideObjectBrackets": true,
6058 "disallowSpacesInsideArrayBrackets": true,
@@ -134,14 +132,8 @@
134132 "else"
135133 ],
136134 "requireLineFeedAtFileEnd": true,
137− "maximumLineLength": 78,
138135 "requireCapitalizedConstructors": true,
139136 "safeContextKeyword": "self",
140137 "requireDotNotation": true,
141− "disallowYodaConditions": true,
142− "validateJSDoc": {
143− "checkParamNames": true,
144− "checkRedundantParams": true,
145− "requireParamTypes": true
146− }
138+ "disallowYodaConditions": true
147139}
.mdastrc+4−3
@@ -1,10 +1,11 @@
11{
2+ "output": true,
23 "plugins": [
3− "slug",
4− "./",
4+ "comment-config",
55 "lint",
66 "github",
7− "yaml-config"
7+ "slug",
8+ "./"
89 ],
910 "settings": {
1011 "bullet": "*"
history.md+1−4
@@ -1,7 +1,4 @@
1−---
2−mdast:
3− setext: true
4−---
1+<!--mdast setext-->
52
63<!--lint disable no-multiple-toplevel-headings-->
74
index.js+9−1
@@ -1,3 +1,11 @@
1+/**
2+ * @author Titus Wormer
3+ * @copyright 2015 Titus Wormer
4+ * @license MIT
5+ * @module mdast:validate-links
6+ * @fileoverview Validate links to headings and files in markdown.
7+ */
8+
19'use strict';
210
311/*
@@ -8,7 +16,7 @@ var url = require('url');
816var fs = require('fs');
917var path = require('path');
1018var propose = require('propose');
11−var visit = require('mdast-util-visit');
19+var visit = require('unist-util-visit');
1220var definitions = require('mdast-util-definitions');
1321var gh = require('github-url-to-object');
1422var urljoin = require('urljoin');
package.json+14−22
@@ -13,47 +13,39 @@
1313 ],
1414 "dependencies": {
1515 "github-url-to-object": "^1.5.2",
16− "mdast-slug": "^0.1.1",
17− "mdast-util-definitions": "^0.1.0",
18− "mdast-util-visit": "^0.1.1",
16+ "mdast-slug": "^1.0.0",
17+ "mdast-util-definitions": "^1.0.0",
18+ "unist-util-visit": "^1.0.0",
1919 "propose": "0.0.5",
2020 "urljoin": "^0.1.5"
2121 },
22− "repository": {
23− "type": "git",
24− "url": "https://github.com/wooorm/mdast-validate-links.git"
25− },
26− "author": {
27− "name": "Titus Wormer",
28− "email": "tituswormer@gmail.com"
29− },
22+ "repository": "wooorm/mdast-validate-links",
23+ "author": "Titus Wormer <tituswormer@gmail.com>",
3024 "files": [
31− "index.js",
32− "LICENSE"
25+ "index.js"
3326 ],
3427 "devDependencies": {
3528 "cept": "^1.0.0",
36− "eslint": "^0.24.0",
29+ "eslint": "^1.0.0",
3730 "istanbul": "^0.3.0",
38− "jscs": "^1.0.0",
31+ "jscs": "^2.0.0",
3932 "jscs-jsdoc": "^1.0.0",
40− "mdast": "^0.27.0",
41− "mdast-github": "^0.3.0",
42− "mdast-lint": "^0.4.0",
43− "mdast-yaml-config": "^0.2.0",
33+ "mdast": "^1.0.0",
34+ "mdast-comment-config": "^1.0.0",
35+ "mdast-github": "^1.0.0",
36+ "mdast-lint": "^1.0.0",
4437 "mocha": "^2.0.0"
4538 },
4639 "scripts": {
4740 "test-api": "mocha --check-leaks test/index.js",
48− "test-coveralls": "istanbul cover _mocha --report lcovonly -- --check-leaks test/index.js",
4941 "test-coverage": "istanbul cover _mocha -- test/index.js",
50− "test-travis": "npm run test-coveralls",
42+ "test-travis": "npm run test-coverage",
5143 "test": "npm run test-api",
5244 "lint-api": "eslint .",
5345 "lint-style": "jscs --reporter inline .",
5446 "lint": "npm run lint-api && npm run lint-style",
5547 "make": "npm run lint && npm run test-coverage",
56− "build-md": "mdast . --output --quiet",
48+ "build-md": "mdast . --quiet",
5749 "build": "npm run build-md"
5850 }
5951}
readme.md+1−1
@@ -23,7 +23,7 @@ npm install mdast-validate-links
2323
2424## Command line
2525
26−![Example of how mdast-validate-links looks on screen](https://cdn.rawgit.com/wooorm/mdast-validate-links/master/screen-shot.png)
26+![Example of how mdast-validate-links looks on screen](https://cdn.rawgit.com/wooorm/mdast-validate-links/master/screenshot.png)
2727
2828Use **mdast-validate-links** together with [**mdast**](https://github.com/wooorm/mdast)
2929and [**mdast-slug**](https://github.com/wooorm/mdast-slug):
screen-shot.png → screenshot.pngrenamed

Binary file not shown.

test/index.js+25−11
@@ -1,3 +1,11 @@
1+/**
2+ * @author Titus Wormer
3+ * @copyright 2015 Titus Wormer
4+ * @license MIT
5+ * @module mdast:validate-links:test
6+ * @fileoverview Test suite for `mdast-validate-links`.
7+ */
8+
19'use strict';
210
311/* eslint-env mocha */
@@ -13,6 +21,12 @@ var mdast = require('mdast');
1321var cli = require('mdast/lib/cli');
1422var links = require('..');
1523
24+/*
25+ * Methods.
26+ */
27+
28+var equal = assert.strictEqual;
29+
1630/*
1731 * Cache to store output and errors by mdast.
1832 */
@@ -101,7 +115,7 @@ describe('mdast-validate-links', function () {
101115 }, function (err) {
102116 var res = stop();
103117
104− assert.equal(res.err, [
118+ equal(res.err, [
105119 'example.md: done.',
106120 ' 0:0 error Missing slugs. Use for example `mdast-slug` ' +
107121 'to generate heading IDs',
@@ -128,9 +142,9 @@ describe('mdast-validate-links', function () {
128142 }, function (err) {
129143 var res = stop();
130144
131− assert.equal(res.out, '');
145+ equal(res.out, '');
132146
133− assert.equal(res.err, [
147+ equal(res.err, [
134148 'FOOOO: done.',
135149 ' 0:0 error No such file or directory',
136150 '',
@@ -162,7 +176,7 @@ describe('mdast-validate-links', function () {
162176 }, function (err) {
163177 var res = stop();
164178
165− assert.equal(res.err, [
179+ equal(res.err, [
166180 'example.md: done.',
167181 ' 5:37 warning Link to unknown heading: `world`',
168182 ' 23:10 warning Link to unknown file: `examples/world.md`',
@@ -203,9 +217,9 @@ describe('mdast-validate-links', function () {
203217 }, function (err) {
204218 var res = stop();
205219
206− assert.equal(res.out, '');
220+ equal(res.out, '');
207221
208− assert.equal(res.err, [
222+ equal(res.err, [
209223 'example.md: done.',
210224 ' 5:37 warning Link to unknown heading: `world`',
211225 ' 23:10 warning Link to unknown file: `examples/world.md`',
@@ -255,7 +269,7 @@ describe('mdast-validate-links', function () {
255269 }, function (err) {
256270 var res = stop();
257271
258− assert.equal(res.err, [
272+ equal(res.err, [
259273 'definitions.md: done.',
260274 ' 5:12 warning Link to unknown heading: `world`',
261275 '',
@@ -286,9 +300,9 @@ describe('mdast-validate-links', function () {
286300 }, function (err) {
287301 var res = stop();
288302
289− assert.equal(res.out, '');
303+ equal(res.out, '');
290304
291− assert.equal(res.err, [
305+ equal(res.err, [
292306 'example.md: done.',
293307 ' 5:37 warning Link to unknown heading: `world`',
294308 ' 19:34 warning Link to unknown file: `examples/world.md`',
@@ -371,7 +385,7 @@ describe('mdast-validate-links', function () {
371385
372386 fs.unlinkSync('./package.json');
373387
374− assert.equal(res.err, [
388+ equal(res.err, [
375389 'example.md: done.',
376390 ' 5:37 warning Link to unknown heading: `world`',
377391 ' 19:34 warning Link to unknown file: `examples/world.md`',
@@ -445,7 +459,7 @@ describe('mdast-validate-links', function () {
445459 }, function (err) {
446460 var res = stop();
447461
448− assert.equal(res.err, [
462+ equal(res.err, [
449463 'suggestions.md: done.',
450464 ' 3:22 warning Link to unknown heading: ' +
451465 '`helloo`. Did you mean `hello`',