ElecTreeFrying / auto-import-relative-path

Auto Import Relative Path is a time-saving extension that simplifies importing relative paths in your code. With this tool, you can easily import files without the need to type out lengthy and complex paths. It's a great solution for projects of any size and can help streamline your workflow.
https://marketplace.visualstudio.com/items?itemName=ElecTreeFrying.auto-import
MIT License
8 stars 1 forks source link

Allow for handling MDX files just like Markdown files #10

Open Zenahr opened 1 year ago

Zenahr commented 1 year ago

Allow for handling MDX files just like Markdown files, essentially handling .mdx files just like .md already are being handled.

https://mdxjs.com/ https://docusaurus.io/docs/markdown-features/react

Most often, users would import images I think.

Zenahr commented 1 year ago

@ElecTreeFrying Haven't tested this yet but I think it works if you assign mdx to markdown in VSCode (in general). Maybe that's a good enough workaround?

ElecTreeFrying commented 1 year ago

@Zenahr Could you please confirm whether the import statements below are correct? I haven't researched this yet, but I am asking ChatGPT for help. My plan is to add support for these import statements first and then release the proper update after researching for MDX file imports.

  1. JavaScript files (.js) import moduleName from './module.js';

  2. CSS files (.css) import './styles.css';

  3. Image files (.jpg, .png, .gif, .webp) import myImage from './my-image.png';

  4. JSON files (.json) import data from './data.json';

  5. YAML files (.yaml, .yml) import data from './data.yml';

  6. Markdown files (.md) import myContent from './my-content.md';

  7. Other MDX files import MyComponent from './MyComponent.mdx';