Skip to content

Commit

Permalink
upgrade typescript to 3.7 (#3201)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskikutis authored Nov 8, 2019
1 parent d37a5a2 commit 62622c8
Show file tree
Hide file tree
Showing 11 changed files with 417 additions and 56 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = Object.assign({}, sharedConfigs, {

'newline-per-chained-call': ["error", {"ignoreChainWithDepth": 3}],
}),
parser: 'typescript-eslint-parser',
parser: '@typescript-eslint/parser',
overrides: [
{
files: ['*.ts', '*.tsx'],
Expand All @@ -47,6 +47,10 @@ module.exports = Object.assign({}, sharedConfigs, {
"exports": "always-multiline",
"functions": "always-multiline"
}],


// allow calling hasOwnProperty
"no-prototype-builtins": 0,
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion end-to-end-testing-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"superdesk-code-style": "1.3.0",
"typescript": "3.6.2"
"typescript": "3.7.2"
},
"peerDependencies": {
"protractor": "5.4.2"
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@types/react-autocomplete": "1.8.5",
"@types/react-dom": "16.8.0",
"@types/react-redux": "7.1.1",
"@typescript-eslint/parser": "^2.6.1",
"angular": "1.6.9",
"angular-contenteditable": "0.3.9",
"angular-dynamic-locale": "0.1.32",
Expand All @@ -61,6 +62,8 @@
"draft-js": "github:tomaskikutis/draft-js#add-subscript-superscript",
"draft-js-export-html": "1.3.3",
"end-to-end-testing-helpers": "^1.0.3",
"eslint": "6.6.0",
"eslint-plugin-react": "7.16.0",
"file-loader": "1.1.11",
"git-rev-sync": "1.10.0",
"gridster": "0.5.6",
Expand Down Expand Up @@ -115,7 +118,7 @@
"superdesk-ui-framework": "2.0.11",
"ts-loader": "3.5.0",
"tslint": "5.11.0",
"typescript": "3.6.2",
"typescript": "3.7.2",
"webpack": "3.11.0",
"webpack-dev-server": "2.11.1"
},
Expand All @@ -140,8 +143,7 @@
"react-addons-test-utils": "^15.6.0",
"react-test-renderer": "^16.2.0",
"request": "^2.83.0",
"superdesk-code-style": "^1.1.1",
"typescript-eslint-parser": "^18.0.0"
"superdesk-code-style": "^1.1.1"
},
"scripts": {
"setup-extensions": "node ./tasks/namespace-css-from-extensions.js && node ./tasks/install-extensions.js",
Expand All @@ -153,8 +155,8 @@
"debug-unit-tests": "karma start karma.conf.js --browsers=Chrome",
"unit": "grunt unit",
"build": "grunt build",
"lint": "python3 grep-lint.py && tsc -p scripts --noEmit && tslint -c tslint.json './**/*.{ts,tsx}' && eslint --parser=typescript-eslint-parser --ext .js --ext .jsx --ext .ts --ext .tsx scripts tasks *.js",
"lint-fix": "tsc -p scripts --noEmit && tslint --fix -c tslint.json 'scripts/**/*.{ts,tsx}' && eslint --fix --parser=typescript-eslint-parser --ext .js --ext .jsx --ext .ts --ext .tsx scripts spec tasks *.js",
"lint": "python3 grep-lint.py && tsc -p scripts --noEmit && tslint -c tslint.json './**/*.{ts,tsx}' && eslint --parser=@typescript-eslint/parser --ext .js --ext .jsx --ext .ts --ext .tsx scripts tasks *.js",
"lint-fix": "tsc -p scripts --noEmit && tslint --fix -c tslint.json 'scripts/**/*.{ts,tsx}' && eslint --fix --parser=@typescript-eslint/parser --ext .js --ext .jsx --ext .ts --ext .tsx scripts spec tasks *.js",
"start-test-server": "cd test-server && python3 -m venv env && . env/bin/activate && pip install -Ur requirements.txt && honcho start",
"protractor": "protractor protractor.conf.js",
"webdriver-manager": "webdriver-manager update --gecko false --standalone false",
Expand Down
9 changes: 5 additions & 4 deletions scripts/apps/archive/controllers/UploadController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ function mapIPTCExtensions(metadata: IPTCMetadata, user: IUser): Promise<Partial

return Object.values(extensions).filter(({activationResult}) =>
activationResult.contributions && activationResult.contributions.iptcMapping,
).reduce((accumulator, {activationResult}) =>
accumulator.then((_item) => activationResult.contributions.iptcMapping(metadata, _item))
, Promise.resolve(item))
.then((_item: Partial<IArticle>) => pickBy(_item));
).reduce(
(accumulator, {activationResult}) =>
accumulator.then((_item) => activationResult.contributions.iptcMapping(metadata, _item)),
Promise.resolve(item),
).then((_item: Partial<IArticle>) => pickBy(_item));
}

function serializePromises(promiseCreators: Array<() => Promise<any>>): Promise<Array<any>> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* global _ */

import 'owl.carousel';
import _ from 'lodash';
import * as ctrl from '../controllers';
Expand Down
4 changes: 4 additions & 0 deletions scripts/core/editor3/components/toolbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ class ToolbarComponent extends React.Component<any, IState> {

if (scrollableElement != null) {
// prevent fousing from changing scroll position

// eslint-disable-next-line no-self-assign
scrollableElement.scrollTop = scrollableElement.scrollTop;

// eslint-disable-next-line no-self-assign
scrollableElement.scrollLeft = scrollableElement.scrollLeft;
}
});
Expand Down
2 changes: 1 addition & 1 deletion scripts/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const getSuperdeskType = (event, supportExternalFiles = true) =>
name.includes('application/superdesk') || supportExternalFiles && name === 'Files',
);

/**
/**
* @ngdoc method
* @name gettext
* @param {String} text - the text that will be translated, it supports parameters (see the example)
Expand Down
2 changes: 1 addition & 1 deletion scripts/extensions/annotationsLibrary/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"devDependencies": {
"@types/react": "16.8.23",
"superdesk-code-style": "1.3.0",
"typescript": "3.6.2"
"typescript": "3.7.2"
},
"peerDependencies": {
"react": "16.8.6"
Expand Down
2 changes: 1 addition & 1 deletion scripts/extensions/helloWorld/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"devDependencies": {
"superdesk-code-style": "1.3.0",
"typescript": "3.6.2"
"typescript": "3.7.2"
},
"superdeskExtension": {
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion scripts/extensions/markForUser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@types/react": "16.8.23",
"end-to-end-testing-helpers": "^1.0.3",
"superdesk-code-style": "1.3.0",
"typescript": "3.6.2"
"typescript": "3.7.2"
},
"peerDependencies": {
"react": "16.8.6"
Expand Down
Loading

0 comments on commit 62622c8

Please sign in to comment.