Prefer const wherever possible
Summary: Non-final identifiers make code harder to understand. This is particularly true for JavaScript where even the *type* can change as a value gets reassigned later. This enforces to use `const` whereever possible, but doesn't "outlaw" `let`. Mixed destructuring is also still allowed. Used `eslint --fix` to change all existing cases. Reviewed By: jknoxville Differential Revision: D16131329 fbshipit-source-id: 2eceaca7c603b71b36e005be5d135e1849f2518d
This commit is contained in:
committed by
Facebook Github Bot
parent
662db20948
commit
c588b650ae
@@ -143,7 +143,7 @@ const reducer = (state: State = INITAL_STATE, action: Action): State => {
|
||||
selectedPlugin: DEFAULT_PLUGIN,
|
||||
};
|
||||
|
||||
let canBeDefaultDevice = !DEFAULT_DEVICE_BLACKLIST.some(
|
||||
const canBeDefaultDevice = !DEFAULT_DEVICE_BLACKLIST.some(
|
||||
blacklistedDevice => payload instanceof blacklistedDevice,
|
||||
);
|
||||
|
||||
@@ -272,7 +272,7 @@ const reducer = (state: State = INITAL_STATE, action: Action): State => {
|
||||
case 'CLIENT_REMOVED': {
|
||||
const {payload} = action;
|
||||
|
||||
let selected = {};
|
||||
const selected = {};
|
||||
if (state.selectedApp === payload) {
|
||||
selected.selectedApp = null;
|
||||
selected.selectedPlugin = DEFAULT_PLUGIN;
|
||||
|
||||
Reference in New Issue
Block a user