Skip to content
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

Strict nulls for everything except logconsole #7657

Merged
merged 16 commits into from Dec 23, 2019
2 changes: 1 addition & 1 deletion .lintstagedrc
@@ -1,4 +1,4 @@
"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}": [
"\"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"": [
"prettier --write",
"git add"
]
2 changes: 1 addition & 1 deletion dev_mode/package.json
Expand Up @@ -168,7 +168,7 @@
"@jupyterlab/vega5-extension": "~2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/application": "^1.7.4",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/disposable": "^1.3.2",
"@lumino/domutils": "^1.1.5",
Expand Down
2 changes: 1 addition & 1 deletion examples/cell/package.json
Expand Up @@ -15,7 +15,7 @@
"@jupyterlab/rendermime": "^2.0.0-alpha.4",
"@jupyterlab/services": "^5.0.0-alpha.4",
"@jupyterlab/theme-light-extension": "^2.0.0-alpha.4",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/widgets": "^1.9.4",
"es6-promise": "~4.2.8"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/console/package.json
Expand Up @@ -13,7 +13,7 @@
"@jupyterlab/rendermime": "^2.0.0-alpha.4",
"@jupyterlab/services": "^5.0.0-alpha.4",
"@jupyterlab/theme-light-extension": "^2.0.0-alpha.4",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/widgets": "^1.9.4",
"es6-promise": "~4.2.8"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/filebrowser/package.json
Expand Up @@ -18,7 +18,7 @@
"@jupyterlab/theme-light-extension": "^2.0.0-alpha.4",
"@jupyterlab/ui-components": "^2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/widgets": "^1.9.4",
"es6-promise": "~4.2.8"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/notebook/package.json
Expand Up @@ -18,7 +18,7 @@
"@jupyterlab/rendermime": "^2.0.0-alpha.4",
"@jupyterlab/services": "^5.0.0-alpha.4",
"@jupyterlab/theme-light-extension": "^2.0.0-alpha.4",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/widgets": "^1.9.4",
"es6-promise": "~4.2.8"
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -62,8 +62,8 @@
"lint:check": "jlpm run prettier:check && jlpm run eslint:check && jlpm run tslint:check",
"patch:release": "node buildutils/lib/patch-release.js",
"prepublish:check": "node buildutils/lib/prepublish-check.js",
"prettier": "prettier --write '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}'",
"prettier:check": "prettier --list-different '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}'",
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
"prettier:check": "prettier --list-different \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
"publish:all": "node buildutils/lib/publish.js",
"remove:dependency": "node buildutils/lib/remove-dependency.js",
"remove:package": "node buildutils/lib/remove-package.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/application/package.json
Expand Up @@ -44,7 +44,7 @@
"@jupyterlab/ui-components": "^2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/application": "^1.7.4",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/disposable": "^1.3.2",
"@lumino/messaging": "^1.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/apputils-extension/package.json
Expand Up @@ -43,7 +43,7 @@
"@jupyterlab/mainmenu": "^2.0.0-alpha.4",
"@jupyterlab/ui-components": "^2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/disposable": "^1.3.2",
"@lumino/polling": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/apputils/package.json
Expand Up @@ -39,7 +39,7 @@
"@jupyterlab/services": "^5.0.0-alpha.4",
"@jupyterlab/ui-components": "^2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/disposable": "^1.3.2",
"@lumino/domutils": "^1.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/codemirror/package.json
Expand Up @@ -39,7 +39,7 @@
"@jupyterlab/observables": "^3.0.0-alpha.4",
"@jupyterlab/statusbar": "^2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/disposable": "^1.3.2",
"@lumino/polling": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/coreutils/package.json
Expand Up @@ -32,7 +32,7 @@
"watch": "tsc -b --watch"
},
"dependencies": {
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/disposable": "^1.3.2",
"@lumino/properties": "^1.1.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/coreutils/src/interfaces.ts
Expand Up @@ -15,7 +15,7 @@ import { ISignal } from '@lumino/signaling';
/**
* A generic interface for change emitter payloads.
*/
export interface IChangedArgs<T, U extends string = string> {
export interface IChangedArgs<T, OldT = T, U extends string = string> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit adds an optional generic arg to allow change notifications to specify different typings for the old and new values (nice e.g. when the initial value is null, but it can never be set back to null after that). Note that this changes the order of the generic args (the name typing gets pushed later).

/**
* The name of the changed attribute.
*/
Expand All @@ -24,7 +24,7 @@ export interface IChangedArgs<T, U extends string = string> {
/**
* The old value of the changed attribute.
*/
oldValue: T;
oldValue: OldT;

/**
* The new value of the changed attribute.
Expand Down
1 change: 0 additions & 1 deletion packages/coreutils/tsconfig.json
Expand Up @@ -4,7 +4,6 @@
"outDir": "lib",
"rootDir": "src",
"module": "commonjs",
"strictNullChecks": true,
"types": ["node"]
},
"files": ["src/plugin-schema.json"],
Expand Down
2 changes: 1 addition & 1 deletion packages/filebrowser-extension/package.json
Expand Up @@ -47,7 +47,7 @@
"@jupyterlab/statusbar": "^2.0.0-alpha.4",
"@jupyterlab/ui-components": "^2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/messaging": "^1.3.1",
"@lumino/widgets": "^1.9.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fileeditor-extension/package.json
Expand Up @@ -47,7 +47,7 @@
"@jupyterlab/launcher": "^2.0.0-alpha.4",
"@jupyterlab/mainmenu": "^2.0.0-alpha.4",
"@jupyterlab/statusbar": "^2.0.0-alpha.4",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/widgets": "^1.9.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/launcher/package.json
Expand Up @@ -38,7 +38,7 @@
"@jupyterlab/apputils": "^2.0.0-alpha.4",
"@jupyterlab/ui-components": "^2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/disposable": "^1.3.2",
"@lumino/properties": "^1.1.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/mainmenu/package.json
Expand Up @@ -38,7 +38,7 @@
"@jupyterlab/apputils": "^2.0.0-alpha.4",
"@jupyterlab/services": "^5.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/disposable": "^1.3.2",
"@lumino/widgets": "^1.9.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/notebook-extension/package.json
Expand Up @@ -50,7 +50,7 @@
"@jupyterlab/services": "^5.0.0-alpha.4",
"@jupyterlab/statusbar": "^2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/disposable": "^1.3.2",
"@lumino/messaging": "^1.3.1",
Expand Down
1 change: 1 addition & 0 deletions packages/services/tsconfig.json
Expand Up @@ -4,6 +4,7 @@
"outDir": "lib",
"rootDir": "src",
"module": "commonjs",
"strictNullChecks": false,
"types": ["node"]
},
"include": ["src/**/*"],
Expand Down
2 changes: 1 addition & 1 deletion packages/settingeditor/package.json
Expand Up @@ -41,7 +41,7 @@
"@jupyterlab/inspector": "^2.0.0-alpha.4",
"@jupyterlab/rendermime": "^2.0.0-alpha.4",
"@jupyterlab/ui-components": "^2.0.0-alpha.4",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/messaging": "^1.3.1",
"@lumino/signaling": "^1.3.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/shortcuts-extension/package.json
Expand Up @@ -34,7 +34,7 @@
"dependencies": {
"@jupyterlab/application": "^2.0.0-alpha.4",
"@jupyterlab/coreutils": "^4.0.0-alpha.4",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/disposable": "^1.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/package.json
Expand Up @@ -28,7 +28,7 @@
"@jupyterlab/terminal": "^2.0.0-alpha.4",
"@jupyterlab/testutils": "^2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/disposable": "^1.3.2",
"@lumino/domutils": "^1.1.5",
Expand Down
2 changes: 1 addition & 1 deletion tests/test-application/package.json
Expand Up @@ -17,7 +17,7 @@
"@jupyterlab/coreutils": "^4.0.0-alpha.4",
"@jupyterlab/testutils": "^2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/messaging": "^1.3.1",
"@lumino/widgets": "^1.9.4",
Expand Down
2 changes: 1 addition & 1 deletion tests/test-apputils/package.json
Expand Up @@ -16,7 +16,7 @@
"@jupyterlab/services": "^5.0.0-alpha.4",
"@jupyterlab/testutils": "^2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/coreutils": "^1.4.0",
"@lumino/messaging": "^1.3.1",
"@lumino/virtualdom": "^1.2.1",
Expand Down
2 changes: 1 addition & 1 deletion tests/test-mainmenu/package.json
Expand Up @@ -16,7 +16,7 @@
"@jupyterlab/mainmenu": "^2.0.0-alpha.4",
"@jupyterlab/testutils": "^2.0.0-alpha.4",
"@lumino/algorithm": "^1.2.1",
"@lumino/commands": "^1.8.0",
"@lumino/commands": "^1.9.0",
"@lumino/widgets": "^1.9.4",
"chai": "^4.2.0",
"jest": "^24.9.0",
Expand Down
1 change: 1 addition & 0 deletions tests/test-services/tsconfig.json
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"types": ["jest", "ws", "node"],
"outDir": "build",
"strictNullChecks": false,
"rootDir": "src"
},
"include": ["src/**/*"],
Expand Down
1 change: 1 addition & 0 deletions tsconfigbase.json
Expand Up @@ -15,6 +15,7 @@
"preserveWatchOutput": true,
"resolveJsonModule": true,
"sourceMap": true,
"strictNullChecks": true,
"target": "es2017",
"types": []
}
Expand Down