-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore!: convert library to typescript #37
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
/* @flow */ | ||
|
||
module.exports = { | ||
extends: "./node_modules/@krakenjs/eslint-config-grumbler", | ||
extends: | ||
"./node_modules/@krakenjs/eslint-config-grumbler/eslintrc-typescript", | ||
|
||
rules: { | ||
"keyword-spacing": "off", | ||
"@typescript-eslint/keyword-spacing": "off", | ||
|
||
globals: { | ||
__TEST__: true, | ||
// 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", | ||
// Generic Object Injection Sink | ||
"security/detect-object-injection": "off", | ||
}, | ||
}; |
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.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export const PROTOCOL = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is super minor, but is this syntax the same? export const PROTOCOL = {
MOCK: "mock:",
FILE: "file:" ,
ABOUT: "about:",
} as const |
||
MOCK: "mock:" as const, | ||
FILE: "file:" as const, | ||
ABOUT: "about:" as const, | ||
}; | ||
|
||
export const WILDCARD = "*"; | ||
|
||
export const WINDOW_TYPE = { | ||
IFRAME: "iframe" as const, | ||
POPUP: "popup" as const, | ||
}; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/* @flow */ | ||
|
||
export * from "./utils"; | ||
export * from "./types"; | ||
export * from "./constants"; |
This file was deleted.
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,12 @@ | ||||
export type CrossDomainWindowType = Window; | ||||
|
||||
export type SameDomainWindowType = Omit< | ||||
Window, | ||||
"frames" | "parent" | "focus" | "top" | "opener" | "postMessage" | ||||
>; | ||||
|
||||
export type DomainMatcher = | ||||
| string | ||||
| readonly string[] | ||||
| readonly string[] | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
| RegExp; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export function isRegex(item: unknown): boolean { | ||
return Object.prototype.toString.call(item) === "[object RegExp]"; | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
export function noop(...args: readonly unknown[]): void { | ||
// pass | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to follow the convention of having a
typecheck
script here, like we have in other repositories?