-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
src/webui/src/App.tsx
Outdated
@@ -27,15 +27,15 @@ class App extends React.Component<{}, AppState> { | |||
}; | |||
} | |||
|
|||
async componentDidMount() { | |||
async componentDidMount(): Promise<any> { |
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.
This should be Promise since there is no return value.
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. Had changed Promise<any>
to Promise<void>
.
@@ -20,7 +20,7 @@ class Compare extends React.Component<CompareProps, {}> { | |||
super(props); | |||
} | |||
|
|||
intermediate = () => { | |||
intermediate = (): any => { |
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.
what is the object type of the return value?
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.
It's hard to ensure its type.
I try HTMLElement
Element
HTMLDivElement
.
all tooltip this error: Type 'Element' is missing the following properties from type 'HTMLDivElement': align, addEventListener, removeEventListener, accessKey, and 238 more.ts(2740)
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.
Have you tried React.ReactNode
?
@@ -189,15 +189,15 @@ class SlideBar extends React.Component<SliderProps, SliderState> { | |||
); | |||
} | |||
|
|||
fresh = (event: React.SyntheticEvent<EventTarget>) => { | |||
fresh = (event: React.SyntheticEvent<EventTarget>): any => { |
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.
this should be void
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~
@@ -21,7 +21,7 @@ class Accuracy extends React.Component<AccuracyProps, {}> { | |||
|
|||
} | |||
|
|||
render() { | |||
render(): any { // eslint-disable-line |
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.
should specify the rule being disabled.
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.
OK.
this.setState({ isShowLogDrawer: false }); | ||
} | ||
|
||
render() { | ||
render(): any { // eslint-disable-line |
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.
specify the rule being disabled
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.
Oh, when add the any
type, it doesn't need to add the note. I'll delete all the similar questions. Thanks!
please update azure-pipelines.yml to enable webui eslint |
const { trialConcurrency } = this.state; | ||
const { experimentUpdateBroadcast, metricGraphMode } = this.props; | ||
|
||
const searchSpace = this.convertSearchSpace(); | ||
|
||
const bestTrials = this.findBestTrials(); | ||
const bestAccuracy = bestTrials.length > 0 ? bestTrials[0].accuracy! : NaN; | ||
const bestAccuracy = bestTrials.length > 0 ? bestTrials[0].accuracy! : ''; // eslint-disable-line |
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.
when // eslint-disable-line
is used, please specify the rule such as // eslint-disable-line @typescript-eslint/camelcase
, so that we know which rule is disabled
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.
Ok.
OK. |
@@ -52,14 +52,14 @@ class Compare extends React.Component<CompareProps, {}> { | |||
tooltip: { | |||
trigger: 'item', | |||
enterable: true, | |||
position: function (point: Array<number>, data: TooltipForIntermediate) { | |||
position: function (point: Array<number>, data: TooltipForIntermediate): Array<number> { |
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.
Array<number>
is more oftenly written as number[]
.
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
src/webui/src/App.tsx
Outdated
this.setState({ metricGraphMode: val }); | ||
} | ||
|
||
render() { | ||
render(): any{ |
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.
Can the return type be React.ReactNode
?
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.
It's right!
@@ -60,55 +60,57 @@ class TrialsDetail extends React.Component<TrialsDetailProps, TrialDetailState> | |||
tablePageSize: 20, | |||
whichGraph: '1', | |||
searchType: 'id', | |||
searchFilter: trial => true, | |||
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type | |||
searchFilter: trial => true // eslint-disable-line @typescript-eslint/no-unused-vars |
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.
This two disabling should be merged.
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.
Had fixed, thanks~
if (!targetValue.trim()) { | ||
this.setState({ searchFilter: filter }); | ||
return; | ||
} | ||
switch (this.state.searchType) { | ||
case 'id': | ||
filter = trial => trial.info.id.toUpperCase().includes(targetValue.toUpperCase()); | ||
filter = (trial): any => trial.info.id.toUpperCase().includes(targetValue.toUpperCase()); // elint-disable-line |
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 return type is boolean
.
elint-disable-line does nothing I suppose.
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.
Had fixed. Thanks~
@@ -98,6 +101,8 @@ class Progressed extends React.Component<ProgressProps, ProgressState> { | |||
</div> | |||
); | |||
} | |||
|
|||
const bestFinalResult = (typeof bestAccuracy === 'number') ? bestAccuracy.toFixed(6) : '--'; |
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.
Accuracy might be NaN
(which is a number
) in next release.
No need to fix now though.
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'll change origin code back. And then add // eslint-disable-line @...
@@ -73,10 +73,17 @@ class OpenRow extends React.Component<OpenRowProps, OpenRowState> { | |||
Trails for multiphase experiment will return a set of parameters, | |||
we are listing the latest parameter in webportal. | |||
<br /> | |||
For the entire parameter set, please refer to the following " | |||
<a href={trialLink} target="_blank">{trialLink}</a>". | |||
For the entire parameter set, please refer to the following" |
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.
space before "
?
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.
OK.
disable
react/disable-name
in eslint. 参考issueupdate azure-pipelines.yml to enable webui eslint
had specify the rule, such as // eslint-disable-line @typescript-eslint/camelcase
render() : any
change torender() : React.ReactNode
// eslint-disable-line @... , @..., @...
change more accuracy function type
Still have seven errors to fix & test