Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to alex@11 #25

Merged
merged 9 commits into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12, 14]
node-version: [18, 20]
steps:
- name: checkout
uses: actions/checkout@v3
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -32,10 +32,13 @@
"alex"
],
"devDependencies": {
"textlint-scripts": "^12.1.1"
"textlint-scripts": "^13.4.0"
},
"dependencies": {
"alex": "^9.1.1",
"alex": "^11.0.1",
"textlint-rule-helper": "^2.3.0"
},
"resolutions": {
"wrap-ansi": "^7.0.0"
}
}
8 changes: 5 additions & 3 deletions src/textlint-rule-alex.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// LICENSE : MIT
"use strict";
import {RuleHelper} from "textlint-rule-helper";
import alex from "alex";

const defaultOptions = {
allow: undefined,
deny: undefined,
@@ -33,7 +33,9 @@ export default function textlintRuleAlex(context, options = {}) {
report(node, ruleError);
};
return {
[Syntax.Str](node){
async [Syntax.Str](node){
const alex = await import("alex").then(mod => mod.markdown); // markdown equals to default export https://github.com/get-alex/alex/blob/1b4c1be7991b30502cd56fb1d4769708df6853a5/index.js#L56

if (helper.isChildNode(node, [Syntax.Link, Syntax.Image, Syntax.BlockQuote, Syntax.Emphasis])) {
return;
}
@@ -44,4 +46,4 @@ export default function textlintRuleAlex(context, options = {}) {
});
}
}
}
}
6,212 changes: 3,265 additions & 2,947 deletions yarn.lock

Large diffs are not rendered by default.