-
Notifications
You must be signed in to change notification settings - Fork 84
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
[GH-394] Migration to TypeScript: Sidebar_button migrated to Typescript #438
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #438 +/- ##
=======================================
Coverage 33.40% 33.40%
=======================================
Files 22 22
Lines 3979 3979
=======================================
Hits 1329 1329
Misses 2519 2519
Partials 131 131 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution @Willy-Wakam! This is looking really good. I have just a few suggestions. Also, we'll want to convert src/components/sidebar_buttons/index.js
to typescript if possible.
To fix some linting rules, I suggest changing these lines in .eslintrc.json
:
"no-magic-numbers": "off",
"no-use-before-define": "off",
Note that no-use-before-define
is superseded by @typescript-eslint/no-use-before-define
, so those checks will still be made.
Can you please run this command locally to ensure the linting is correct? The --fix
flag makes it automatically fix certain things as well.
./node_modules/.bin/eslint src/components/sidebar_buttons/sidebar_buttons.tsx --fix
I tried to run the below command locally but it doesn't seem to work. It spits out a bunch of errors from node_modules/@types
only. Using your editor's error reporting in that file should be enough for tsc errors.
npx tsc src/components/sidebar_buttons/sidebar_buttons.tsx --noEmit --skipLibCheck
import React from 'react'; | ||
import {Tooltip, OverlayTrigger} from 'react-bootstrap'; | ||
import React, { PureComponent, ReactElement } from 'react'; | ||
import { Tooltip, OverlayTrigger } from 'react-bootstrap'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our convention is generally to not have spaces in the imports. Our linter should catch this, though on a closer inspection, the npm run lint
command is configured to only check js
and jsx
files
@ayusht2810 Heads up that the linter seems to be configured incorrectly in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Apart from @mickmister comments.
|
||
import { RHSStates, connectUsingBrowserMessage } from 'src/constants'; | ||
import { isDesktopApp } from 'src/utils/user_agent'; | ||
// import PropTypes from 'prop-types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this comment if it's of no use
webapp/package-lock.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we having changes in this file even though we didn't make any changes in the package.json
file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got some errors in the previous commit, so I deleted and pulled the forked project again. I guess by installing node modules, the file was edited, although it was not really changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package-lock.json
says it's lockfileVersion: 3
now. @Willy-Wakam Can you please either revert those changes, or try re-running npm install
in the webapp
folder after setting your node version to the version defined here?
mattermost-plugin-gitlab/.nvmrc
Line 1 in eab8193
14.21.1 |
You can set your node version using tools like https://github.com/nvm-sh/nvm or https://github.com/Schniz/fnm
If there are no more relevant changes, could you @ayusht2810 please merge and close the PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @Willy-Wakam!
Actually blocking on #438 (comment), since this PR currently changes the lockfile version to 3, when it should be 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Apart from lock file changes.
Thanks for the contribution @Willy-Wakam! |
Summary
The file sidebar_button.jsx was migrated into his appropriated Typescript version
All properties and classes were well typed
Ticket Link
Fixes #430