Re-enable rule no-unused-state (#10871)
This commit is contained in:
parent
352e8a1afd
commit
906a629b33
|
|
@ -130,7 +130,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
|
||||
|
|
@ -252,7 +251,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
|
||||
|
|
|
|||
|
|
@ -43,8 +43,6 @@ class QuerySearch extends React.PureComponent {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
userLoading: false,
|
||||
userOptions: [],
|
||||
databaseId: null,
|
||||
userId: null,
|
||||
searchText: null,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -50,9 +50,6 @@ 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);
|
||||
}
|
||||
|
|
@ -60,7 +57,6 @@ export default class ColorSchemeControl extends React.PureComponent {
|
|||
onChange(option) {
|
||||
const optionValue = option ? option.value : null;
|
||||
this.props.onChange(optionValue);
|
||||
this.setState({ scheme: optionValue });
|
||||
}
|
||||
|
||||
renderOption(key) {
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue