You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a JS node module consumer uses a TS node module that exports using export default, the JS author must write const moduleName = require('module-name').default.
Note this means we can only have one export per file, i.e. we can't export the Options interface simultaneously.
I think this export is unnecessary, given the interface is only for type hinting to users of the plugin. This would break in the case a user wants to wrap the plugin with TS and forward the Options type explicitly, so we may want to consider making the Options interface available in a standalone options.ts file.
Until that's required, I think we can keep Options unexported.
The text was updated successfully, but these errors were encountered:
When a JS node module consumer uses a TS node module that exports using
export default
, the JS author must writeconst moduleName = require('module-name').default
.This is unnatural for node modules, so we should switch the default export to
export =
, as per https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require.Note this means we can only have one export per file, i.e. we can't export the
Options
interface simultaneously.I think this export is unnecessary, given the interface is only for type hinting to users of the plugin. This would break in the case a user wants to wrap the plugin with TS and forward the
Options
type explicitly, so we may want to consider making theOptions
interface available in a standaloneoptions.ts
file.Until that's required, I think we can keep
Options
unexported.The text was updated successfully, but these errors were encountered: