Skip to content

Commit b4b17f0

Browse files
authored
refactor: update dependencies (#7)
* refactor: update dependencies * chore: update lock * refactor: use import
1 parent bd2787d commit b4b17f0

File tree

9 files changed

+2601
-2545
lines changed

9 files changed

+2601
-2545
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: [ 14, 16, 18 ]
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

.mocharc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": [
3+
"textlint-scripts/register"
4+
]
5+
}

.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-rousseau [![Build Status](https://travis-ci.org/textlint-rule/textlint-rule-rousseau.svg?branch=master)](https://travis-ci.org/textlint-rule/textlint-rule-rousseau)
1+
# textlint-rule-rousseau [![Actions Status: test](https://github.com/textlint-rule/textlint-rule-rousseau/workflows/test/badge.svg)](https://github.com/textlint-rule/textlint-rule-rousseau/actions?query=workflow%3A"test")
22

33
A [textlint](https://github.com/textlint/textlint "textlint") rule check english sentence using [rousseau](https://github.com/GitbookIO/rousseau "rousseau").
44

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@
3535
"spellcheck"
3636
],
3737
"devDependencies": {
38-
"textlint-scripts": "^2.1.0"
38+
"textlint-scripts": "^12.1.1",
39+
"textlint-tester": "^12.1.1"
3940
},
4041
"dependencies": {
4142
"rousseau": "^1.0.0",
42-
"textlint-rule-helper": "^2.0.0",
43-
"textlint-util-to-string": "^2.1.1",
43+
"textlint-rule-helper": "^2.2.1",
44+
"textlint-util-to-string": "^3.1.1",
4445
"unist-util-map": "^1.0.2"
4546
}
4647
}

src/textlint-rule-rousseau.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// LICENSE : MIT
22
"use strict";
3-
import {RuleHelper, IgnoreNodeManager} from "textlint-rule-helper";
4-
const StringSource = require("textlint-util-to-string");
5-
const rousseau = require("rousseau");
6-
const map = require("unist-util-map");
3+
import { RuleHelper, IgnoreNodeManager } from "textlint-rule-helper";
4+
import { StringSource } from "textlint-util-to-string";
5+
import rousseau from "rousseau";
6+
import map from "unist-util-map";
7+
78
const defaultOptions = {
89
// "suggestion", "warning", "error"
910
showLevels: ["suggestion", "warning", "error"],
@@ -28,7 +29,7 @@ const mapNode = function (ast, mapFn) {
2829
module.exports = function textlintRousseau(context, options = defaultOptions) {
2930
const helper = new RuleHelper(context);
3031
const ignoreNodeManager = new IgnoreNodeManager();
31-
const {Syntax, RuleError, report, getSource} = context;
32+
const { Syntax, RuleError, report, getSource } = context;
3233
const showLevels = options.showLevels || defaultOptions.showLevels;
3334
const ignoreTypes = options.ignoreTypes || defaultOptions.ignoreTypes;
3435
const ignoreInlineNodeTypes = options.ignoreInlineNodeTypes || [Syntax.Code];
@@ -69,7 +70,7 @@ module.exports = function textlintRousseau(context, options = defaultOptions) {
6970
return "";
7071
}
7172
return "\nSuggestions:\n"
72-
+ replacements.map(({value}) => {
73+
+ replacements.map(({ value }) => {
7374
return "=> " + value;
7475
}).join("\n");
7576
};
@@ -94,7 +95,7 @@ module.exports = function textlintRousseau(context, options = defaultOptions) {
9495
});
9596
report(node, ruleError);
9697
};
97-
98+
9899
return {
99100
[Syntax.Paragraph](node) {
100101
// ignore if wrapped node types

test/mocha.opts

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/textlint-rule-rousseau-test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// LICENSE : MIT
22
"use strict";
3-
var TextLintTester = require("textlint-tester");
3+
import TextLintTester from "textlint-tester";
4+
45
var tester = new TextLintTester();
56
// rule
67
import rule from "../src/textlint-rule-rousseau";
@@ -98,4 +99,4 @@ Suggestions:
9899
]
99100
},
100101
]
101-
});
102+
});

0 commit comments

Comments
 (0)