Skip to content

Commit

Permalink
Add @typescript-eslint/array-type eslint rule (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkratz authored May 17, 2024
1 parent 1c07471 commit 33fbbd4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module.exports = {
],
plugins: ['@deities'],
rules: {
'@typescript-eslint/array-type': [2, { default: 'generic' }],
'@typescript-eslint/no-restricted-imports': [
2,
{
Expand Down
2 changes: 1 addition & 1 deletion apollo/lib/gameHasEnded.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ActionResponse } from '../ActionResponse.tsx';

export default function gameHasEnded(
gameState: ReadonlyArray<readonly [ActionResponse, ...unknown[]]> | null,
gameState: ReadonlyArray<readonly [ActionResponse, ...Array<unknown>]> | null,
) {
return !!(
gameState?.length &&
Expand Down
5 changes: 4 additions & 1 deletion art/Sprites.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ type Resource = Readonly<[name: string, url: string]>;
type Resources = ReadonlyArray<Resource>;
type PaletteSwapFn = typeof paletteSwap;
type PaletteSwapParameters = Parameters<PaletteSwapFn>;
type DropFirstInTuple<T extends unknown[]> = T extends [unknown, ...infer Rest]
type DropFirstInTuple<T extends Array<unknown>> = T extends [
unknown,
...infer Rest,
]
? Rest
: never;
type MaybePaletteSwapParameters = [
Expand Down

0 comments on commit 33fbbd4

Please sign in to comment.