@@ -94,36 +94,36 @@ A rule for [textlint](https://github.com/textlint/textlint "textlint").
9494``` js
9595var RuleHelper = require (" textlint-rule-helper" ).RuleHelper ;
9696var IgnoreNodeManager = require (" textlint-rule-helper" ).IgnoreNodeManager ;
97- module .exports = function (context ) {
98- var helper = new RuleHelper (context);
99- var ignoreNodeManager = new IgnoreNodeManager ()
100- var exports = {}
101- var reportingErrors = [];
102- exports [context .Syntax .Paragraph ] = function (node ){
103- // Add `Code` node to ignoring list
104- ignoreNodeManager .ignoreChildrenByTypes (node, [context .Syntax .Code ])
105- // do something
106- reportingErrors .push (node, ruleError);
107- };
108- exports [context .Syntax .Str ] = function (node ){
109- // parent nodes is any one Link or Image.
110- if (helper .isChildNode (node, [context .Syntax .Link , context .Syntax .Image ]){
111- return ;
112- }
113- // get Parents
114- var parents = helper .getParents (node);
97+ module .exports = function (context ) {
98+ var helper = new RuleHelper (context);
99+ var ignoreNodeManager = new IgnoreNodeManager ();
100+ var exports = {};
101+ var reportingErrors = [];
102+ exports [context .Syntax .Paragraph ] = function (node ) {
103+ // Add `Code` node to ignoring list
104+ ignoreNodeManager .ignoreChildrenByTypes (node, [context .Syntax .Code ]);
105+ // do something
106+ reportingErrors .push (node, ruleError);
107+ };
108+ exports [context .Syntax .Str ] = function (node ) {
109+ // parent nodes is any one Link or Image.
110+ if (helper .isChildNode (node, [context .Syntax .Link , context .Syntax .Image ])) {
111+ return ;
115112 }
116- [Syntax .Document + " :exit" ](){
117- reportingErrors .forEach (function (node , ruleError ){
118- // if the error is ignored, don't report
119- if (ignoreNodeManager .isIgnored (node)){
120- return ;
121- }
122- // report actual
123- });
124- }
125- return exports ;
126- }
113+ // get Parents
114+ var parents = helper .getParents (node);
115+ };
116+ exports [Syntax .Document + " :exit" ] = function (node ) {
117+ reportingErrors .forEach (function (node , ruleError ) {
118+ // if the error is ignored, don't report
119+ if (ignoreNodeManager .isIgnored (node)) {
120+ return ;
121+ }
122+ // report actual
123+ });
124+ };
125+ return exports ;
126+ };
127127```
128128
129129## Use-Case
0 commit comments