Skip to content

Commit 6883850

Browse files
authored
Enable and fix prefer-const lint (relayjs#51)
1 parent 2711f35 commit 6883850

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"ecmaVersion": 2018
1010
},
1111
"rules": {
12+
"prefer-const": "error",
1213
"no-unused-vars": [
1314
"error",
1415
{

src/rule-generated-flow-types.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function validateObjectTypeAnnotation(
107107
propName
108108
);
109109
});
110-
let atleastOnePropertyExists = !!propType.properties[0];
110+
const atleastOnePropertyExists = !!propType.properties[0];
111111

112112
if (!propTypeProperty) {
113113
if (onlyVerify) {
@@ -125,7 +125,7 @@ function validateObjectTypeAnnotation(
125125
fix: options.fix
126126
? fixer => {
127127
const whitespace = ' '.repeat(Component.parent.loc.start.column);
128-
let fixes = [
128+
const fixes = [
129129
genImportFixer(
130130
fixer,
131131
importFixRange,
@@ -221,11 +221,11 @@ module.exports = {
221221
return {};
222222
}
223223
const options = getOptions(context.options[0]);
224-
let componentMap = {};
225-
let expectedTypes = [];
226-
let imports = [];
227-
let requires = [];
228-
let typeAliasMap = {};
224+
const componentMap = {};
225+
const expectedTypes = [];
226+
const imports = [];
227+
const requires = [];
228+
const typeAliasMap = {};
229229
return {
230230
ImportDeclaration(node) {
231231
imports.push(node);

0 commit comments

Comments
 (0)