textlint-rule-ja-space-after-question
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -13,34 +13,39 @@ // LICENSE : MIT | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function reporter(context) { | ||
var Syntax = context.Syntax; | ||
var RuleError = context.RuleError; | ||
var report = context.report; | ||
var fixer = context.fixer; | ||
var getSource = context.getSource; | ||
var { | ||
Syntax, | ||
RuleError, | ||
report, | ||
fixer, | ||
getSource | ||
} = context; | ||
var helper = new _textlintRuleHelper.RuleHelper(); | ||
return { | ||
[Syntax.Str](node) { | ||
if (helper.isChildNode(node, [Syntax.Link, "LinkReference", Syntax.Image, Syntax.BlockQuote, Syntax.Emphasis])) { | ||
return; | ||
} | ||
var helper = new _textlintRuleHelper.RuleHelper(); | ||
return _defineProperty({}, Syntax.Str, function (node) { | ||
if (helper.isChildNode(node, [Syntax.Link, Syntax.Image, Syntax.BlockQuote, Syntax.Emphasis])) { | ||
return; | ||
} | ||
var text = getSource(node); | ||
// ?の後ろは全角スペースが推奨 | ||
// 半角スペースである場合はエラーとする | ||
var matchAfter = /?( )[^\n]/; | ||
(0, _matchIndex.matchCaptureGroupAll)(text, matchAfter).forEach(function (match) { | ||
var index = match.index; | ||
var text = getSource(node); // ?の後ろは全角スペースが推奨 | ||
// 半角スペースである場合はエラーとする | ||
return report(node, new RuleError("文末に感嘆符を使用し、後に別の文が続く場合は、直後に全角スペースを挿入します。", { | ||
index: index, | ||
fix: fixer.replaceTextRange([index, index + 1], " ") | ||
})); | ||
}); | ||
}); | ||
var matchAfter = /?( )[^\n]/; | ||
(0, _matchIndex.matchCaptureGroupAll)(text, matchAfter).forEach(match => { | ||
var { | ||
index | ||
} = match; | ||
return report(node, new RuleError("文末に感嘆符を使用し、後に別の文が続く場合は、直後に全角スペースを挿入します。", { | ||
index: index, | ||
fix: fixer.replaceTextRange([index, index + 1], " ") | ||
})); | ||
}); | ||
} | ||
}; | ||
} | ||
module.exports = { | ||
linter: reporter, | ||
fixer: reporter | ||
linter: reporter, | ||
fixer: reporter | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "textlint-rule-ja-space-after-question", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "疑問符の直後のスペースについてのtexlintルール", | ||
@@ -12,16 +12,16 @@ "main": "lib/index.js", | ||
"type": "git", | ||
"url": "git+https://github.com/textlint-ja/textlint-rule-spacing.git" | ||
"url": "git+https://github.com/textlint-ja/textlint-rule-preset-ja-spacing.git" | ||
}, | ||
"author": "azu", | ||
"email": "azuciao@gmail.com", | ||
"homepage": "https://github.com/extlint-ja/textlint-rule-spacing", | ||
"homepage": "https://github.com/extlint-ja/textlint-rule-preset-ja-spacing", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/extlint-ja/textlint-rule-spacing/issues" | ||
"url": "https://github.com/extlint-ja/textlint-rule-preset-ja-spacing/issues" | ||
}, | ||
"scripts": { | ||
"build": "NODE_ENV=production babel src --out-dir lib --source-maps", | ||
"watch": "babel src --out-dir lib --watch --source-maps", | ||
"build": "textlint-scripts build", | ||
"watch": "textlint-scripts build --watch", | ||
"prepublish": "npm run --if-present build", | ||
"test": "mocha" | ||
"test": "textlint-scripts test" | ||
}, | ||
@@ -33,6 +33,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"babel-cli": "^6.0.0", | ||
"babel-preset-es2015": "^6.0.0", | ||
"textlint-tester": "^2.0.0", | ||
"mocha": "^2.3.3" | ||
"textlint-scripts": "^3.0.0" | ||
}, | ||
@@ -42,3 +39,4 @@ "dependencies": { | ||
"textlint-rule-helper": "^2.0.0" | ||
} | ||
}, | ||
"gitHead": "e7bae3dee80b6c6f0c49cc4469f4d22acfc5527d" | ||
} |
@@ -46,3 +46,3 @@ # textlint-rule-ja-space-after-question | ||
See [Releases page](https://github.com/extlint-ja/textlint-rule-spacing/releases). | ||
See [Releases page](https://github.com/extlint-ja/textlint-rule-preset-ja-spacing/releases). | ||
@@ -59,3 +59,3 @@ ## Running tests | ||
For bugs and feature requests, [please create an issue](https://github.com/extlint-ja/textlint-rule-spacing/issues). | ||
For bugs and feature requests, [please create an issue](https://github.com/extlint-ja/textlint-rule-preset-ja-spacing/issues). | ||
@@ -62,0 +62,0 @@ 1. Fork it! |
@@ -15,3 +15,3 @@ // LICENSE : MIT | ||
[Syntax.Str](node){ | ||
if (helper.isChildNode(node, [Syntax.Link, Syntax.Image, Syntax.BlockQuote, Syntax.Emphasis])) { | ||
if (helper.isChildNode(node, [Syntax.Link, "LinkReference", Syntax.Image, Syntax.BlockQuote, Syntax.Emphasis])) { | ||
return; | ||
@@ -18,0 +18,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
9101
1
6
77