-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore!: move to typescript and vitest
- Codebase is migrated to TypeScript by using https://github.com/Khan/flow-to-ts - Dist folder now outputs esm folder - Package.json update for types & modules - Flowgen is used to generate flow types from dist/*.d.ts fix: package updates + grumbler-scripts@8 fix: webpack types
- Loading branch information
Showing
19 changed files
with
212 additions
and
221 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,5 +1,16 @@ | ||
/* @flow */ | ||
|
||
module.exports = { | ||
extends: "./node_modules/@krakenjs/grumbler-scripts/config/.eslintrc.js", | ||
extends: | ||
"./node_modules/@krakenjs/eslint-config-grumbler/eslintrc-typescript", | ||
|
||
rules: { | ||
// off for initial ts conversion | ||
// Implicit any in catch clause | ||
"@typescript-eslint/no-implicit-any-catch": "off", | ||
// var will evaluate to '[object Object]' when stringified | ||
"@typescript-eslint/no-base-to-string": "off", | ||
// Prefer using an optional chain expression instead, as it's more concise and easier to read | ||
"@typescript-eslint/prefer-optional-chain": "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,3 +1 @@ | ||
/* @flow */ | ||
|
||
export { CrossDomainSafeWeakMap as WeakMap } from "./weakmap"; |
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,18 @@ | ||
export function safeIndexOf<T>(collection: readonly T[], item: T): number { | ||
for (let i = 0; i < collection.length; i++) { | ||
try { | ||
if (collection[i] === item) { | ||
return i; | ||
} | ||
} catch (err) { | ||
// pass | ||
} | ||
} | ||
|
||
return -1; | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
export function noop(...args: readonly unknown[]): void { | ||
// pass | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.