Skip to content

Commit 73a6a7e

Browse files
authored
fix(deps): update to kuromojin@3 (#10)
* fix(deps): update kuromojin@3 * fix: use default export * ci: move to GitHub Actions
1 parent 15cdaa6 commit 73a6a7e

File tree

7 files changed

+50
-25
lines changed

7 files changed

+50
-25
lines changed

.github/workflows/test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: test
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
name: "Test on Node.js ${{ matrix.node-version }}"
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
node-version: [12, 14]
10+
steps:
11+
- name: checkout
12+
uses: actions/checkout@v2
13+
- name: setup Node.js ${{ matrix.node-version }}
14+
uses: actions/setup-node@v2
15+
with:
16+
node-version: ${{ matrix.node-version }}
17+
- name: Install
18+
run: yarn install
19+
- name: Test
20+
run: yarn test

.travis.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# textlint-rule-ja-no-successive-word
1+
# textlint-rule-ja-no-successive-word [![Actions Status: test](https://github.com/textlint-ja/textlint-rule-ja-no-successive-word/workflows/test/badge.svg)](https://github.com/textlint-ja/textlint-rule-ja-no-successive-word/actions?query=workflow%3A"test")
22

33
同一の単語(厳密には形態素解析した結果のToken)が間違えて連続しているのを見つけるtextlintルール。
44
入力ミスによる同じ単語が連続している問題を発見します。

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
},
3838
"dependencies": {
3939
"@textlint/regexp-string-matcher": "^1.1.0",
40-
"kuromojin": "^2.0.0"
40+
"kuromojin": "^3.0.0"
4141
}
4242
}

src/textlint-rule-ja-no-successive-word.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// LICENSE : MIT
22
"use strict";
3-
const matchPatterns = require("@textlint/regexp-string-matcher").matchPatterns;
4-
const tokenize = require("kuromojin").tokenize;
3+
import { matchPatterns } from "@textlint/regexp-string-matcher";
4+
import { tokenize } from "kuromojin";
5+
56
const DefaultOptions = {
67
// オノマトペを許可する
78
// 制限: オノマトペを判定する方法がないため、同じカタカナの語が連続したものをオノマトペとして扱う
@@ -18,7 +19,7 @@ function isOnomatopee(str) {
1819
return /^[-]*$/.test(str);
1920
}
2021

21-
module.exports = function(context, options = {}) {
22+
export default function(context, options = {}) {
2223
const allowOnomatopee = options.allowOnomatopee !== undefined ? options.allowOnomatopee
2324
: DefaultOptions.allowOnomatopee;
2425
const allow = options.allow || DefaultOptions.allow;

test/textlint-rule-ja-no-successive-word-test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
const TextLintTester = require("textlint-tester");
2-
const tester = new TextLintTester();
3-
// rule
1+
import TextLintTester from "textlint-tester";
42
import rule from "../src/textlint-rule-ja-no-successive-word";
3+
4+
const tester = new TextLintTester();
5+
56
// ruleName, rule, { valid, invalid }
67
tester.run("ja-no-successive-word", rule, {
78
valid: [

yarn.lock

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,21 +2351,22 @@ kind-of@^6.0.0, kind-of@^6.0.2:
23512351
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
23522352
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
23532353

2354-
2355-
version "0.1.1"
2356-
resolved "https://registry.yarnpkg.com/kuromoji/-/kuromoji-0.1.1.tgz#4aabf39bcced8b8ad92d007a04a26be6da8477c9"
2357-
integrity sha1-Sqvzm8zti4rZLQB6BKJr5tqEd8k=
2354+
2355+
version "0.1.2"
2356+
resolved "https://registry.yarnpkg.com/kuromoji/-/kuromoji-0.1.2.tgz#293f0d6706df006112137980588d5daac26d0790"
2357+
integrity sha512-V0dUf+C2LpcPEXhoHLMAop/bOht16Dyr+mDiIE39yX3vqau7p80De/koFqpiTcL1zzdZlc3xuHZ8u5gjYRfFaQ==
23582358
dependencies:
23592359
async "^2.0.1"
23602360
doublearray "0.0.2"
2361-
zlibjs "^0.2.0"
2361+
zlibjs "^0.3.1"
23622362

2363-
kuromojin@^2.0.0:
2364-
version "2.0.0"
2365-
resolved "https://registry.yarnpkg.com/kuromojin/-/kuromojin-2.0.0.tgz#23e74a5ed2578432c9703ae75a69ba0a09ccb12d"
2366-
integrity sha512-60j/yLkFSc4t4roj8tI8ZNNSiAFnrkgXw8SqXz/9nakfs6mkCvPbrd7S8LDr4YNwEt1IyLys5JQTR9EnYyGHhA==
2363+
kuromojin@^3.0.0:
2364+
version "3.0.0"
2365+
resolved "https://registry.yarnpkg.com/kuromojin/-/kuromojin-3.0.0.tgz#54a1a6643110f49f741c4beb82fef400d1cd498b"
2366+
integrity sha512-3h3qnn/NVVhqoKFP4oc7e6apO2B01Atc056oiVlIY7Uoup4rhrnBe28g3y9lK1HTmLDQEejvXB+3I3qxAneF7A==
23672367
dependencies:
2368-
kuromoji "0.1.1"
2368+
kuromoji "0.1.2"
2369+
lru_map "^0.4.1"
23692370

23702371
leven@^3.1.0:
23712372
version "3.1.0"
@@ -2473,6 +2474,11 @@ loud-rejection@^1.0.0:
24732474
currently-unhandled "^0.4.1"
24742475
signal-exit "^3.0.0"
24752476

2477+
lru_map@^0.4.1:
2478+
version "0.4.1"
2479+
resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.4.1.tgz#f7b4046283c79fb7370c36f8fca6aee4324b0a98"
2480+
integrity sha512-I+lBvqMMFfqaV8CJCISjI3wbjmwVu/VyOoU7+qtu9d7ioW5klMgsTTiUOUp+DJvfTTzKXoPbyC6YfgkNcyPSOg==
2481+
24762482
make-dir@^2.0.0, make-dir@^2.1.0:
24772483
version "2.1.0"
24782484
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5"
@@ -3937,7 +3943,7 @@ [email protected], yargs@^13.3.0:
39373943
y18n "^4.0.0"
39383944
yargs-parser "^13.1.2"
39393945

3940-
zlibjs@^0.2.0:
3941-
version "0.2.0"
3942-
resolved "https://registry.yarnpkg.com/zlibjs/-/zlibjs-0.2.0.tgz#ae20f06243293d85c255563189f9b12f5b3ba1a0"
3943-
integrity sha1-riDwYkMpPYXCVVYxifmxL1s7oaA=
3946+
zlibjs@^0.3.1:
3947+
version "0.3.1"
3948+
resolved "https://registry.yarnpkg.com/zlibjs/-/zlibjs-0.3.1.tgz#50197edb28a1c42ca659cc8b4e6a9ddd6d444554"
3949+
integrity sha1-UBl+2yihxCymWcyLTmqd3W1ERVQ=

0 commit comments

Comments
 (0)