From 217fb8b169a9e60a29940db12d489b6c70240e70 Mon Sep 17 00:00:00 2001 From: azu Date: Sun, 24 Dec 2017 21:02:58 +0900 Subject: [PATCH 1/2] fix(rule): fix false-positive result Completely rewrite sentence parser https://github.com/azu/sentence-splitter/releases/tag/3.0.0 fix #2 --- package.json | 8 +- src/textlint-rule-en-capitalization.js | 109 +++++++------ test/mocha.opts | 2 +- test/textlint-rule-en-capitalization-test.js | 24 ++- yarn.lock | 153 ++++++++++++------- 5 files changed, 187 insertions(+), 109 deletions(-) diff --git a/package.json b/package.json index 6a77999..38fa8ee 100644 --- a/package.json +++ b/package.json @@ -37,9 +37,9 @@ "devDependencies": { "babel-register": "^6.26.0", "husky": "^0.14.3", - "lint-staged": "^4.3.0", - "prettier": "^1.7.4", - "textlint-scripts": "^1.3.0" + "lint-staged": "^6.0.0", + "prettier": "^1.9.2", + "textlint-scripts": "^1.4.0" }, "prettier": { "printWidth": 120, @@ -53,7 +53,7 @@ }, "dependencies": { "en-pos": "^1.0.16", - "sentence-splitter": "^2.2.0", + "sentence-splitter": "^3.0.0", "textlint-rule-helper": "^2.0.0", "textlint-util-to-string": "^2.1.1" } diff --git a/src/textlint-rule-en-capitalization.js b/src/textlint-rule-en-capitalization.js index bdb17ac..8775632 100644 --- a/src/textlint-rule-en-capitalization.js +++ b/src/textlint-rule-en-capitalization.js @@ -1,10 +1,14 @@ // MIT © 2017 azu "use strict"; const { RuleHelper } = require("textlint-rule-helper"); -const StringSource = require("textlint-util-to-string"); -const { split, Syntax: SentenceSyntax } = require("sentence-splitter"); +const { splitAST, Syntax: SentenceSyntax } = require("sentence-splitter"); import { getPosFromSingleWord, isCapitalized, upperFirstCharacter } from "./captalize"; +const REPORT_TYPE = { + Heading: "Heading", + Paragraph: "Paragraph", + List: "List" +}; const shouldNotCapitalized = (string, allowWords) => { // allow words const shouldAllowed = allowWords.some(allowWord => { @@ -25,24 +29,6 @@ const shouldNotCapitalized = (string, allowWords) => { return false; }; -/** - * get node at index - * @param node - * @param index - * @returns {undefined|*} - */ -const getNodeAtIndex = (node, index) => { - if (!node || !node.children) { - return undefined; - } - for (let i = 0; i < node.children.length; i++) { - const childNode = node.children[i]; - if (childNode.range[0] <= index && index <= childNode.range[1]) { - return childNode; - } - } - return undefined; -}; /** * @param node * @param Syntax @@ -52,35 +38,28 @@ const getNodeAtIndex = (node, index) => { * @param fixer * @param {boolean} allowFigures enable figures check * @param {string[]} allowWords allow lower-case words + * @param {string} reportType REPORT_TYPE */ -const checkNode = ({ node, Syntax, getSource, report, RuleError, fixer, allowFigures, allowWords }) => { - const source = new StringSource(node); - const sourceText = source.toString(); - const sentences = split(sourceText); - sentences.filter(sentence => sentence.type === SentenceSyntax.Sentence).forEach(sentence => { - const originalIndex = source.originalIndexFromIndex(sentence.range[0]); - let targetNode; - if (node.type === Syntax.ListItem) { - targetNode = getNodeAtIndex(node.children[0], node.range[0] + originalIndex); - } else { - targetNode = getNodeAtIndex(node, originalIndex); - } - if (!targetNode) { +const checkNode = ({ node, Syntax, getSource, report, RuleError, fixer, allowFigures, allowWords, reportType }) => { + const DocumentURL = "https://owl.english.purdue.edu/owl/resource/592/01/"; + const paragraphNode = splitAST(node); + paragraphNode.children.filter(sentence => sentence.type === SentenceSyntax.Sentence).forEach(sentence => { + const sentenceFirstNode = sentence.children[0]; + if (!sentenceFirstNode) { return; } - const DocumentURL = "https://owl.english.purdue.edu/owl/resource/592/01/"; - // check - if (targetNode.type === Syntax.Str) { - const text = sentence.value; - const firstWord = text.split(" ")[0]; + // check first word is String + if (sentenceFirstNode.type === Syntax.Str) { + const text = sentenceFirstNode.value; + const firstWord = text.split(/\s/)[0]; if (isCapitalized(firstWord) || shouldNotCapitalized(firstWord, allowWords)) { return; } - const index = originalIndex; + const index = 0; return report( - node, + sentenceFirstNode, new RuleError( - `Heading: Follow the standard capitalization rules for American English. + `${reportType}: Follow the standard capitalization rules for American English. See ${DocumentURL}`, { index: index, @@ -88,13 +67,17 @@ See ${DocumentURL}`, } ) ); - } else if (allowFigures && targetNode.type === Syntax.Image && typeof targetNode.alt === "string") { - const text = targetNode.alt; + } else if ( + allowFigures && + sentenceFirstNode.type === Syntax.Image && + typeof sentenceFirstNode.alt === "string" + ) { + const text = sentenceFirstNode.alt; if (isCapitalized(text) || shouldNotCapitalized(text, allowWords)) { return; } return report( - targetNode, + sentenceFirstNode, new RuleError( `Image alt: Follow the standard capitalization rules for American English See ${DocumentURL}` @@ -127,7 +110,17 @@ const report = (context, options = {}) => { if (!allowHeading) { return; } - checkNode({ node, Syntax, getSource, report, RuleError, fixer, allowFigures, allowWords }); + checkNode({ + node, + Syntax, + getSource, + report, + RuleError, + fixer, + allowFigures, + allowWords, + reportType: REPORT_TYPE.Heading + }); }, [Syntax.Paragraph](node) { if (helper.isChildNode(node, [Syntax.Link, Syntax.Image, Syntax.BlockQuote, Syntax.Emphasis])) { @@ -136,13 +129,35 @@ const report = (context, options = {}) => { if (helper.isChildNode(node, [Syntax.ListItem])) { return; } - checkNode({ node, Syntax, getSource, report, RuleError, fixer, allowFigures, allowWords }); + checkNode({ + node, + Syntax, + getSource, + report, + RuleError, + fixer, + allowFigures, + allowWords, + reportType: REPORT_TYPE.Paragraph + }); }, [Syntax.ListItem](node) { if (!allowLists) { return; } - checkNode({ node, Syntax, getSource, report, RuleError, fixer, allowFigures, allowWords }); + node.children.forEach(paragraph => { + checkNode({ + node: paragraph, + Syntax, + getSource, + report, + RuleError, + fixer, + allowFigures, + allowWords, + reportType: REPORT_TYPE.List + }); + }); } }; }; diff --git a/test/mocha.opts b/test/mocha.opts index 7903b88..6324fc6 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -1 +1 @@ ---require babel-register \ No newline at end of file +--require textlint-scripts/register diff --git a/test/textlint-rule-en-capitalization-test.js b/test/textlint-rule-en-capitalization-test.js index dfdebdb..fdd532f 100644 --- a/test/textlint-rule-en-capitalization-test.js +++ b/test/textlint-rule-en-capitalization-test.js @@ -7,6 +7,8 @@ tester.run("capitalization", rule, { valid: [ "In text, follow the standard capitalization rules for American English. Additionally:", "First, sentence should be capital. Second, sentence should be capital.", + "`Code`, this is ok.", + "This is **good**. But that it not good.", "# Capitalization in titles and headings", "## Capitalization and colons\n" + "Use a lowercase letter to begin the first word of the text immediately following a colon, unless the text is one of the following:", @@ -28,7 +30,13 @@ tester.run("capitalization", rule, { options: { allowWords: ["textlint"] } - } + }, + // https://github.com/textlint-rule/textlint-rule-en-capitalization/issues/2 + `# Anatomy of a Package + +A minimal npm package should contain metadata in a _package.json_ file and an associated source file (usually _index.js_). In practice, packages contain more than that and you will have at least a license file and the source in various formats.`, + // need space after . + "This is pass.it's style is bad..." ], invalid: [ { @@ -38,7 +46,7 @@ tester.run("capitalization", rule, { { index: 0, message: - "Heading: Follow the standard capitalization rules for American English.\n" + + "Paragraph: Follow the standard capitalization rules for American English.\n" + "See https://owl.english.purdue.edu/owl/resource/592/01/" } ] @@ -81,11 +89,21 @@ tester.run("capitalization", rule, { `, errors: [{}, {}, {}, {}, {}] }, + { + text: "This is **good**. but that it not good.", + errors: [ + { + index: 18 + } + ] + }, { text: "![image](http://exmaple.com) is not capital.", errors: [ { - index: 0 + index: 0, + message: `Image alt: Follow the standard capitalization rules for American English +See https://owl.english.purdue.edu/owl/resource/592/01/` } ] } diff --git a/yarn.lock b/yarn.lock index b5be40c..81164f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,6 +16,10 @@ version "2.0.0" resolved "https://registry.yarnpkg.com/@textlint/ast-node-types/-/ast-node-types-2.0.0.tgz#b927557ecab55fbb8360140b7b6f1de0c160583f" +"@textlint/ast-node-types@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@textlint/ast-node-types/-/ast-node-types-3.0.0.tgz#bdf67d85adad6c2caaada0e5cc953b7f9016376b" + "@textlint/feature-flag@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@textlint/feature-flag/-/feature-flag-2.0.0.tgz#817cd022291f3a8e2cd0580fb9799a9714f3c530" @@ -80,6 +84,10 @@ ansi-styles@^3.1.0, ansi-styles@^3.2.0: dependencies: color-convert "^1.9.0" +any-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.2.0.tgz#c67870058003579009083f54ac0abafb5c33d242" + anymatch@^1.3.0: version "1.3.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" @@ -821,8 +829,8 @@ chokidar@^1.6.1: fsevents "^1.0.0" ci-info@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.1.tgz#47b44df118c48d2597b56d342e7e25791060171a" + version "1.1.2" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.2.tgz#03561259db48d0474c8bdc90f5b47b068b6bbfb4" circular-json@^0.3.1: version "0.3.3" @@ -913,18 +921,14 @@ core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -cosmiconfig@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-1.1.0.tgz#0dea0f9804efdfb929fbb1b188e25553ea053d37" +cosmiconfig@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-3.1.0.tgz#640a94bf9847f321800403cd273af60665c73397" dependencies: - graceful-fs "^4.1.2" - js-yaml "^3.4.3" - minimist "^1.2.0" - object-assign "^4.0.1" - os-homedir "^1.0.1" - parse-json "^2.2.0" - pinkie-promise "^2.0.0" - require-from-string "^1.1.0" + is-directory "^0.3.1" + js-yaml "^3.9.0" + parse-json "^3.0.0" + require-from-string "^2.0.1" cross-spawn@^5.0.1: version "5.1.0" @@ -960,7 +964,7 @@ date-fns@^1.27.2: version "1.29.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" -debug@3.1.0: +debug@3.1.0, debug@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: @@ -976,6 +980,10 @@ decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" +dedent@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + deep-equal@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" @@ -1072,7 +1080,7 @@ en-stemmer@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/en-stemmer/-/en-stemmer-1.0.3.tgz#2d22fb5db9005a88d6fc58026b38a831c8bc7c19" -error-ex@^1.2.0: +error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" dependencies: @@ -1182,6 +1190,10 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" +find-parent-dir@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" + find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -1519,6 +1531,10 @@ is-decimal@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.1.tgz#f5fb6a94996ad9e8e3761fbfbd091f1fca8c4e82" +is-directory@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + is-dotfile@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" @@ -1602,6 +1618,12 @@ is-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" +is-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-0.2.0.tgz#b361311d83c6e5d726cabf5e250b0237106f5ae2" + dependencies: + symbol-observable "^0.2.2" + is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" @@ -1707,7 +1729,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@^3.2.4, js-yaml@^3.4.3, js-yaml@^3.6.1: +js-yaml@^3.2.4, js-yaml@^3.6.1, js-yaml@^3.9.0: version "3.10.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: @@ -1784,23 +1806,28 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lint-staged@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-4.3.0.tgz#ed0779ad9a42c0dc62bb3244e522870b41125879" +lint-staged@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-6.0.0.tgz#7ab7d345f2fe302ff196f1de6a005594ace03210" dependencies: app-root-path "^2.0.0" chalk "^2.1.0" commander "^2.11.0" - cosmiconfig "^1.1.0" + cosmiconfig "^3.1.0" + debug "^3.1.0" + dedent "^0.7.0" execa "^0.8.0" + find-parent-dir "^0.3.0" is-glob "^4.0.0" jest-validate "^21.1.0" - listr "^0.12.0" + listr "^0.13.0" lodash "^4.17.4" log-symbols "^2.0.0" minimatch "^3.0.0" npm-which "^3.0.1" p-map "^1.1.1" + path-is-inside "^1.0.2" + pify "^3.0.0" staged-git-files "0.0.4" stringify-object "^3.2.0" @@ -1808,9 +1835,9 @@ listr-silent-renderer@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" -listr-update-renderer@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.2.0.tgz#ca80e1779b4e70266807e8eed1ad6abe398550f9" +listr-update-renderer@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz#344d980da2ca2e8b145ba305908f32ae3f4cc8a7" dependencies: chalk "^1.1.3" cli-truncate "^0.2.1" @@ -1830,25 +1857,26 @@ listr-verbose-renderer@^0.4.0: date-fns "^1.27.2" figures "^1.7.0" -listr@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/listr/-/listr-0.12.0.tgz#6bce2c0f5603fa49580ea17cd6a00cc0e5fa451a" +listr@^0.13.0: + version "0.13.0" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.13.0.tgz#20bb0ba30bae660ee84cc0503df4be3d5623887d" dependencies: chalk "^1.1.3" cli-truncate "^0.2.1" figures "^1.7.0" indent-string "^2.1.0" + is-observable "^0.2.0" is-promise "^2.1.0" is-stream "^1.1.0" listr-silent-renderer "^1.1.1" - listr-update-renderer "^0.2.0" + listr-update-renderer "^0.4.0" listr-verbose-renderer "^0.4.0" log-symbols "^1.0.2" log-update "^1.0.2" ora "^0.2.3" p-map "^1.1.1" - rxjs "^5.0.0-beta.11" - stream-to-observable "^0.1.0" + rxjs "^5.4.2" + stream-to-observable "^0.2.0" strip-ansi "^3.0.1" load-json-file@^1.0.0: @@ -2170,7 +2198,7 @@ ora@^0.2.3: cli-spinners "^0.1.2" object-assign "^4.0.1" -os-homedir@^1.0.0, os-homedir@^1.0.1: +os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" @@ -2227,6 +2255,12 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" +parse-json@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-3.0.0.tgz#fa6f47b18e23826ead32f263e744d0e1e847fb13" + dependencies: + error-ex "^1.3.1" + path-exists@^2.0.0, path-exists@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" @@ -2237,7 +2271,7 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-is-inside@^1.0.1: +path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" @@ -2269,6 +2303,10 @@ pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -2302,9 +2340,9 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@^1.7.4: - version "1.7.4" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.4.tgz#5e8624ae9363c80f95ec644584ecdf55d74f93fa" +prettier@^1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.2.tgz#96bc2132f7a32338e6078aeb29727178c6335827" pretty-format@^21.2.1: version "21.2.1" @@ -2545,9 +2583,9 @@ request@2.81.0: tunnel-agent "^0.6.0" uuid "^3.0.0" -require-from-string@^1.1.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" +require-from-string@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.1.tgz#c545233e9d7da6616e9d59adfb39fc9f588676ff" require-uncached@^1.0.3: version "1.0.3" @@ -2579,11 +2617,11 @@ rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1: dependencies: glob "^7.0.5" -rxjs@^5.0.0-beta.11: - version "5.5.2" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.2.tgz#28d403f0071121967f18ad665563255d54236ac3" +rxjs@^5.4.2: + version "5.5.6" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.6.tgz#e31fb96d6fd2ff1fd84bcea8ae9c02d007179c02" dependencies: - symbol-observable "^1.0.1" + symbol-observable "1.0.1" safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" @@ -2593,10 +2631,11 @@ safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" -sentence-splitter@^2.2.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/sentence-splitter/-/sentence-splitter-2.3.1.tgz#43dee616e04e450602e09c26fbda1fe0e94bf56c" +sentence-splitter@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/sentence-splitter/-/sentence-splitter-3.0.0.tgz#2c9066883d95d68f83f37472168e2777f24163b8" dependencies: + "@textlint/ast-node-types" "^3.0.0" concat-stream "^1.5.2" structured-source "^3.0.2" @@ -2686,9 +2725,11 @@ state-toggle@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.0.tgz#d20f9a616bb4f0c3b98b91922d25b640aa2bc425" -stream-to-observable@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.1.0.tgz#45bf1d9f2d7dc09bed81f1c307c430e68b84cffe" +stream-to-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.2.0.tgz#59d6ea393d87c2c0ddac10aa0d561bc6ba6f0e10" + dependencies: + any-observable "^0.2.0" string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" @@ -2798,9 +2839,13 @@ supports-color@^4.0.0: dependencies: has-flag "^2.0.0" -symbol-observable@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" +symbol-observable@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" + +symbol-observable@^0.2.2: + version "0.2.4" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" table@^3.7.8: version "3.8.3" @@ -2875,9 +2920,9 @@ textlint-rule-helper@^2.0.0: dependencies: unist-util-visit "^1.1.0" -textlint-scripts@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/textlint-scripts/-/textlint-scripts-1.3.0.tgz#cb088e01e8dbf30f7c453cc55123f8401cbb6a2b" +textlint-scripts@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/textlint-scripts/-/textlint-scripts-1.4.0.tgz#e1b6af6c600b934d66e031d20b99caa4b230c72e" dependencies: babel-cli "^6.26.0" babel-preset-env "^1.6.1" From 6c6f3b635b59705faccd509dc737c65772cbe5f9 Mon Sep 17 00:00:00 2001 From: azu Date: Sun, 24 Dec 2017 21:04:14 +0900 Subject: [PATCH 2/2] chore(npm): remove unused library --- package.json | 3 +-- yarn.lock | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/package.json b/package.json index 38fa8ee..2735725 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "dependencies": { "en-pos": "^1.0.16", "sentence-splitter": "^3.0.0", - "textlint-rule-helper": "^2.0.0", - "textlint-util-to-string": "^2.1.1" + "textlint-rule-helper": "^2.0.0" } } diff --git a/yarn.lock b/yarn.lock index 81164f5..a666f14 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2940,13 +2940,6 @@ textlint-tester@^3.0.1: "@textlint/feature-flag" "^2.0.0" textlint "^9.0.1" -textlint-util-to-string@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/textlint-util-to-string/-/textlint-util-to-string-2.1.1.tgz#7e456f16a2abc07e473cb9591acf19f110def2d1" - dependencies: - object-assign "^4.0.1" - structured-source "^3.0.2" - textlint@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/textlint/-/textlint-9.0.1.tgz#dd5e070458ac5515d7998835252d30dcb40b6b8e"