mirror of
https://github.com/remarkjs/remark-lint.git
synced 2024-09-11 11:56:46 +03:00
Use remark plugins to build lists
This commit is contained in:
parent
cf062c99c4
commit
c48746a38b
@ -6,5 +6,7 @@ exports.plugins = [
|
||||
[require('remark-toc'), {tight: true, maxDepth: 2}],
|
||||
require('remark-comment-config'),
|
||||
require('remark-github'),
|
||||
require('remark-validate-links')
|
||||
require('remark-validate-links'),
|
||||
require('./script/plugin/list-of-presets'),
|
||||
require('./script/plugin/list-of-rules')
|
||||
];
|
||||
|
@ -35,11 +35,10 @@
|
||||
"prepublish": "lerna bootstrap",
|
||||
"build-presets": "node script/build-presets",
|
||||
"build-rules": "node script/build-rules",
|
||||
"build-list": "node script/build-list-of-rules",
|
||||
"build-md": "remark . -qfo",
|
||||
"build-bundle": "browserify packages/remark-lint/index.js --bare -s remarkLint > remark-lint.js",
|
||||
"build-mangle": "esmangle remark-lint.js > remark-lint.min.js",
|
||||
"build": "npm run build-presets && npm run build-rules && npm run build-list && npm run build-md && npm run build-bundle && npm run build-mangle",
|
||||
"build": "npm run build-presets && npm run build-rules && npm run build-md && npm run build-bundle && npm run build-mangle",
|
||||
"lint": "xo",
|
||||
"test-api": "node test",
|
||||
"test-coverage": "nyc --reporter lcov tape test.js",
|
||||
|
@ -1,32 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var vfile = require('to-vfile');
|
||||
var remark = require('remark');
|
||||
var zone = require('mdast-zone');
|
||||
var report = require('vfile-reporter');
|
||||
var u = require('unist-builder');
|
||||
var validateLinks = require('remark-validate-links');
|
||||
var config = require('../.remarkrc');
|
||||
var presets = require('./util/presets');
|
||||
var presets = require('../util/presets');
|
||||
|
||||
var root = path.join(process.cwd(), 'packages');
|
||||
var fp = path.join('readme.md');
|
||||
|
||||
remark()
|
||||
.use(config)
|
||||
.use(plugin)
|
||||
.use(validateLinks, false)
|
||||
.process(vfile.readSync(fp), function (err, file) {
|
||||
if (file) {
|
||||
vfile.writeSync(file);
|
||||
file.stored = true;
|
||||
}
|
||||
module.exports = listOfPresets;
|
||||
|
||||
console.error(report(err || file));
|
||||
});
|
||||
|
||||
function plugin() {
|
||||
function listOfPresets() {
|
||||
return transformer;
|
||||
}
|
||||
|
@ -1,32 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var vfile = require('to-vfile');
|
||||
var remark = require('remark');
|
||||
var zone = require('mdast-zone');
|
||||
var report = require('vfile-reporter');
|
||||
var u = require('unist-builder');
|
||||
var validateLinks = require('remark-validate-links');
|
||||
var config = require('../.remarkrc');
|
||||
var rules = require('./util/rules');
|
||||
var rules = require('../util/rules');
|
||||
|
||||
var root = path.join(process.cwd(), 'packages');
|
||||
var fp = path.join('doc', 'rules.md');
|
||||
|
||||
remark()
|
||||
.use(config)
|
||||
.use(plugin)
|
||||
.use(validateLinks, false)
|
||||
.process(vfile.readSync(fp), function (err, file) {
|
||||
if (file) {
|
||||
vfile.writeSync(file);
|
||||
file.stored = true;
|
||||
}
|
||||
module.exports = listOfRules;
|
||||
|
||||
console.error(report(err || file));
|
||||
});
|
||||
|
||||
function plugin() {
|
||||
function listOfRules() {
|
||||
return transformer;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user