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

📝 Prefer interfaces and functions for exported entities #906

Merged
merged 1 commit into from
Aug 19, 2020

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented Aug 19, 2020

In the context of the documentation extracted by api-extractor, it is better to have:

interface MyType {
  /** What does my attribute */
  attribute: any;
}

Over:

type MyType = {
  /** What does my attribute */
  attribute: any;
};

As the documentation related to the attribute will be ignored.

Same for functions versus variables.

Declaring a function as follow:

function abc() {}

Will produce a better extracted api than this one:

const abc = () => {}

In a nutshell

❌ New feature
❌ Fix an issue
✔️ Documentation improvement
❌ Other: please explain

(✔️: yes, ❌: no)

Potential impacts

None

In the context of the documentation extracted by api-extractor, it is better to have:

```ts
interface MyType {
  /** What does my attribute */
  attribute: any;
}
```

Over:
```ts
type MyType = {
  /** What does my attribute */
  attribute: any;
};
```

As the documentation related to the attribute will be ignored.

Same for functions versus variables.

Declaring a function as follow:
```ts
function abc() {}
```

Will produce a better extracted api than this one:
```ts
const abc = () => {}
```
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit eacf448:

Sandbox Source
Vanilla Configuration
dubzzz/fast-check: example Configuration

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 96.101% when pulling eacf448 on better-docs-last into 0c3080b on master.

@dubzzz dubzzz merged commit 6e2657a into master Aug 19, 2020
@dubzzz dubzzz deleted the better-docs-last branch August 19, 2020 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants