Comments (10)
@DanielFerrariR Please provide a minimal and runnable reproduction like a GitHub repository with https://www.gitpod.io/.
from eslint-mdx.
You’ll need the blank lines between comments and other nodes!
(from remark-lint)
Did you try to add a blank line after <!--lint disable no-duplicate-headings-->
?
from eslint-mdx.
Thanks for your reply!
https://github.com/DanielFerrariR/mdx-eslint-example
Couldn't make eslint work on gitpod.io. Maybe because extensions is on beta phase there.
Install dependencies with yarn and see the readme file warnings. Can't disable them even using it correctly.
from eslint-mdx.
@DanielFerrariR Thanks for reporting, and I can reproduce it locally now.
But it seems a bug of remark
API itself, because I tried to call the API manually, the warning is always there:
<!-- README.md -->
<!--lint disable no-literal-urls-->
### Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
const fs = require('fs')
const remark = require('remark')
const remarkMdx = require('remark-mdx')
const remarkLint = require('remark-lint')
const noLiteralUrls = require('remark-lint-no-literal-urls')
const report = require('vfile-reporter')
const file = remark()
.use(remarkLint)
.use(noLiteralUrls)
.use(remarkMdx)
.processSync(fs.readFileSync('README.md', 'utf8'))
console.log(report(file))
5:30-5:93 warning Don’t use literal URLs without angle brackets no-literal-urls remark-lint
⚠ 1 warning
But if I use remark-cli
directly with yarn remark README.md
, there will be no issue anymore.(It's just been replaced silently, the disable comment never works.)
@wooorm Any idea?
Maybe related: remarkjs/remark-lint#47
from eslint-mdx.
OK, I found out that whenever I add remark-mdx
into remarkProcessor
at https://github.com/mdx-js/eslint-mdx/blob/master/packages/eslint-plugin-mdx/src/rules/helper.ts#L81, there will be warnings, if I remove .use(remarkMdx)
there, it will just work as expected.
So it should be an issue of remark-mdx
? @wooorm
What means disable
comments parsed by remark-mdx
will stop working.
from eslint-mdx.
Weird. For a quick fix for now, adding this plugin right after remark-mdx should do the trick @JounQin: https://github.com/mdx-js/mdx/blob/master/packages/mdx/md-ast-to-mdx-ast.js
That’s a step MDX takes right before applying remarkPlugins
, which it’s doing outside of the unified flow unfortunately.
In the v2 branch, I removed that step: https://github.com/mdx-js/mdx/tree/next/packages/mdx
from eslint-mdx.
@wooorm I don't know whether I understand correctly but I tried like following:
const fs = require('fs')
const toMDXAST = require('@mdx-js/mdx/md-ast-to-mdx-ast')
const remark = require('remark')
const remarkMdx = require('remark-mdx')
const remarkLint = require('remark-lint')
const noLiteralUrls = require('remark-lint-no-literal-urls')
const report = require('vfile-reporter')
const file = remark()
.use(remarkLint)
.use(remarkMdx)
.use(toMDXAST)
.use(noLiteralUrls)
.processSync(fs.readFileSync('README.md', 'utf8'))
console.log(report(file))
There will be a fetal error:
Missing compiler for node of type `comment`: `[object Object]`
from eslint-mdx.
Gosh, that’s a pity.
from eslint-mdx.
@wooorm Please help to publish a new release, it should be fixed.
from eslint-mdx.
Published!
Weird: I have a GH_TOKEN
set up (echo $GH_TOKEN had the correct token as output) but yarn deploy
didn’t pick up on it 🤔
from eslint-mdx.
Related Issues (20)
- Parsing error with <img> tag HOT 3
- Parsing error mdx: Missing semicolon HOT 3
- Parsing error with Latex HOT 2
- Document usage in flat config HOT 1
- Parsing error: Expected value to be truthy HOT 4
- How can you type check React props with this plugin? HOT 3
- Please document how to make the linter fixable HOT 3
- Does not check nested code blocks (only lints top-level code blocks) HOT 6
- Research Spike: ESLint 9 compatibility HOT 6
- Incompatible w/ MDX v3? HOT 2
- There are serious issues when used with the `react/self-closing-comp` / `react/jsx-sort-props` rules. HOT 6
- `prettier/prettier` reports, but cannot be fixed automatically
- feat: use `worker.mts` for pure ESM
- feat: respect `.remarkignore`?
- Add more mdast specified nodes into estree AST
- on npm eslint-plugin-mdx v2.3.2 is tagged as latest while v3.1.3 should be HOT 2
- TypeError: Cannot use 'in' operator to search for 'start' in undefined
- maintenance: enable `strictNullChecks` option
- meta: how can we support `eslint-define-config` better? HOT 6
- mdx/code-blocks doesn't respect eslint-disable from outside of the block HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-mdx.