@mdx-js/language-service
Version:
MDX support for Volar
23 lines (20 loc) • 568 B
JavaScript
/**
* @import {VirtualCodePlugin} from './plugin.js'
*/
/**
* @param {unknown} options
* @returns {VirtualCodePlugin}
*/
export function recmaExportFilepath(options) {
const opts = typeof options === 'object' && options !== null ? options : {}
const name = 'name' in opts ? String(opts.name) : 'filepath'
return () => ({
finalize() {
return (
'/** Generated by [recma-export-filepath](https://github.com/remcohaszing/recma-export-filepath) */\nexport const ' +
name +
" = /** @type {string} */ ('')"
)
}
})
}