-
-
Notifications
You must be signed in to change notification settings - Fork 9k
fix(module-type-aliases): add svg declaration #5945
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
fix(module-type-aliases): add svg declaration #5945
Conversation
i can agree with svg being in there, but user should define it themself for scss ans sass |
Thanks, I agree with @armano2—afaik we don't have SASS & SCSS loaders OOTB, do we? Do they work without any extra configuration? |
✔️ [V2] 🔨 Explore the source changes: 6c677b9 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61912aabd2f148000862437d 😎 Browse the preview: https://deploy-preview-5945--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5945--docusaurus-2.netlify.app/ |
Thanks @Josh-Cena @armano2. Tell me if I should remove the |
@MisterFISHUP You could do it in your own project: add a |
That's what I did 😄. Anyway, thanks for your reply @Josh-Cena. I also changed the title of the PR. |
@Josh-Cena I'm not sure if I did this correctly, so I would like to ask your opinion before making the commit: // in `packages/docusaurus-module-type-aliases/src/index.d.ts`
declare module '*.svg' {
import type { ComponentType, SVGProps } from 'react';
const ReactComponent: ComponentType<SVGProps<SVGSVGElement>>;
export default ReactComponent;
} Thank you for your time |
Yeah, I think that looks better |
Motivation
Try to fix #3424 (comment) by adding module declarations in
packages/docusaurus-module-type-aliases/src/index.d.ts
:Currently, if one uses
import
ending with.module.scss
,.scss
,.svg
in a.tsx
file, VSCode (ESLint) will display errors like:These errors don't appear in
.js
files.Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Just tested with
yarn run start
(aftercd website
),yarn prettier
,yarn lint
, andyarn test
.