Skip to content

feat(linter/typescript): implement method-signature-style rule#22679

Merged
camc314 merged 4 commits into
oxc-project:mainfrom
baevm:ts/method-signature-style
Jun 1, 2026
Merged

feat(linter/typescript): implement method-signature-style rule#22679
camc314 merged 4 commits into
oxc-project:mainfrom
baevm:ts/method-signature-style

Conversation

@baevm

@baevm baevm commented May 22, 2026

Copy link
Copy Markdown
Contributor

This PR implements typescript-eslint/method-signature-style, issue #2180.

It uses all upstream test cases. The only changes are to 4 setter test cases, changing this:

set f(value: number): void;

to this:

set f(value: number);

because they failed with TS(1095): A 'set' accessor cannot have a return type annotation.

@baevm baevm requested a review from camc314 as a code owner May 22, 2026 15:07
Copilot AI review requested due to automatic review settings May 22, 2026 15:07
@baevm baevm requested a review from overlookmotel as a code owner May 22, 2026 15:07
@baevm baevm force-pushed the ts/method-signature-style branch from 2ae3945 to d37304c Compare May 22, 2026 15:08
@baevm baevm force-pushed the ts/method-signature-style branch from d37304c to 3efe046 Compare May 22, 2026 15:08
@baevm

baevm commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

@codex code review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Implements the typescript/method-signature-style lint rule (ported from @typescript-eslint) and wires it into the oxc_linter rule registry and generated configuration/schema outputs.

Changes:

  • Add new MethodSignatureStyle rule implementation with diagnostics and upstream-aligned test cases + snapshot.
  • Register the rule in the TypeScript rules module and generated rule enum/runner plumbing.
  • Update generated config/schema artifacts to include typescript/method-signature-style.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tasks/website_linter/src/snapshots/schema_json.snap Adds the new rule key to the website schema snapshot.
npm/oxlint/configuration_schema.json Adds the new rule key to the published configuration schema.
crates/oxc_linter/src/snapshots/typescript_method_signature_style.snap Adds snapshot output for the new rule’s diagnostics.
crates/oxc_linter/src/rules/typescript/method_signature_style.rs New rule implementation + tests.
crates/oxc_linter/src/rules.rs Registers the new TypeScript rule module.
crates/oxc_linter/src/generated/rules_enum.rs Adds rule to the generated enum and metadata plumbing.
crates/oxc_linter/src/generated/rule_runner_impls.rs Adds AST node-type targeting for the new rule runner.
apps/oxlint/src-js/package/config.generated.ts Exposes the new rule key in the generated JS config typings.

Comment thread crates/oxc_linter/src/rules/typescript/method_signature_style.rs
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ 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".

@codspeed-hq

codspeed-hq Bot commented May 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks
⏩ 52 skipped benchmarks1


Comparing baevm:ts/method-signature-style (92ee98a) with main (8c9f622)

Open in CodSpeed

Footnotes

  1. 52 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.

@camc314 camc314 self-assigned this May 24, 2026
@camc314 camc314 changed the title feat(linter/typescript-eslint): implement method-signature-style rule feat(linter/typescript): implement method-signature-style rule Jun 1, 2026
@camc314 camc314 added the A-linter Area - Linter label Jun 1, 2026
@camc314 camc314 force-pushed the ts/method-signature-style branch from 5499c07 to 92ee98a Compare June 1, 2026 09:25

@camc314 camc314 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thank you!

@camc314 camc314 merged commit e4b1f46 into oxc-project:main Jun 1, 2026
28 checks passed
camc314 pushed a commit that referenced this pull request Jun 1, 2026
# Oxlint
### 🚀 Features

- e4b1f46 linter/typescript: Implement `method-signature-style` rule
(#22679) (Mikhail Baev)
- bc462ca linter/vue: Implement no-reserved-component-names rule
(#22741) (bab)
- ef9e751 linter/vue: Implement component-definition-name-casing rule
(#22818) (bab)
- d67f51a linter/vue: Implement require-prop-type-constructor rule
(#22708) (bab)
- 1444f82 linter/promise/spec-only: Add `Promise.try` to `Promise`
static methods (#22812) (Ben Saufley)
- 8422e8b linter/jsdoc: Implement `require-yields-description` rule
(#22805) (Mikhail Baev)
- fe93f97 linter/eslint: Implement `prefer-named-capture-group` rule
(#22759) (Sebastian Poxhofer)
- 1a7798b linter: Add suggestion for `unicorn/no-new-array` (#22682)
(Sysix)

### 🐛 Bug Fixes

- 760a9f9 linter: Report errors when writing to the filesystem (#22881)
(camc314)
- e5a2748 linter: Avoid no-unreachable false positive after conditional
loop (#22869) (camc314)
- 39d92d6 linter/arrow-body-style: Preserve comments within function
(#22854) (Sysix)
- 3d13e29 parser: Reject `declare` in an already-ambient context
(TS1038) (#22850) (Boshen)
- 5152854 parser: Reject statements in ambient contexts (TS1036)
(#22849) (Boshen)
- 2eafea6 parser: Reject function implementations in ambient contexts
(TS1183) (#22845) (Boshen)
- c645615 parser: Reject incompatible class member modifiers (#22843)
(Boshen)
- 4a1ca4a linter/export: Detect duplicate explicit exports (#22798)
(camc314)
- 0a9a735 linter/no-loop-func: Allow safe let closures (#22811)
(camc314)
- 1599f11 linter: Align lsp extends default plugins (#22788) (camc314)
- db32ec9 linter/no-accumulating-spread: Use loop as primary span
(#22800) (camc314)
- 33ec6b4 linter/consistent-test-it: Avoid adjacent describe leakage
(#22796) (camc314)
- 2606069 linter/no-array-sort: Unwrap parenthesized sort args (#22794)
(camc314)
- 9f2f709 linter/no-array-sort: Skip non compare fn sort arguments
(#22752) (Gaurav Dubey)
- 27268a0 linter/no-else-return: Preserve statement boundary in fixer
(#22687) (camc314)
- d9cb6d8 linter/no-empty-function: Allow functions callbacks with
`allow: functions` (#22764) (camc314)
- a40a314 linter/no-shadow-restricted-names: Ignore enum members
(#22762) (camc314)
- 82366d9 linter/no-cond-assign: Align ternary handling (#22761)
(camc314)

### 📚 Documentation

- 5e113ba linter: Add license notices for ported ESLint plugins (#22768)
(Boshen)
# Oxfmt
### 🚀 Features

- d75cbbf oxfmt: Format `parser:json` files by `oxc_formatter_json`
(#22709) (leaysgur)
- 49db054 formatter_json: Implement `oxc_formatter_json` (json variant
only) (#22641) (leaysgur)
- 9c71f2e ast, codegen, formatter: Add `WithClauseKeyword::as_str`
helper and use it (#22791) (camc314)

### 🐛 Bug Fixes

- d3cdd62 oxfmt: Skip formatting for whitespace-only file (#22780)
(leaysgur)
- 23f0cc8 formatter: Don't move comments inside variable declaration in
for in loop (#22776) (leaysgur)
- f200c40 formatter: Don't move comments inside variable declaration in
for of loop (#22773) (Leonabcd123)

### 📚 Documentation

- 845f393 oxfmt,formatter,formatter_json,formatter_core: Add/update
AGENTS.md (#22873) (leaysgur)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants