-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(deps): update to setence-splitter@5
**BREAKING CHANGES** > [!WARNING] > Require Node.js 18+ - Update to sentence-splitter@5 - https://github.com/textlint-rule/sentence-splitter/releases/tag/v5.0.0
- Loading branch information
Showing
7 changed files
with
1,315 additions
and
1,452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,19 +34,19 @@ | |
}, | ||
"dependencies": { | ||
"@textlint/regexp-string-matcher": "^2.0.2", | ||
"sentence-splitter": "^4.2.0", | ||
"textlint-rule-helper": "^2.3.0", | ||
"textlint-util-to-string": "^3.3.2" | ||
"sentence-splitter": "^5.0.0", | ||
"textlint-rule-helper": "^2.3.1", | ||
"textlint-util-to-string": "^3.3.4" | ||
}, | ||
"devDependencies": { | ||
"@textlint/types": "^13.3.0", | ||
"@types/node": "^18.13.0", | ||
"lint-staged": "^13.1.1", | ||
"prettier": "^2.8.4", | ||
"textlint-plugin-html": "^0.3.0", | ||
"textlint-scripts": "^13.3.0", | ||
"@textlint/types": "^13.4.1", | ||
"@types/node": "^20.10.0", | ||
"lint-staged": "^15.1.0", | ||
"prettier": "^3.1.0", | ||
"textlint-plugin-html": "^1.0.0", | ||
"textlint-scripts": "^13.4.1", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.9.5" | ||
"typescript": "^5.3.2" | ||
}, | ||
"email": "[email protected]", | ||
"lint-staged": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import TextLintTester from "textlint-tester"; | ||
import rule from "../src/sentence-length"; | ||
|
||
const tester = new TextLintTester(); | ||
|
||
(async function testHTML() { | ||
const htmlPlugin = (await import("textlint-plugin-html")).default; | ||
tester.run( | ||
"textlint-rule-sentence-length:plugin", | ||
{ | ||
plugins: [ | ||
{ | ||
pluginId: "html", | ||
plugin: htmlPlugin | ||
} | ||
], | ||
rules: [ | ||
{ | ||
ruleId: "textlint-rule-sentence-length", | ||
rule: rule, | ||
options: { | ||
max: 15 | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
valid: [ | ||
{ | ||
text: "<p>this is a test.</p>", | ||
ext: ".html" | ||
}, | ||
{ | ||
text: "<p>TEST is <a href='https://example.com'>https://example.com</a></p>", | ||
ext: ".html" | ||
} | ||
], | ||
invalid: [ | ||
{ | ||
text: "<p>this is a test for textlint-rule-sentence-length with plugin</p>", | ||
ext: ".html", | ||
errors: [ | ||
{ | ||
message: `Line 1 sentence length(60) exceeds the maximum sentence length of 15. | ||
Over 45 characters.`, | ||
line: 1, | ||
column: 4 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.