-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
False positive in no-unused-definitons
rule when using mkdocs admonitions
#307
Comments
Welcome @samjcombs! I tried to re-create the issue in CodeSandbox using source from sandbox// ⚠️ Important! Please make sure the dependencies are up to date.
// On code sandbox, you can refresh them in the Dependencies section (left-bottom)
// On stackblitz, you can open the package.json file, update the versions,
// then run npm install in the stackblitz terminal
import { remark } from "remark";
import noUnusedDefinitions from "remark-lint-no-unused-definitions";
const sourceMarkdown = `
!!! note
Here is a note with a [reference].
[reference]: http://is-properly-defined/
`;
async function main() {
document.querySelector("#source").textContent = sourceMarkdown;
const file = await remark()
.use(noUnusedDefinitions)
// .use remark plugins here
.process(sourceMarkdown);
document.querySelector("#result").textContent = String(file);
document.querySelector("#error").textContent = JSON.stringify(
file.messages,
null,
4
);
}
main().catch((error) => {
document.querySelector("#error").textContent = error;
}); Without more detail I'm can only offer some general suggestions:
|
This comment has been minimized.
This comment has been minimized.
thanks for the reply. In response to your questions:
ill try to recreate this error state in a codesandbox for reference. |
Thanks for the confirmation.
If the markdown flavor you tell remark to parse is different from the flavor the content actually is, the linter won't be able to make sense of the content. Happy to answer further questions in the discussion forum https://github.com/orgs/remarkjs/discussions In the meantime closing this out as something which requires admonition fixes rather than linter changes. |
Initial checklist
Affected packages and versions
no-unused-definitions
Link to runnable example
No response
Steps to reproduce
When using mkdoc admonitions, given this input:
an warning is reported on L5
Expected behavior
No warning should be reported
Actual behavior
A warning is reported, possibly due to ast being wierd inside the note admonition block?
Runtime
No response
Package manager
No response
OS
No response
Build and bundle tools
No response
The text was updated successfully, but these errors were encountered: