question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IntelliSense for config

See original GitHub issue

Packages that ship with TypeScript typings can leverage IDE’s intellisense with jsdoc type hints in JS files.

Vite

/**
 * @type {import('vite').UserConfig}
 */
const config = {
  // ...
}

export default config

SvelteKit

/**
 * @type {import('@sveltejs/kit').Config}
 */
const config = {
	// ...
};

export default config;

Tailwind

/** @type {import("@types/tailwindcss/tailwind-config").TailwindConfig } */

Unfortunately I cannot get this working with MDsveX:

/**
 * @type {import('mdsvex').MdsvexOptions}
 **/
const config = {
	extensions: ['.svx', '.md']
};

module.exports = config;

config is still any

I noticed when typing out the path for the others the types/ts files are listed: image

But when doing the same for mdsvex no typescript files are shown: image

Perhaps its an issue how the types are being bundled? (I have no idea how the npm packaging works but just a guess)


Its not majorly important but it is nice 😄

_Originally posted by @michael0liver in https://github.com/pngwn/MDsveX/discussions/280_

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
pngwncommented, Sep 10, 2021

I’m not actually using it, it is probably just a leftover from my struggles to generate types the way I wanted to. I’m using rollup-plugin-dts to generate type iirc. This is because I want to bundle types together as much as possible and not require that a bunch of transitory dependencies have to be installed just for types. The TS compiler does not support this out of the box.

1reaction
pngwncommented, Sep 10, 2021

V1 is being worked and will support both:

/**
 * @type {import('mdsvex').MdsvexOptions}
 **/
 export const mdsvex_config = { ... };

And a config function that provides types:

import { config } from 'mdsvex';

export const mdsvex_config = config({ ... });

This is similar to how vite works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IntelliSense in Visual Studio Code
You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character (such as the dot character (.)...
Read more >
VSCode Intellisense Autocomplete for Webpack Config Files
How to easily enable VSCode Intellisense and autocomplete within Webpack config JS or JSON files.
Read more >
Configure a C++ project for IntelliSense - Microsoft Learn
Learn how to manually configure your C++ project to get IntelliSense working properly by using the Visual Studio IDE to help you identify ......
Read more >
Get Intellisense for Web.config and App.config in Visual Studio ...
This article provides a schema definition for .NET configuration files such as Web.config and App.config . The schema makes Visual Studio .NET help...
Read more >
tailwindlabs/tailwindcss-intellisense: Intelligent Tailwind CSS ...
Install via the Visual Studio Code Marketplace → ; Configure glob patterns to exclude from all IntelliSense features. Inherits all glob patterns from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found