textlint / textlint-plugin-latex2e

Textlint Plugin LaTeX2ε
MIT License
68 stars 8 forks source link

Update dependencies #46

Closed tani closed 4 years ago

tani commented 4 years ago

@azu Did you update plugin archtecture? I got some errors generated by @textlint/kernel after update dependencies.

  ● Fixing document › latex code with comments (outside of document)

    Plugin should have Processor property.
    module.exports = {
      Processor: class Processor{ ... }
    }

Could you give me your idea?

Related Issue: https://github.com/textlint-rule/textlint-rule-no-unmatched-pair/issues/4

azu commented 4 years ago

What is the actual code?

We did not change plugin loading architecture. the engine/textlint cli does introp es modules and commonjs. https://github.com/textlint/textlint/blob/0503af68f4a34beaab2e45c34463ad4e0e24a958/packages/textlint/src/engine/textlint-module-loader.ts#L93

On the other hand, @textlint/kernel does not interop es modules and commonjs. https://github.com/textlint/textlint-plugin-latex2e/blob/6db3648a7ec058d9aafafcbd23670f7f1019515c/src/index.ts#L19 It export as default and you should import or require("textlint-plugin-latex2e").default https://github.com/textlint/textlint/tree/master/packages/%40textlint/kernel#usage

azu commented 4 years ago

Fmm, It looks like a markdown-plugin issue. https://github.com/textlint/textlint/pull/675 change commonjs to es modules.

I fix it #47

tani commented 4 years ago

Thank you for giving nice advice to me. I can go forward ;)

Cheers :beers: