Summary
The published ESLint plugin release @sethlivingston/eslint-plugin-typescript-narrows@1.1.1 still rejects __NAME__-style injected constants, even though this behavior was supposed to be fixed.
Context
While upgrading oneway-http to the latest published plugin, these identifiers still fail under the current preset:
__ONEWAY_HTTP_EXPECTED_ROOT_TARGET__
__ONEWAY_HTTP_TEST_PROJECT__
The errors are from @typescript-eslint/naming-convention.
We had to keep a local override in eslint.config.mjs for just these injected-constant files:
vitest.config.ts
tests/parity/runtime-context.ts
Observed behavior
With @sethlivingston/eslint-plugin-typescript-narrows@1.1.1, this still errors:
declare const __ONEWAY_HTTP_EXPECTED_ROOT_TARGET__: RuntimeTarget;
declare const __ONEWAY_HTTP_TEST_PROJECT__: ParityProjectName;
And object keys like this still error too:
define: {
__ONEWAY_HTTP_EXPECTED_ROOT_TARGET__: JSON.stringify("browser"),
__ONEWAY_HTTP_TEST_PROJECT__: JSON.stringify(browser),
}
Expected behavior
The published preset should allow the __NAME__ convention for injected/build-time constants if that issue has really been implemented.
Acceptance criteria
- The published ESLint plugin preset allows
^__[_A-Z0-9]+__$ where intended.
- Both declared globals and object-literal property names for injected constants are accepted.
- The next published release removes the need for local naming-convention overrides in repos using these injected constants.
Summary
The published ESLint plugin release
@sethlivingston/eslint-plugin-typescript-narrows@1.1.1still rejects__NAME__-style injected constants, even though this behavior was supposed to be fixed.Context
While upgrading
oneway-httpto the latest published plugin, these identifiers still fail under the current preset:__ONEWAY_HTTP_EXPECTED_ROOT_TARGET____ONEWAY_HTTP_TEST_PROJECT__The errors are from
@typescript-eslint/naming-convention.We had to keep a local override in
eslint.config.mjsfor just these injected-constant files:vitest.config.tstests/parity/runtime-context.tsObserved behavior
With
@sethlivingston/eslint-plugin-typescript-narrows@1.1.1, this still errors:And object keys like this still error too:
Expected behavior
The published preset should allow the
__NAME__convention for injected/build-time constants if that issue has really been implemented.Acceptance criteria
^__[_A-Z0-9]+__$where intended.