Enable prefer-const lint rule (#3202)

This commit is contained in:
Arthur Cinader
2016-12-07 15:17:05 -08:00
committed by Florent Vilmart
parent a6c988176e
commit ca286b7108
106 changed files with 1183 additions and 1183 deletions

View File

@@ -3,7 +3,7 @@ import logger from '../logger';
import type { FlattenedObjectData } from './Subscription';
export type Message = { [attr: string]: any };
let dafaultFields = ['className', 'objectId', 'updatedAt', 'createdAt', 'ACL'];
const dafaultFields = ['className', 'objectId', 'updatedAt', 'createdAt', 'ACL'];
class Client {
id: number;
@@ -63,7 +63,7 @@ class Client {
_pushEvent(type: string): Function {
return function(subscriptionId: number, parseObjectJSON: any): void {
let response: Message = {
const response: Message = {
'op' : type,
'clientId' : this.id
};
@@ -85,11 +85,11 @@ class Client {
if (!fields) {
return parseObjectJSON;
}
let limitedParseObject = {};
for (let field of dafaultFields) {
const limitedParseObject = {};
for (const field of dafaultFields) {
limitedParseObject[field] = parseObjectJSON[field];
}
for (let field of fields) {
for (const field of fields) {
if (field in parseObjectJSON) {
limitedParseObject[field] = parseObjectJSON[field];
}