Re-enable rule prefer-destructuring (only for objects) (#10867)

This commit is contained in:
Kamil Gabryjelski
2020-09-14 19:11:20 +02:00
committed by GitHub
parent c51168a30a
commit 352e8a1afd
53 changed files with 80 additions and 83 deletions

View File

@@ -375,7 +375,7 @@ export default function sqlLabReducer(state = {}, action) {
},
[actions.MIGRATE_QUERY_EDITOR]() {
// remove migrated query editor from localStorage
const sqlLab = JSON.parse(localStorage.getItem('redux')).sqlLab;
const { sqlLab } = JSON.parse(localStorage.getItem('redux'));
sqlLab.queryEditors = sqlLab.queryEditors.filter(
qe => qe.id !== action.oldQueryEditor.id,
);
@@ -390,7 +390,7 @@ export default function sqlLabReducer(state = {}, action) {
},
[actions.MIGRATE_TABLE]() {
// remove migrated table from localStorage
const sqlLab = JSON.parse(localStorage.getItem('redux')).sqlLab;
const { sqlLab } = JSON.parse(localStorage.getItem('redux'));
sqlLab.tables = sqlLab.tables.filter(
table => table.id !== action.oldTable.id,
);
@@ -405,7 +405,7 @@ export default function sqlLabReducer(state = {}, action) {
},
[actions.MIGRATE_TAB_HISTORY]() {
// remove migrated tab from localStorage tabHistory
const sqlLab = JSON.parse(localStorage.getItem('redux')).sqlLab;
const { sqlLab } = JSON.parse(localStorage.getItem('redux'));
sqlLab.tabHistory = sqlLab.tabHistory.filter(
tabId => tabId !== action.oldId,
);
@@ -492,7 +492,7 @@ export default function sqlLabReducer(state = {}, action) {
let newQueries = { ...state.queries };
// Fetch the updates to the queries present in the store.
let change = false;
let queriesLastUpdate = state.queriesLastUpdate;
let { queriesLastUpdate } = state;
for (const id in action.alteredQueries) {
const changedQuery = action.alteredQueries[id];
if (