Skip to content
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

[7.x] [ML] Transforms: Removes temporary x-pack/legacy/plugins/transform eslint overrides. #49744

Merged
merged 1 commit into from
Oct 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
};
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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,
Expand All @@ -178,6 +182,7 @@ export const StepDetailsForm: SFC<Props> = React.memo(({ overrides = {}, onChang
transformDescription,
destinationIndex,
valid,
/* eslint-enable react-hooks/exhaustive-deps */
]);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
};