Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: add method-signature-style rule #190

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

wemeetagain
Copy link
Member

@wemeetagain wemeetagain commented Sep 29, 2023

This is important for generated docs, which distinguish between methods and properties. Without this rule, functions on an interface/object can appear as properties rather than methods:

image

I tested this rule against the js-libp2p monorepo, and using this rule results in API docs that now properly distinguish between methods and properties.

BREAKING CHANGE: All interfaces now need to use method signature style rather than property function style

eg:
before

interface Foo {
  bar: (baz: number) => void
}

after

interface Foo {
  bar(baz: number): void
}

@achingbrain achingbrain changed the title feat: add method-signature-style rule feat!: add method-signature-style rule Sep 29, 2023
@wemeetagain wemeetagain force-pushed the feat/method-signature-stype branch from 63f8638 to 4edfb32 Compare September 29, 2023 13:42
@achingbrain achingbrain merged commit 8823186 into ipfs:main Sep 29, 2023
17 checks passed
@wemeetagain wemeetagain deleted the feat/method-signature-stype branch September 29, 2023 14:43
@wemeetagain wemeetagain restored the feat/method-signature-stype branch September 29, 2023 14:44
@wemeetagain wemeetagain deleted the feat/method-signature-stype branch September 29, 2023 14:44
github-actions bot pushed a commit that referenced this pull request Sep 29, 2023
## [6.0.0](v5.0.1...v6.0.0) (2023-09-29)

### ⚠ BREAKING CHANGES

* All interfaces now need to use method signature style rather than property function style

eg:
before
```ts
interface Foo {
  bar: (baz: number) => void
}
```
after
```ts
interface Foo {
  bar(baz: number): void
}
```

### Features

* add method-signature-style rule ([#190](#190)) ([8823186](8823186))
@github-actions
Copy link

🎉 This PR is included in version 6.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

achingbrain pushed a commit to ipfs/aegir that referenced this pull request Sep 30, 2023
- See ipfs/eslint-config-ipfs#190

BREAKING CHANGE: All interfaces now need to use method signature style rather than property function style

eg:
before
```ts
interface Foo {
  bar: (baz: number) => void
}
```
after
```ts
interface Foo {
  bar(baz: number): void
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants