mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[ML] Transforms: Removes temporary x-pack/legacy/plugins/transform
eslint overrides.
Re-enables linting rules related to React hooks and adapts inline code.
This commit is contained in:
parent
0efe6a2f16
commit
b368c6acba
10 changed files with 22 additions and 7 deletions
|
@ -229,12 +229,6 @@ module.exports = {
|
|||
'react-hooks/exhaustive-deps': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['x-pack/legacy/plugins/transform/**/*.{js,ts,tsx}'],
|
||||
rules: {
|
||||
'react-hooks/exhaustive-deps': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['x-pack/legacy/plugins/uptime/**/*.{js,ts,tsx}'],
|
||||
rules: {
|
||||
|
|
|
@ -95,6 +95,8 @@ export const useRefreshTransformList = (
|
|||
return () => {
|
||||
subscriptions.map(sub => sub.unsubscribe());
|
||||
};
|
||||
// The effect should only be called once.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
return {
|
||||
|
|
|
@ -75,6 +75,8 @@ export const KibanaProvider: FC<Props> = ({ savedObjectId, children }) => {
|
|||
|
||||
useEffect(() => {
|
||||
fetchSavedObject(savedObjectId);
|
||||
// fetchSavedObject should not be tracked.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [savedObjectId]);
|
||||
|
||||
return <KibanaContext.Provider value={contextValue}>{children}</KibanaContext.Provider>;
|
||||
|
|
|
@ -131,6 +131,8 @@ export const useSourceIndexData = (
|
|||
|
||||
useEffect(() => {
|
||||
getSourceIndexData();
|
||||
// custom comparison
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [indexPattern.title, JSON.stringify(query)]);
|
||||
return { errorMessage, status, tableItems };
|
||||
};
|
||||
|
|
|
@ -76,6 +76,8 @@ export const StepCreateForm: SFC<Props> = React.memo(
|
|||
|
||||
useEffect(() => {
|
||||
onChange({ created, started, indexPatternId });
|
||||
// custom comparison
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [created, started, indexPatternId]);
|
||||
|
||||
const api = useApi();
|
||||
|
|
|
@ -150,7 +150,7 @@ export const PivotPreview: SFC<PivotPreviewProps> = React.memo(({ aggs, groupBy,
|
|||
if (clearTable) {
|
||||
setTimeout(() => setClearTable(false), 0);
|
||||
}
|
||||
});
|
||||
}, [firstColumnNameChanged, clearTable]);
|
||||
|
||||
if (firstColumnNameChanged) {
|
||||
return null;
|
||||
|
|
|
@ -487,6 +487,8 @@ export const StepDefineForm: SFC<Props> = React.memo(({ overrides = {}, onChange
|
|||
sourceConfigUpdated,
|
||||
valid,
|
||||
});
|
||||
// custom comparison
|
||||
/* eslint-disable react-hooks/exhaustive-deps */
|
||||
}, [
|
||||
JSON.stringify(pivotAggsArr),
|
||||
JSON.stringify(pivotGroupByArr),
|
||||
|
@ -495,6 +497,7 @@ export const StepDefineForm: SFC<Props> = React.memo(({ overrides = {}, onChange
|
|||
searchString,
|
||||
searchQuery,
|
||||
valid,
|
||||
/* eslint-enable react-hooks/exhaustive-deps */
|
||||
]);
|
||||
|
||||
// TODO This should use the actual value of `indices.query.bool.max_clause_count`
|
||||
|
|
|
@ -91,11 +91,14 @@ export const usePivotPreviewData = (
|
|||
|
||||
useEffect(() => {
|
||||
getPreviewData();
|
||||
// custom comparison
|
||||
/* eslint-disable react-hooks/exhaustive-deps */
|
||||
}, [
|
||||
indexPattern.title,
|
||||
JSON.stringify(aggsArr),
|
||||
JSON.stringify(groupByArr),
|
||||
JSON.stringify(query),
|
||||
/* eslint-enable react-hooks/exhaustive-deps */
|
||||
]);
|
||||
|
||||
return { errorMessage, status, previewData, previewMappings, previewRequest };
|
||||
|
|
|
@ -121,6 +121,8 @@ export const StepDetailsForm: SFC<Props> = React.memo(({ overrides = {}, onChang
|
|||
}
|
||||
}
|
||||
})();
|
||||
// custom comparison
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [kibanaContext.initialized]);
|
||||
|
||||
if (!isKibanaContextInitialized(kibanaContext)) {
|
||||
|
@ -169,6 +171,8 @@ export const StepDetailsForm: SFC<Props> = React.memo(({ overrides = {}, onChang
|
|||
touched: true,
|
||||
valid,
|
||||
});
|
||||
// custom comparison
|
||||
/* eslint-disable react-hooks/exhaustive-deps */
|
||||
}, [
|
||||
continuousModeDateField,
|
||||
continuousModeDelay,
|
||||
|
@ -178,6 +182,7 @@ export const StepDetailsForm: SFC<Props> = React.memo(({ overrides = {}, onChang
|
|||
transformDescription,
|
||||
destinationIndex,
|
||||
valid,
|
||||
/* eslint-enable react-hooks/exhaustive-deps */
|
||||
]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -77,5 +77,7 @@ export const useRefreshInterval = (
|
|||
refreshIntervalSubscription.unsubscribe();
|
||||
clearRefreshInterval();
|
||||
};
|
||||
// custom comparison
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []); // [] as comparator makes sure this only runs once
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue