Skip to content
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

chore(website): auto-inject ban-types default options #7714

Merged

Conversation

Josh-Cena
Copy link
Member

PR Checklist

Overview

Ideally I should use an actual parser to get the defaultTypes, but there's no parser package readily installed in the website, so I thought this should do too.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @Josh-Cena!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@netlify
Copy link

netlify bot commented Oct 1, 2023

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 3427afb
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/653162bd25cd9c0008f7ef4a
😎 Deploy Preview https://deploy-preview-7714--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 95 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -299,6 +299,33 @@ export const generatedRuleDocs: Plugin = () => {
}
}

// Insert default rule options for ban-types
if (file.stem === 'ban-types') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬 I do dislike having such rule-specific things in this already kind of big file... what do you think about having an mdx component like <BanTypesDefaultOptions />?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have file-specific handling for this page. This cannot be an MDX component because it has to work server-side and get statically injected instead of dynamically rendered.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blurgh, I keep forgetting these things. MDX components don't work server-side? Is this mentioned in docs / one of the things blocked by MDX v2? (I searched and can't find it)

Copy link
Member Author

@Josh-Cena Josh-Cena Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MDX components are basically React components. They can get server-rendered (through the same machinery that renders the rest of the page to HTML) but they can't access server data like files.

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable - I'll defer to you on Docusaurus things 😄

@JoshuaKGoldberg JoshuaKGoldberg changed the title refactor(website): auto-inject ban-types default options build(website): auto-inject ban-types default options Oct 19, 2023
@JoshuaKGoldberg JoshuaKGoldberg changed the title build(website): auto-inject ban-types default options chore(website): auto-inject ban-types default options Oct 19, 2023
@JoshuaKGoldberg JoshuaKGoldberg merged commit 76ab373 into typescript-eslint:main Oct 19, 2023
45 of 46 checks passed
@Josh-Cena Josh-Cena deleted the inject-ban-types-default branch October 19, 2023 17:59
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: ban-types.md should pull in defaultTypes automatically
2 participants