-
Notifications
You must be signed in to change notification settings - Fork 64
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: compatibility with eslint-mdx #178
Conversation
Hi @JounQin!, thanks for the Pull Request The first commit message isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.
Read more about contributing to ESLint here |
"extends": ["plugin:mdx/recommended"], | ||
"processor": "markdown/markdown", | ||
"rules": { | ||
"mdx/remark": 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The related PR has not been merged and released, disable temporarily.
@@ -16,7 +16,7 @@ const SUPPORTS_AUTOFIX = true; | |||
|
|||
const markdown = unified().use(remarkParse); | |||
|
|||
let blocks = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The blocks
will not work when writing markdown codes in code blocks.
Lifecycle:
preprocess('.md') -> preprocess('.md/0_0.md') -> postprocess('.md/0_0.md') -> postprocess('.md')
This was not a problem before because there was no markdown -> md
mapper before, so .markdown
files were not linted actually.
"eslint-plugin-node": "^9.0.0", | ||
"eslint-release": "^3.1.2", | ||
"mocha": "^6.2.2", | ||
"nyc": "^14.1.1" | ||
}, | ||
"dependencies": { | ||
"remark-parse": "^5.0.0", | ||
"unified": "^6.1.2" | ||
"remark-parse": ">=5.0.0 <9.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9.0 has breaking change, its parser is rewritten totally.
friendly ping @btmills @mdjermanovic |
Hi @JounQin, I appreciate the enthusiasm! #134 was closed because MDX was out of scope for this plugin, which is focused just on Markdown. If something significant has changed since then, we can reconsider if you'd like to open a new issue describing how the situation is different now. (Maybe that's #179? Having a clear problem statement and situation update would help.) I'll hold off reviewing this for now because I wouldn't want you to put a bunch of effort into a feature that may not be added. If we decide on the issue to move forward, then we can come back here and discuss how best to implement the feature. |
@btmills Hi, #179 is not related, at this PR actually only adds For For For ts typings generated by typescript + jsdoc, it will be easier to be resued in I added |
I see, there's a lot going on here. Let's split it up:
Can you open an issue describing this in detail? If it's a bug in the current version, that's worth fixing, but I want to dig in first to make sure I understand.
I believe #176 is working as intended by eslint/rfcs#3. I'll wait a bit longer for the author to respond just in case there really is a bug. If not, I'll close that issue. Adding the language mapper would be a breaking change. In v2, the plugin just moved away from hard-coding extensions like v1 had to. That was all enabled by the new ESLint processor API from RFC3.
I see you improved the JSDoc types. That's great! However, projects under the ESLint org don't ship types as part of the package. So we'll gratefully accept any JSDoc annotation improvements you find as standalone
Now I understand what that's for. The repository already has example setups with |
raised #181 to track
I understand your position, but IMO the problem is that should we treat code block with I will refactor other things you mentioned. |
If you don't like language mapper support, I'll drop it here and add this support on close this PR in favor of the splitted two. |
@btmills Any news for the two separated PRs? |
resolve #134, fix #176 and mdx-js/eslint-mdx#259
close #180
related mdx-js/eslint-mdx#283
I added a
getShortLang
helper, but I don't know if you'll agree. Personally I think it's useful for example I'm writingJavaScript
language, but the file extension should be.js
. Or, we can provide an option.See also #178 (comment)