-
Notifications
You must be signed in to change notification settings - Fork 152
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
feat(docs): add linting #2716
feat(docs): add linting #2716
Conversation
b64c517
to
fe1959e
Compare
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.
I just remembered one more thing.
924fdf4
to
fed8689
Compare
Size Change: 0 B Total Size: 476 kB ℹ️ View Unchanged
|
9a15c6c
to
c6e6b8a
Compare
docs/src/documentation/05-development/01-guides/04-no-exporting-components.mdx
Outdated
Show resolved
Hide resolved
.../documentation/06-kiwi-use/02-content/04-specific-areas/social-media/02-visual-treatment.mdx
Outdated
Show resolved
Hide resolved
.../documentation/06-kiwi-use/02-content/04-specific-areas/social-media/02-visual-treatment.mdx
Outdated
Show resolved
Hide resolved
...src/documentation/06-kiwi-use/02-content/04-specific-areas/technical-content/04-language.mdx
Outdated
Show resolved
Hide resolved
c6e6b8a
to
8622443
Compare
a129de8
to
b549b21
Compare
b549b21
to
cbd2c03
Compare
extends: ["plugin:mdx/recommended"], | ||
rules: { | ||
"react/jsx-filename-extension": ["error", { extensions: [".mdx"] }], | ||
"mdx/no-unescaped-entities": "OFF", |
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.
Hi, I’m the author of eslint-mdx
, so glad that you’re using it.
Just to confirm, is there any problem with this rule or you’d just want to ignore it?
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.
Hi! Thanks so much for having a look at our configuration. When the rule is turned off, I get a lot of warnings about apostrophes and the like being able to be escaped. I don't want to escape things in markdown.
These cases are markdown inside components (example). I turned it off to get only relevant warnings.
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.
That's interesting, I thought mdx
as jsx
more than md
, but users like you may think oppositely. So I'm considering disable it by default in the recommended config.
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.
I don't want to speak for others, but in my case I definitely think of it as md
with extra features. But I'm a writer first and a programmer second.
], | ||
}, | ||
settings: { | ||
"import/resolver": { |
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.
eslint-import-resolver-typescript
should be preferred for ts files.
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.
I agree even our *.ts?(x)
files don't seem to have the resolver set up, I can't remember what was the problem I ran into… 🤔
@@ -3,6 +3,10 @@ | |||
module.exports = { | |||
"*.{js,js.flow,ts}": "eslint --fix --report-unused-disable-directives", | |||
"*.md": "prettier --write", | |||
"*.mdx": [ |
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.
.md
can be merged into this one
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.
First of all, you're awesome for reviewing this PR. ❤️
What do you mean by this, though? We use Prettier through ESLint, so it*.mdx
doesn't need to be prettified additionally, unlike *.md
files which only use Prettier.
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.
Why remark-lint
related rules are not enabled for .md
files?
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.
That's just a temporary thing, probably. We were focusing on the new docs that we're adding, which are all .mdx
. We can then go over the older docs we have and see how the rules and everything works. Didn't want to fix a bunch of errors without knowing if we liked the workflow. 🙂
Added linting of markdown code, prose, and links.
Some notes:
Orbit.kiwi: https://orbit-docs-docs-linting.surge.sh
Storybook: https://orbit-docs-linting.surge.sh