This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 91b8c8a Re-enable rule state-in-constructor (#10873)
91b8c8a is described below
commit 91b8c8afc9098653b71d9e5855499717ec44145b
Author: Kamil Gabryjelski <[email protected]>
AuthorDate: Mon Sep 14 22:31:11 2020 +0200
Re-enable rule state-in-constructor (#10873)
---
superset-frontend/.eslintrc.js | 2 --
superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx | 13 ++++++++-----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js
index 11a03bd..d1cbd2c 100644
--- a/superset-frontend/.eslintrc.js
+++ b/superset-frontend/.eslintrc.js
@@ -125,7 +125,6 @@ module.exports = {
'react/no-unused-prop-types': 0,
'react/prop-types': 0,
'react/require-default-props': 0,
- 'react/state-in-constructor': 0, // disabled temporarily
'react/static-property-placement': 0, // re-enable up for discussion
'prettier/prettier': 'error',
},
@@ -239,7 +238,6 @@ module.exports = {
'react/no-unused-prop-types': 0,
'react/prop-types': 0,
'react/require-default-props': 0,
- 'react/state-in-constructor': 0, // disabled temporarily
'react/static-property-placement': 0, // disabled temporarily
'prettier/prettier': 'error',
},
diff --git a/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx
b/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx
index 8e04ea7..b3990f4 100644
--- a/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx
+++ b/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx
@@ -92,11 +92,14 @@ class DashboardTable extends React.PureComponent<
initialSort = [{ id: 'changed_on_delta_humanized', desc: true }];
- state = {
- dashboards: [],
- dashboard_count: 0,
- loading: false,
- };
+ constructor(props: DashboardTableProps) {
+ super(props);
+ this.state = {
+ dashboards: [],
+ dashboard_count: 0,
+ loading: false,
+ };
+ }
componentDidUpdate(prevProps: DashboardTableProps) {
if (prevProps.search !== this.props.search) {