-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Supports rules that are written as ECMAScript Modules #868
Labels
Status: Proposal
Request for comments
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This was referenced Sep 10, 2022
|
Change to Async:
flowchart LR
A[Load Config File] --> B[Load Modules]
|
We will introduce new API like New
|
azu
changed the title
Supports rules that are ECMAScript Modules
Supports rules that are written as ECMAScript Modules
Dec 25, 2022
We have two config
It is just idea that we can implement these as separated loader and merge these. type Loader = (_:unknown) => Promise<Config>;
const config = mergeConfig({
await configFileLoader(),
await cliLoader()
});
createTextlint({
config
});
// OR
createTextlint({
loaders: [configFileLoader(), cliLoader()]
}); |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, textlint can not load a rule that is ECMAScript Modules(ESM).
It means that textlint-module-loader.ts use Dynamic Import instead of
require
to load a rule module.This issue aim to support to load a rule that is written by ESM.
It is not that rewrite textlint to ESM.
require()
in CJS can not load ESM, It only load CJSimport()
in CJS can load ESM and CJSTODO
export default { linter, fixter }
?import(rule)
→.default.default
issue still exists?import()
in CJS.The text was updated successfully, but these errors were encountered: