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

ESLint: Re-enable rule no-unused-state #10871

Merged
merged 1 commit into from
Sep 14, 2020
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
2 changes: 0 additions & 2 deletions superset-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ module.exports = {
'react/no-string-refs': 0,
'react/no-unescaped-entities': 0,
'react/no-unused-prop-types': 0,
'react/no-unused-state': 0, // disabled temporarily
'react/prop-types': 0,
'react/require-default-props': 0,
'react/sort-comp': 0, // disabled temporarily
Expand Down Expand Up @@ -254,7 +253,6 @@ module.exports = {
'react/no-string-refs': 0,
'react/no-unescaped-entities': 0,
'react/no-unused-prop-types': 0,
'react/no-unused-state': 0, // disabled temporarily
'react/prop-types': 0,
'react/require-default-props': 0,
'react/sort-comp': 0, // disabled temporarily
Expand Down
2 changes: 0 additions & 2 deletions superset-frontend/src/SqlLab/components/QuerySearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class QuerySearch extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
userLoading: false,
userOptions: [],
databaseId: null,
userId: null,
searchText: null,
Expand Down
17 changes: 1 addition & 16 deletions superset-frontend/src/SqlLab/components/QueryTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,11 @@ const defaultProps = {
};

class QueryTable extends React.PureComponent {
constructor(props) {
super(props);
const uri = window.location.toString();
const cleanUri = uri.substring(0, uri.indexOf('#'));
this.state = {
cleanUri,
showVisualizeModal: false,
activeQuery: null,
};
}
openQuery(id) {
const url = `/superset/sqllab?queryId=${id}`;
window.open(url);
}
hideVisualizeModal() {
this.setState({ showVisualizeModal: false });
}
showVisualizeModal(query) {
this.setState({ activeQuery: query, showVisualizeModal: true });
}

restoreSql(query) {
this.props.actions.queryEditorSetSql({ id: query.sqlEditorId }, query.sql);
}
Expand Down
4 changes: 2 additions & 2 deletions superset-frontend/src/SqlLab/components/SaveQuery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class SaveQuery extends React.PureComponent {
close() {
if (this.saveModal) this.saveModal.close();
}
toggleSave(e) {
this.setState({ target: e.target, showSave: !this.state.showSave });
toggleSave() {
this.setState({ showSave: !this.state.showSave });
}
renderModalBody() {
const isSaved = !!this.props.query.remoteId;
Expand Down
1 change: 0 additions & 1 deletion superset-frontend/src/addSlice/AddSliceContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export default class AddSliceContainer extends React.PureComponent<
this.setState({
datasourceValue: option.value,
datasourceId: option.value.split('__')[0],
datasourceType: option.value.split('__')[1],
});
}

Expand Down
1 change: 0 additions & 1 deletion superset-frontend/src/dashboard/components/CssEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class CssEditor extends React.PureComponent {
super(props);
this.state = {
css: props.initialCss,
cssTemplateOptions: [],
};
this.changeCss = this.changeCss.bind(this);
this.changeCssTemplate = this.changeCssTemplate.bind(this);
Expand Down
2 changes: 0 additions & 2 deletions superset-frontend/src/explore/components/SaveModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ class SaveModal extends React.Component {
this.state = {
saveToDashboardId: null,
newSliceName: props.sliceName,
dashboards: [],
alert: null,
action: props.can_overwrite ? 'overwrite' : 'saveas',
vizType: props.form_data.viz_type,
};
this.onDashboardSelectChange = this.onDashboardSelectChange.bind(this);
this.onSliceNameChange = this.onSliceNameChange.bind(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,13 @@ const defaultProps = {
export default class ColorSchemeControl extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
scheme: this.props.value,
};
this.onChange = this.onChange.bind(this);
this.renderOption = this.renderOption.bind(this);
}

onChange(option) {
const optionValue = option ? option.value : null;
this.props.onChange(optionValue);
this.setState({ scheme: optionValue });
}

renderOption(key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class DatasourceControl extends React.PureComponent {
this.state = {
showEditDatasourceModal: false,
showChangeDatasourceModal: false,
menuExpanded: false,
};
this.onDatasourceSave = this.onDatasourceSave.bind(this);
this.toggleChangeDatasourceModal = this.toggleChangeDatasourceModal.bind(
Expand Down