https://github.com/narumincho/type-lint
Deno lint plugin for TypeScript types
https://github.com/narumincho/type-lint
Last synced: about 1 month ago
JSON representation
Deno lint plugin for TypeScript types
- Host: GitHub
- URL: https://github.com/narumincho/type-lint
- Owner: narumincho
- License: mit
- Created: 2025-12-17T03:45:08.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-12-17T08:25:09.000Z (7 months ago)
- Last Synced: 2025-12-20T17:48:02.779Z (7 months ago)
- Language: TypeScript
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deno-type-lint
Deno lint plugin for TypeScript types.
[](https://jsr.io/@narumincho/type-lint)
日本語の記事: https://zenn.dev/narumincho/articles/deno-lint-plugin
## Description
This plugin enforces stricter TypeScript type annotations by replacing shorthand array types with their explicit forms. This helps improve type safety and consistency in your codebase.
## Usage
Add the plugin to your `deno.json`:
```json
{
"lint": {
"plugins": ["jsr:@narumincho/type-lint"]
}
}
```
## Rules
### type-lint/no-array-shorthand
This rule replaces shorthand array type annotations with explicit `Array` and `ReadonlyArray` types.
#### Examples
**Before:**
```ts
function removeEmptyStringInArray(array: readonly string[]): string[] {
return array.filter((item) => item !== "");
}
```
**After:**
```ts
function removeEmptyStringInArray(array: ReadonlyArray): Array {
return array.filter((item) => item !== "");
}
```
This rule applies to:
- `T[]` → `Array`
- `readonly T[]` → `ReadonlyArray`