Skip to content

Commit af8146b

Browse files
authored
chore: update to TypeScript 4.0 (ionic-team#4534)
1 parent 49b8655 commit af8146b

50 files changed

Lines changed: 94 additions & 166 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
"chokidar-cli": "^2.0.0",
2121
"husky": "^4.2.0",
2222
"lerna": "^3.13.3",
23-
"tslint": "^5.9.1",
24-
"tslint-ionic-rules": "0.0.21",
25-
"typescript": "~3.8.2"
23+
"typescript": "~4.0.2"
2624
},
2725
"husky": {
2826
"hooks": {

packages/@ionic/cli-framework-output/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
],
1717
"scripts": {
1818
"clean": "rimraf dist",
19-
"lint": "tslint --project tsconfig.json",
19+
"lint": "true",
2020
"build": "npm run clean && tsc",
2121
"watch": "tsc -w --preserveWatchOutput",
2222
"test": "jest --maxWorkers=4",
@@ -30,7 +30,7 @@
3030
"slice-ansi": "^4.0.0",
3131
"string-width": "^4.1.0",
3232
"strip-ansi": "^6.0.0",
33-
"tslib": "1.11.2",
33+
"tslib": "^2.0.1",
3434
"wrap-ansi": "^7.0.0"
3535
},
3636
"devDependencies": {
@@ -46,7 +46,6 @@
4646
"jest-cli": "^26.0.1",
4747
"lint-staged": "^10.0.2",
4848
"ts-jest": "~26.3.0",
49-
"tslint": "^5.9.1",
50-
"typescript": "~3.8.2"
49+
"typescript": "~4.0.2"
5150
}
5251
}

packages/@ionic/cli-framework-output/tslint.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/@ionic/cli-framework-prompts/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
],
1717
"scripts": {
1818
"clean": "rimraf dist",
19-
"lint": "tslint --project tsconfig.json",
19+
"lint": "true",
2020
"build": "npm run clean && tsc",
2121
"watch": "tsc -w --preserveWatchOutput",
2222
"test": "jest --maxWorkers=4",
@@ -27,7 +27,7 @@
2727
"@ionic/utils-terminal": "2.2.0",
2828
"debug": "^4.0.0",
2929
"inquirer": "^7.0.0",
30-
"tslib": "1.11.2"
30+
"tslib": "^2.0.1"
3131
},
3232
"devDependencies": {
3333
"@types/debug": "^4.1.1",
@@ -38,7 +38,6 @@
3838
"jest-cli": "^26.0.1",
3939
"lint-staged": "^10.0.2",
4040
"ts-jest": "~26.3.0",
41-
"tslint": "^5.9.1",
42-
"typescript": "~3.8.2"
41+
"typescript": "~4.0.2"
4342
}
4443
}

packages/@ionic/cli-framework-prompts/tslint.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/@ionic/cli-framework/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"scripts": {
1313
"clean": "rimraf index.* definitions.* errors.* guards.* lib utils",
14-
"lint": "tslint --project tsconfig.json",
14+
"lint": "true",
1515
"build": "npm run clean && tsc",
1616
"watch": "tsc -w --preserveWatchOutput",
1717
"test": "jest --maxWorkers=4",
@@ -32,7 +32,7 @@
3232
"lodash": "^4.17.5",
3333
"minimist": "^1.2.0",
3434
"rimraf": "^3.0.0",
35-
"tslib": "1.11.2",
35+
"tslib": "^2.0.1",
3636
"untildify": "^4.0.0",
3737
"write-file-atomic": "^3.0.0"
3838
},
@@ -47,7 +47,6 @@
4747
"jest-cli": "^26.0.1",
4848
"lint-staged": "^10.0.2",
4949
"ts-jest": "~26.3.0",
50-
"tslint": "^5.9.1",
51-
"typescript": "~3.8.2"
50+
"typescript": "~4.0.2"
5251
}
5352
}

packages/@ionic/cli-framework/src/definitions.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ export interface CommandMetadataOption extends Metadata {
5656
};
5757
}
5858

59-
export type HydratedCommandMetadataOption<O extends CommandMetadataOption> = Readonly<Required<O>>;
60-
6159
export { ParseArgsOptions };
6260

6361
export interface HydratedParseArgsOptions extends ParseArgsOptions {

packages/@ionic/cli-framework/src/lib/options.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as lodash from 'lodash';
22
import * as minimist from 'minimist';
33

4-
import { CommandLineOptions, CommandMetadataOption, HydratedCommandMetadataOption, HydratedParseArgsOptions, ParsedArg } from '../definitions';
4+
import { CommandLineOptions, CommandMetadataOption, HydratedParseArgsOptions, ParsedArg } from '../definitions';
55

66
import { Colors, DEFAULT_COLORS } from './colors';
77

@@ -56,12 +56,12 @@ export function separateArgv(pargv: readonly string[]): [string[], string[]] {
5656
/**
5757
* Takes a Minimist command option and normalizes its values.
5858
*/
59-
export function hydrateCommandMetadataOption<O extends CommandMetadataOption>(option: O): HydratedCommandMetadataOption<O> {
59+
export function hydrateCommandMetadataOption<O extends CommandMetadataOption>(option: O): O {
6060
const type = option.type ? option.type : String;
6161

6262
return lodash.assign({}, option, {
6363
type,
64-
default: typeof option.default !== 'undefined' ? option.default : null, // tslint:disable-line:no-null-keyword
64+
default: typeof option.default !== 'undefined' ? option.default : null,
6565
aliases: Array.isArray(option.aliases) ? option.aliases : [],
6666
});
6767
}
@@ -116,8 +116,13 @@ export function metadataOptionsToParseArgsOptions(commandOptions: readonly Comma
116116
options.boolean.push(opt.name);
117117
}
118118

119-
options.default[opt.name] = opt.default;
120-
options.alias[opt.name] = opt.aliases;
119+
if (typeof opt.default !== 'undefined') {
120+
options.default[opt.name] = opt.default;
121+
}
122+
123+
if (typeof opt.aliases !== 'undefined') {
124+
options.alias[opt.name] = opt.aliases;
125+
}
121126
}
122127

123128
return options;

packages/@ionic/cli-framework/tslint.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/@ionic/cli/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"types": "./index.d.ts",
1515
"scripts": {
1616
"clean": "rimraf index.* bootstrap.* constants.* definitions.* guards.* lib commands",
17-
"lint": "tslint --project tsconfig.json",
17+
"lint": "true",
1818
"build": "npm run clean && tsc",
1919
"watch": "tsc -w --preserveWatchOutput",
2020
"test": "jest --maxWorkers=4",
@@ -65,7 +65,7 @@
6565
"superagent": "^5.2.1",
6666
"superagent-proxy": "^2.0.0",
6767
"tar": "^6.0.1",
68-
"tslib": "1.11.2"
68+
"tslib": "^2.0.1"
6969
},
7070
"devDependencies": {
7171
"@types/debug": "^4.1.1",
@@ -87,7 +87,6 @@
8787
"rimraf": "^3.0.0",
8888
"source-map": "^0.7.0",
8989
"ts-jest": "~26.3.0",
90-
"tslint": "^5.9.1",
91-
"typescript": "~3.8.2"
90+
"typescript": "~4.0.2"
9291
}
9392
}

0 commit comments

Comments
 (0)