Skip to content

Commit

Permalink
doc tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Jun 28, 2024
1 parent 322d2b1 commit b5431b1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/content/development/hacking-on-gitea.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,17 @@ make lint-frontend

Gitea is in the process of migrating to type-safe Typescript. Here are some specific guidelines regarding Typescript in the codebase:

### Use `@ts-expect-error` instead of `@ts-ignore`

Both annotations should be avoided, but if you have to use them, use `@ts-expect-error` because it will not leave ineffective statements after the issue is fixed.

### Use type aliases instead of interfaces

Prefer to use type aliases because they can represent any type and are generally more flexible to use than interfaces.

### Use explicit type imports and exports
### Use separate type imports

We use `verbatimModuleSyntax` so type imports and exports must be performed using `export type` and `import type` statements. Imports must be split from other imports from the same file which will then enable the typescript compiler to completely eliminate the statements during compilation.
We use `verbatimModuleSyntax` so type imports and non-type imports from the same file must be split into two `import type` statements. This enables the typescript compiler to completely eliminate the type import statements during compilation.

### Use `@ts-expect-error` instead of `@ts-ignore`

Both annotations should be avoided, but if you have to use them, use `@ts-expect-error` because it will not leave ineffective statements after the issue is fixed.

### Configuring local ElasticSearch instance

Expand Down

0 comments on commit b5431b1

Please sign in to comment.