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
discord-api-types has used tsconfig's importsNotUsedAsValues: "error" since 0.20.0. It stops ESModule-style imports being used without the type specifier; for instance:
importtype{Snowflake}from'../globals';
is fine, but
import{Snowflake}from'../globals';// This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'. ts(1371)
gets rejected by the compiler.
importsNotUsedAsValues was deprecated in TS 5.0, and will be removed in 5.5. Its replacement, verbatimModuleSyntax, provides different functionality: although it does cover the above import case, it also prevents top-level value exports in CommonJS modules:
import{Snowflake}from'../globals';// Snowflake' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled. ts(1484)exportconstGatewayVersion='10';// A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled. ts(1287)
Since moving to eslint-config-neon, type import behaviour is enforced by @typescript-eslint/consistent-type-imports anyway, so removing the flag entirely might be the easiest solution.
The text was updated successfully, but these errors were encountered:
Jiralite
changed the title
build(tsconfig): importsNotUsedAsValues deprecation
importsNotUsedAsValues deprecation
Sep 23, 2023
discord-api-types has used tsconfig's
importsNotUsedAsValues: "error"
since 0.20.0. It stops ESModule-style imports being used without the type specifier; for instance:is fine, but
gets rejected by the compiler.
importsNotUsedAsValues
was deprecated in TS 5.0, and will be removed in 5.5. Its replacement,verbatimModuleSyntax
, provides different functionality: although it does cover the above import case, it also prevents top-level value exports in CommonJS modules:Since moving to eslint-config-neon, type import behaviour is enforced by
@typescript-eslint/consistent-type-imports
anyway, so removing the flag entirely might be the easiest solution.The text was updated successfully, but these errors were encountered: