diff --git a/.eslintrc.yml b/.eslintrc.yml index 65f1dce6c..73eeec276 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -12,3 +12,4 @@ rules: eqeqeq: error no-warning-comments: warn no-var: error + prefer-const: error diff --git a/samples/iam.js b/samples/iam.js index ab7ca726d..703bc6604 100644 --- a/samples/iam.js +++ b/samples/iam.js @@ -132,7 +132,7 @@ function removeBucketIamMember(bucketName, roleName, members) { // Finds and updates the appropriate role-member group const index = policy.bindings.findIndex(role => role.role === roleName); - let role = policy.bindings[index]; + const role = policy.bindings[index]; if (role) { role.members = role.members.filter( member => members.indexOf(member) === -1 diff --git a/samples/system-test/encryption.test.js b/samples/system-test/encryption.test.js index 00af29f18..798f9e792 100644 --- a/samples/system-test/encryption.test.js +++ b/samples/system-test/encryption.test.js @@ -108,7 +108,7 @@ test.serial(`should rotate keys`, async t => { const output = generateKeyResults.stdout + generateKeyResults.stderr; t.regex(output, new RegExp(`Base 64 encoded encryption key:`)); const test = /^Base 64 encoded encryption key: (.+)$/; - let newKey = output.match(test)[1]; + const newKey = output.match(test)[1]; const results = await tools.runAsyncWithIO( `${cmd} rotate ${bucketName} ${fileName} ${key} ${newKey}`,