Skip to content

feat(linter/eslint/no-inner-declarations): add namespaces option#24044

Merged
graphite-app[bot] merged 1 commit into
mainfrom
feat/no-inner-declarations-namespaces
Jul 13, 2026
Merged

feat(linter/eslint/no-inner-declarations): add namespaces option#24044
graphite-app[bot] merged 1 commit into
mainfrom
feat/no-inner-declarations-namespaces

Conversation

@Boshen

@Boshen Boshen commented Jul 2, 2026

Copy link
Copy Markdown
Member

Adds a namespaces option to eslint/no-inner-declarations:

["error", "both", { "namespaces": "allow" }]

With namespaces: "allow", function/var declarations placed directly inside a TypeScript namespace/module body are no longer reported. Declarations nested inside blocks within a namespace (e.g. namespace N { if (x) { function f() {} } }) are still reported. The default (disallow) is unchanged.

Closes #21143

@github-actions github-actions Bot added A-linter Area - Linter A-cli Area - CLI labels Jul 2, 2026
@codspeed-hq

codspeed-hq Bot commented Jul 2, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks
⏩ 66 skipped benchmarks1


Comparing feat/no-inner-declarations-namespaces (e65a6b2) with main (89ec3d9)

Open in CodSpeed

Footnotes

  1. 66 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Boshen Boshen force-pushed the feat/no-inner-declarations-namespaces branch from 5224fca to fd3f6f3 Compare July 2, 2026 07:21
@Boshen Boshen marked this pull request as ready for review July 2, 2026 07:24
@Boshen Boshen requested a review from camc314 as a code owner July 2, 2026 07:24
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jul 2, 2026

Boshen commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

Merge activity

  • Jul 2, 7:24 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jul 2, 7:27 AM UTC: Boshen added this pull request to the Graphite merge queue.
  • Jul 2, 7:36 AM UTC: The Graphite merge queue couldn't merge this PR because it failed for an unknown reason (All comments in this PR must be resolved before merging. Once you've resolved all open comment threads, you can retry your merge.).
  • Jul 13, 1:53 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jul 13, 1:53 AM UTC: Boshen added this pull request to the Graphite merge queue.
  • Jul 13, 2:06 AM UTC: Merged by the Graphite merge queue.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd3f6f3c02

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/oxc_linter/src/rules/eslint/no_inner_declarations.rs
@graphite-app graphite-app Bot force-pushed the feat/no-inner-declarations-namespaces branch from fd3f6f3 to 8e6d39c Compare July 2, 2026 07:28
@graphite-app graphite-app Bot force-pushed the feat/no-inner-declarations-namespaces branch from 8e6d39c to a586e6e Compare July 2, 2026 07:32
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jul 2, 2026
@Boshen Boshen force-pushed the feat/no-inner-declarations-namespaces branch from a586e6e to 679ef4b Compare July 2, 2026 08:03

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 679ef4b2a0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/oxc_linter/src/rules/eslint/no_inner_declarations.rs Outdated
Comment thread apps/oxlint/src-js/package/config.generated.ts
@Boshen Boshen force-pushed the feat/no-inner-declarations-namespaces branch from 679ef4b to e65a6b2 Compare July 2, 2026 08:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e65a6b28c0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/oxc_linter/src/rules/eslint/no_inner_declarations.rs
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jul 13, 2026
…24044)

Adds a `namespaces` option to `eslint/no-inner-declarations`:

```json
["error", "both", { "namespaces": "allow" }]
```

With `namespaces: "allow"`, `function`/`var` declarations placed directly inside a TypeScript `namespace`/`module` body are no longer reported. Declarations nested inside blocks within a namespace (e.g. `namespace N { if (x) { function f() {} } }`) are still reported. The default (`disallow`) is unchanged.

Closes #21143
@graphite-app graphite-app Bot force-pushed the feat/no-inner-declarations-namespaces branch from e65a6b2 to 0433a83 Compare July 13, 2026 01:59
@graphite-app graphite-app Bot merged commit 0433a83 into main Jul 13, 2026
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jul 13, 2026
@graphite-app graphite-app Bot deleted the feat/no-inner-declarations-namespaces branch July 13, 2026 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: no-inner-declarations option to ignore nesting in typescript namespaces

1 participant