Docs: Mention verbatimModuleSyntax
in docs for rules that encourage ESM import syntax
#10568
Closed
2 tasks done
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
documentation
Documentation ("docs") that needs adding/updating
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
Before You File a Documentation Request Please Confirm You Have Done The Following...
Suggested Changes
We have several rules that promote ESM syntax over CJS syntax. However, these won't necessarily play well with CJS projects using verbatimModuleSyntax. I propose we should mention caveats or inapplicability for rules that don't make sense with verbatimModuleSyntax.
Off the top of my head:
namespace
s are the only way to export both named types and named values from a CJS module with verbatimModuleSyntax (I have a TS issue open about this that may give more information, Cannot export both types and values from CJS microsoft/TypeScript#60852). Therefore,namespace
s may be necessary in some circumstances for CJS projects currently written using ESM syntax, but which are trying to adopt verbatimModuleSyntaxAffected URL(s)
https://typescript-eslint.io/rules/no-require-imports
https://typescript-eslint.io/rules/no-namespace/
possibly others?
Additional Info
No response
The text was updated successfully, but these errors were encountered: