-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore!: convert to typescript and vitest
- Loading branch information
Showing
120 changed files
with
3,138 additions
and
2,647 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,37 @@ | ||
/* @flow */ | ||
|
||
module.exports = { | ||
extends: require.resolve("@krakenjs/eslint-config-grumbler/eslintrc-browser"), | ||
extends: | ||
"./node_modules/@krakenjs/eslint-config-grumbler/eslintrc-typescript.js", | ||
|
||
rules: { | ||
"default-param-last": "off", | ||
"keyword-spacing": "off", | ||
"@typescript-eslint/keyword-spacing": "off", | ||
|
||
// off for initial ts conversion | ||
// Implicit any in catch clause | ||
"@typescript-eslint/no-implicit-any-catch": "off", | ||
// Prefer using an optional chain expression instead, as it's more concise and easier to read | ||
"@typescript-eslint/prefer-optional-chain": "off", | ||
// Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator | ||
"@typescript-eslint/prefer-nullish-coalescing": "off", | ||
// do not use null as a type | ||
"@typescript-eslint/ban-types": "off", | ||
// assigning something to an any type | ||
"@typescript-eslint/no-unsafe-assignment": "off", | ||
// returning an any type | ||
"@typescript-eslint/no-unsafe-return": "off", | ||
// any in a template literal | ||
"@typescript-eslint/restrict-template-expressions": "off", | ||
// no explicit any | ||
"@typescript-eslint/no-explicit-any": "off", | ||
// Operands of '+' operation with any is possible only with string, number, bigint or any | ||
"@typescript-eslint/restrict-plus-operands": "off", | ||
// calling an any | ||
"@typescript-eslint/no-unsafe-call": "off", | ||
// do not dynamically delete keys | ||
"@typescript-eslint/no-dynamic-delete": "off", | ||
// for simple iterations use for of | ||
"@typescript-eslint/prefer-for-of": "off", | ||
// Generic Object Injection Sink | ||
"security/detect-object-injection": "off", | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
extends: "@krakenjs/babel-config-grumbler/babelrc-browser", | ||
presets: ["@krakenjs/babel-config-grumbler/flow-ts-babel-preset"], | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/* @flow */ | ||
|
||
export const KEY_CODES = { | ||
ENTER: 13, | ||
SPACE: 32, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { memoize, promisify } from "./util"; | ||
|
||
// eslint-disable-next-line no-warning-comments | ||
// TODO: is this file even used? Can we remove it? | ||
|
||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
export function memoized( | ||
target: Record<string, any>, | ||
name: string, | ||
descriptor: Record<string, any> | ||
) { | ||
descriptor.value = memoize(descriptor.value, { | ||
name, | ||
thisNamespace: true, | ||
}); | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
export function promise( | ||
target: Record<string, any>, | ||
name: string, | ||
descriptor: Record<string, any> | ||
) { | ||
descriptor.value = promisify(descriptor.value, { | ||
name, | ||
}); | ||
} |
Oops, something went wrong.