Skip to content
All changes

EnhancementBehavior

String Options Are Const Classes, and dev-configs Warns on String-Literal Unions and Casts

@venizia/ignis-inversion, @venizia/ignis-helpers, @venizia/ignis-kernel, @venizia/ignis-connectors, @venizia/ignis, @venizia/dev-configs

Changelog - 2026-10-26 ​

String options are const classes, and dev-configs warns on string-literal unions and casts ​

Enhancement Behavior Change

In one line. Options typed as a union of string literals are now a const class plus a TConstValue type, like RepositoryTypes, and @venizia/dev-configs warns when you write such a union or an as X cast yourself. The values and defaults are the same, so existing code keeps compiling and no lint fails.

What changed ​

  • Each class has SCHEME_SET and isValid(value), so a value read from config or a request can be checked at runtime.
  • The literal still works. { from: 'header', key: 'x-m', type: 'Merchant' }, { type: 'strings' }, { numberMode: 'bigint' } and EqeqeqRule.build({ mode: 'always' }) compile as before; so does the class value (AuthorizationDomainSources.HEADER, BigIntModes.BIGINT).
  • The id-type options use TIdSchemaType (number or string) from the kernel package: polymorphicIdType and the IdType generics of enrichPrincipal and generatePrincipalColumnDefs, the dataType of the user-audit enricher, and the id-type options of the server models (extraUserColumns, the permission and policy-definition options). TIdSchemaType is now TConstValue<typeof IdSchemaTypes>.
  • TJWKSAlgorithm and TIdSchemaType moved files, not names: both are exported from the same package entries as before.
  • TConstValue<T> is exported from the dev-configs rules entry.
PackageOptionConst classType
kernelICompressOptions.encodingCompressEncodingsTCompressEncoding
kernelIJWKSIssuerOptions.algorithmJWKSAlgorithmsTJWKSAlgorithm
kernelIAuthorizationDomainSource.fromAuthorizationDomainSourcesTAuthorizationDomainSource
kernelregisterRoutesFromRegistry({ paths })RoutePathScopesTRoutePathScope
kernelAbstractEntity.getIdType()IdSchemaTypesTIdSchemaType
kernelgetAuthorizeModelPrincipals({ format }), getAuthorizeModelSettings({ format })AuthorizeModelFormatsTAuthorizeModelFormat
connectorsHTTP read({ shape })HttpReadShapesTHttpReadShape
connectorsScope write guard operationScopeWriteOperationsTScopeWriteOperation
connectorsbig-number id numberMode (Postgres)BigIntModesTBigIntMode
inversionApplicationError logLevelErrorLogLevelsTErrorLogLevel
helpersHigh-frequency logger levelLogLevels (already existed)THfLogLevel
helpersIFieldMapping.typeFieldMappingDataTypesTFieldMappingDataType
helpersAES cipherAESAlgorithmsAESAlgorithmType
helperspino file roll frequencyPinoFrequenciesTFrequency
helpersFetcher clientFetcherVariantsTFetcherVariant
helpersBullMQ helper roleBullQueueRolesTBullQueueRole
helpersTCP client stateTcpClientStatesTTcpClientState
helpersKafka consumer, why every broker is goneKafkaBrokersDownReasonsTKafkaBrokersDownReason
helperscreateContentDispositionHeader({ type })ContentDispositionTypesTContentDispositionType
helpersparseMultipartBody({ storage }), static-asset upload storageMultipartStoragesTMultipartStorage
helpersLocale month and weekday name widthTemporalNameWidthsTTemporalNameWidth
helpersLocale writtenDate styleTemporalWrittenDateStylesTTemporalWrittenDateStyle
helpersPattern dialect tokensPatternTokensTPatternToken, TWriteOnlyToken
serverMail queue backoff.typeMailBackoffTypesTMailBackoffType
dev-configsseverity of every rule builderRuleSeveritiesTRuleSeverity
dev-configsEqeqeqRule.build({ mode })EqeqeqModesTEqeqeqMode
dev-configsNoUnusedVarsRule.build({ vars })UnusedVarsScopesTUnusedVarsScope
dev-configsNoUnusedVarsRule.build({ args })UnusedArgsModesTUnusedArgsMode
dev-configsSwitchCaseBracesRule.build({ mode })SwitchCaseBracesModesTSwitchCaseBracesMode

New lint warnings ​

After updating @venizia/dev-configs, houseConfigs and reactHouseConfigs print warnings that never fail the lint. Tests are exempt.

text
warning  An enumerable string is a const class plus TConstValue<typeof X>, not a union of string literals  venizia/const-class-values
warning  Do not use any type assertions  @typescript-eslint/consistent-type-assertions
  • venizia/const-class-values is on, at warn. It used to be off and checked only exported types named *State, *Status, *Stage, *Mode, *Kind or *Type. It now checks every exported declaration: a type alias, an interface member, a generic constraint, a parameter or a return type. Fix a hit with a const class and TConstValue.
  • Key sets are skipped. Pick<T, 'a' | 'b'>, Omit, Extract, Exclude, Record and mapped-type keys are not value domains, and a union with a non-string member is not either.
  • @typescript-eslint/consistent-type-assertions is on, at warn, with assertionStyle: 'never'. as X, as any and as unknown as X warn. as const and satisfies do not.
  • ConstClassValuesRule.build({ namePattern }) is optional. Without it the rule checks every exported declaration. Pass namePattern to keep the old narrow behavior.

Who is affected ​

Nobody has to change code. Prefer the class value in new code: RoutePathScopes.PARAM over 'param'. Apps and libraries that lint with houseConfigs or reactHouseConfigs see new warnings. To stay quiet, turn a rule off after the preset; to make one a failure, set it to 'error' the same way:

javascript
import { houseConfigs } from '@venizia/dev-configs/linters';

export default [
  ...houseConfigs,
  { rules: { 'venizia/const-class-values': 'off', '@typescript-eslint/consistent-type-assertions': 'off' } },
];