Skip to content

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

Closed
camc314 wants to merge 1 commit into
mainfrom
c/02-10-feat_linter_implement_typescript_method-signature-style
Closed

feat(linter): implement typescript/method-signature-style#19599
camc314 wants to merge 1 commit into
mainfrom
c/02-10-feat_linter_implement_typescript_method-signature-style

Conversation

@camc314

@camc314 camc314 commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added the A-linter Area - Linter label Feb 21, 2026

camc314 commented Feb 21, 2026

Copy link
Copy Markdown
Contributor Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq

codspeed-hq Bot commented Feb 21, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 47 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing c/02-10-feat_linter_implement_typescript_method-signature-style (971cefc) with c/02-09-feat_linter_implement_typescript_member-ordering (46c35cc)

Open in CodSpeed

Footnotes

  1. 3 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 force-pushed the c/02-10-feat_linter_implement_typescript_method-signature-style branch from 5f1cadb to 7d4947c Compare February 21, 2026 16:29
@camc314 camc314 force-pushed the c/02-09-feat_linter_implement_typescript_member-ordering branch from c5ab142 to 322712d Compare February 21, 2026 16:29
@camc314 camc314 force-pushed the c/02-10-feat_linter_implement_typescript_method-signature-style branch 2 times, most recently from c2c0f31 to 971cefc Compare February 21, 2026 17:30
Comment thread crates/oxc_linter/src/rules/typescript/method_signature_style.rs
@camc314 camc314 self-assigned this Feb 21, 2026
@camc314 camc314 marked this pull request as ready for review February 22, 2026 17:33
Copilot AI review requested due to automatic review settings February 22, 2026 17:33
@camc314 camc314 changed the base branch from c/02-09-feat_linter_implement_typescript_member-ordering to graphite-base/19599 February 22, 2026 17:33
@camc314 camc314 force-pushed the graphite-base/19599 branch from 46c35cc to 46177dd Compare February 22, 2026 17:33
@camc314 camc314 force-pushed the c/02-10-feat_linter_implement_typescript_method-signature-style branch from 971cefc to 78391e1 Compare February 22, 2026 17:33
@camc314 camc314 changed the base branch from graphite-base/19599 to main February 22, 2026 17:33

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

This pull request implements a new TypeScript ESLint rule method-signature-style that enforces consistent method signature syntax in TypeScript interfaces and type literals.

Changes:

  • Implements the typescript/method-signature-style rule with two configuration modes: "property" (default, enforcing arrow function syntax) and "method" (enforcing method shorthand syntax)
  • Handles complex cases including method overloads, this return types, module declarations, and various edge cases with proper fix suggestions
  • Integrates the new rule into the linter infrastructure with comprehensive test coverage

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/oxc_linter/src/rules/typescript/method_signature_style.rs Main implementation of the method signature style rule with fix generation and edge case handling
crates/oxc_linter/src/snapshots/typescript_method_signature_style.snap Test snapshots showing error messages and fix suggestions for various test cases
crates/oxc_linter/src/rules.rs Module declaration for the new rule
crates/oxc_linter/src/generated/rules_enum.rs Generated integration code for the rule enum
crates/oxc_linter/src/generated/rule_runner_impls.rs Generated runner implementation specifying AST node types the rule operates on

Comment on lines +1 to +19
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use oxc_ast::{
AstKind,
ast::{
TSMethodSignature, TSMethodSignatureKind, TSPropertySignature, TSSignature, TSThisType,
TSType, TSTypeAnnotation,
},
};
use oxc_ast_visit::{Visit, walk};
use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::{GetSpan, Span};

use crate::{
AstNode,
context::{ContextHost, LintContext},
rule::{DefaultRuleConfig, Rule},

Copilot AI Feb 22, 2026

Copy link

Choose a reason for hiding this comment

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

The import order should follow the codebase convention: std imports, then oxc_* crates (alphabetically), then other external crates (alphabetically), then crate:: imports. Currently, schemars and serde are placed before oxc_ast, which is inconsistent with the pattern seen in other files like class_literal_property_style.rs.

Copilot uses AI. Check for mistakes.
@camc314 camc314 closed this Mar 26, 2026
@graemefolk

Copy link
Copy Markdown

I was wondering if we could revisit this rule, it is important in my codebase.

@camc314

camc314 commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

I was wondering if we could revisit this rule, it is important in my codebase.

I'm happy to accept contributions to implement this rule - I closed this PR because I ran out of time to get it merged.

Thanks!

@Boshen Boshen deleted the c/02-10-feat_linter_implement_typescript_method-signature-style branch May 31, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants