Skip to content

Published 1.1.1 preset still rejects __NAME__ injected constants despite naming-convention issue being implemented #16

@sethlivingston

Description

@sethlivingston

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions