textlint-rule-editorconfig
Version:
Let EditorConfig and Textlint works together.
24 lines (20 loc) • 503 B
JavaScript
;
const getConfig = require('./editorconfig/get-config');
const rules = require('./rules');
function reporter(context, option) {
const exports = {};
exports[context.Syntax.Document] = (node) => getConfig(context.getFilePath()).then((config) => {
const args = {
context,
node,
option,
text: context.getSource(node)
};
rules.forEach((rule) => rule(config, args));
});
return exports;
}
module.exports = {
linter: reporter,
fixer: reporter
};