Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start adopting Flow strict mode (#8281)
* start adopting Flow strict mode * fix lint * enable sketchy-null and strict-type throttle.js * strict-type webp_supported, browser, task_queue, cancelable * strictly type dom.js * fix lint in dom.js
- Loading branch information
Showing
17 changed files
with
158 additions
and
128 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
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,5 @@ | ||
// @flow strict | ||
declare module "gl" { | ||
declare function gl(width: number, height: number, attributes: WebGLContextAttributes): WebGLRenderingContext; | ||
declare module.exports: typeof gl; | ||
} |
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 @@ | ||
// @flow strict | ||
|
||
import type Window from '../src/types/window'; | ||
|
||
declare module "jsdom" { | ||
declare class JSDOM { | ||
constructor(content: string, options: Object): JSDOM; | ||
window: Window; | ||
} | ||
declare class VirtualConsole { | ||
constructor(): VirtualConsole; | ||
sendTo(console: typeof console): VirtualConsole; | ||
} | ||
declare module.exports: { | ||
JSDOM: typeof JSDOM, | ||
VirtualConsole: typeof VirtualConsole | ||
}; | ||
} |
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,10 @@ | ||
// @flow strict | ||
declare module "sinon" { | ||
declare class FakeServer { | ||
xhr: XMLHttpRequest | ||
} | ||
declare module.exports: { | ||
xhr: {supportsCORS: boolean}, | ||
fakeServer: {create: () => FakeServer} | ||
}; | ||
} |
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,3 @@ | ||
// @flow | ||
// @flow strict | ||
|
||
export type Cancelable = { cancel: () => void }; |
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
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,4 +1,4 @@ | ||
// @flow | ||
// @flow strict | ||
|
||
type Config = {| | ||
API_URL: string, | ||
|
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,4 +1,4 @@ | ||
// @flow | ||
// @flow strict | ||
|
||
import assert from 'assert'; | ||
|
||
|
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
Oops, something went wrong.
This change breaks
e.preventDefault()
on iOS. You can't use both accessors and a value.