MM-26572 Improve tooling around typescript (#105)

* Upstream typescript tooling changes.

* Update rest of dependencies.
This commit is contained in:
Christopher Speller 2020-07-09 06:51:28 -07:00 committed by GitHub
parent becbbc9685
commit 7cdbf90a73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4904 additions and 6122 deletions

View file

@ -44,6 +44,7 @@ check-style: webapp/node_modules
ifneq ($(HAS_WEBAPP),) ifneq ($(HAS_WEBAPP),)
cd webapp && npm run lint cd webapp && npm run lint
cd webapp && npm run check-types
endif endif
ifneq ($(HAS_SERVER),) ifneq ($(HAS_SERVER),)

View file

@ -1,5 +1,8 @@
{ {
"extends": "eslint:recommended", "extends": [
"eslint:recommended",
"plugin:react-hooks/recommended"
],
"parserOptions": { "parserOptions": {
"ecmaVersion": 8, "ecmaVersion": 8,
"sourceType": "module", "sourceType": "module",
@ -60,12 +63,6 @@
"allowSingleLine": false "allowSingleLine": false
} }
], ],
"camelcase": [
2,
{
"properties": "never"
}
],
"capitalized-comments": 0, "capitalized-comments": 0,
"class-methods-use-this": 0, "class-methods-use-this": 0,
"comma-dangle": [ "comma-dangle": [
@ -270,7 +267,7 @@
"no-lonely-if": 2, "no-lonely-if": 2,
"no-loop-func": 2, "no-loop-func": 2,
"no-magic-numbers": [ "no-magic-numbers": [
1, 0,
{ {
"ignore": [ "ignore": [
-1, -1,
@ -548,7 +545,7 @@
} }
], ],
"react/prefer-es6-class": 2, "react/prefer-es6-class": 2,
"react/prefer-stateless-function": 0, "react/prefer-stateless-function": 2,
"react/prop-types": [ "react/prop-types": [
2, 2,
{ {
@ -638,8 +635,13 @@
"files": ["**/*.tsx", "**/*.ts"], "files": ["**/*.tsx", "**/*.ts"],
"extends": "plugin:@typescript-eslint/recommended", "extends": "plugin:@typescript-eslint/recommended",
"rules": { "rules": {
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/ban-types": 1,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-var-requires": 0, "@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/prefer-interface": 0, "@typescript-eslint/prefer-interface": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/indent": [ "@typescript-eslint/indent": [
2, 2,
4, 4,
@ -655,12 +657,6 @@
"variables": false "variables": false
} }
], ],
"@typescript-eslint/camelcase": [
2,
{
"properties": "never"
}
],
"react/jsx-filename-extension": [ "react/jsx-filename-extension": [
1, 1,
{ {

10916
webapp/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -9,61 +9,64 @@
"fix": "eslint --ignore-pattern node_modules --ignore-pattern dist --ext .js --ext .jsx --ext tsx --ext ts . --quiet --fix --cache", "fix": "eslint --ignore-pattern node_modules --ignore-pattern dist --ext .js --ext .jsx --ext tsx --ext ts . --quiet --fix --cache",
"test": "jest --forceExit --detectOpenHandles --verbose", "test": "jest --forceExit --detectOpenHandles --verbose",
"test:watch": "jest --watch", "test:watch": "jest --watch",
"test-ci": "jest --forceExit --detectOpenHandles --maxWorkers=2" "test-ci": "jest --forceExit --detectOpenHandles --maxWorkers=2",
"check-types": "tsc"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "7.4.4", "@babel/cli": "7.10.4",
"@babel/core": "7.4.5", "@babel/core": "7.10.4",
"@babel/plugin-proposal-class-properties": "7.4.4", "@babel/plugin-proposal-class-properties": "7.10.4",
"@babel/plugin-proposal-object-rest-spread": "7.5.5", "@babel/plugin-proposal-object-rest-spread": "7.10.4",
"@babel/plugin-proposal-optional-chaining": "7.10.4", "@babel/plugin-proposal-optional-chaining": "7.10.4",
"@babel/plugin-syntax-dynamic-import": "7.2.0", "@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/polyfill": "7.4.4", "@babel/polyfill": "7.10.4",
"@babel/preset-env": "7.4.5", "@babel/preset-env": "7.10.4",
"@babel/preset-react": "7.0.0", "@babel/preset-react": "7.10.4",
"@babel/preset-typescript": "7.3.3", "@babel/preset-typescript": "7.10.4",
"@babel/runtime": "7.4.5", "@babel/runtime": "7.10.4",
"@emotion/babel-preset-css-prop": "10.0.27", "@emotion/babel-preset-css-prop": "10.0.27",
"@emotion/core": "10.0.28", "@emotion/core": "10.0.28",
"@types/enzyme": "3.10.4", "@types/enzyme": "3.10.5",
"@types/jest": "24.0.25", "@types/jest": "26.0.4",
"@types/node": "12.12.24", "@types/node": "14.0.20",
"@types/react": "16.9.17", "@types/react": "16.9.41",
"@types/react-dom": "16.9.4", "@types/react-dom": "16.9.8",
"@types/react-intl": "2.3.18", "@types/react-intl": "3.0.0",
"@types/react-router-dom": "4.3.4", "@types/react-redux": "7.1.9",
"@types/react-transition-group": "4.2.2", "@types/react-router-dom": "5.1.5",
"@typescript-eslint/eslint-plugin": "1.13.0", "@types/react-transition-group": "4.4.0",
"@typescript-eslint/parser": "1.13.0", "@typescript-eslint/eslint-plugin": "3.6.0",
"babel-eslint": "10.0.2", "@typescript-eslint/parser": "3.6.0",
"babel-eslint": "10.1.0",
"babel-jest": "26.1.0", "babel-jest": "26.1.0",
"babel-loader": "8.0.6", "babel-loader": "8.1.0",
"babel-plugin-typescript-to-proptypes": "0.17.1", "babel-plugin-typescript-to-proptypes": "1.3.2",
"css-loader": "3.6.0", "css-loader": "3.6.0",
"enzyme": "3.11.0", "enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.2", "enzyme-adapter-react-16": "1.15.2",
"enzyme-to-json": "3.4.3", "enzyme-to-json": "3.5.0",
"eslint": "6.0.1", "eslint": "7.4.0",
"eslint-import-resolver-webpack": "0.11.1", "eslint-import-resolver-webpack": "0.12.2",
"eslint-plugin-import": "2.18.0", "eslint-plugin-import": "2.22.0",
"eslint-plugin-react": "7.14.2", "eslint-plugin-react": "7.20.3",
"file-loader": "4.0.0", "eslint-plugin-react-hooks": "4.0.6",
"file-loader": "6.0.0",
"identity-obj-proxy": "3.0.0", "identity-obj-proxy": "3.0.0",
"jest": "25.1.0", "jest": "26.1.0",
"jest-canvas-mock": "2.2.0", "jest-canvas-mock": "2.2.0",
"jest-junit": "10.0.0", "jest-junit": "11.0.1",
"mattermost-webapp": "github:mattermost/mattermost-webapp#23f5f93d9f12a7e2b5623e5cee6814366abd9a0f", "mattermost-webapp": "github:mattermost/mattermost-webapp#23f5f93d9f12a7e2b5623e5cee6814366abd9a0f",
"sass-loader": "8.0.2", "sass-loader": "9.0.2",
"style-loader": "1.2.1", "style-loader": "1.2.1",
"webpack": "4.35.0", "webpack": "4.43.0",
"webpack-cli": "3.3.5" "webpack-cli": "3.3.12"
}, },
"dependencies": { "dependencies": {
"core-js": "3.6.2", "core-js": "3.6.5",
"react": "16.8.6", "react": "16.13.1",
"react-redux": "5.0.7", "react-redux": "7.2.0",
"redux": "4.0.1", "redux": "4.0.5",
"typescript": "3.5.3" "typescript": "3.9.6"
}, },
"jest": { "jest": {
"snapshotSerializers": [ "snapshotSerializers": [