Skip to content

Commit 7d99b71

Browse files
eslint: disable no-console
fixes #47
1 parent f632dcd commit 7d99b71

File tree

15 files changed

+16
-23
lines changed

15 files changed

+16
-23
lines changed

.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
},
66
"rules": {
77
"strict": "off",
8+
"no-console": "off",
89
"import/no-unresolved": "off"
910
}
1011
}

aws-node-auth0-custom-authorizers-api/frontend/app.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ document.getElementById('btn-login').addEventListener('click', () => {
2323
lock.show((err, profile, token) => {
2424
if (err) {
2525
// Error callback
26-
console.error('Something went wrong: ', err); // eslint-disable-line no-console
26+
console.error('Something went wrong: ', err);
2727
alert('Something went wrong, check the Console errors'); // eslint-disable-line no-alert
2828
} else {
2929
// Success calback
30-
console.log(token); // eslint-disable-line no-console
30+
console.log(token);
3131

3232
// Save the JWT token.
3333
localStorage.setItem('userToken', token);
@@ -61,7 +61,7 @@ document.getElementById('btn-public').addEventListener('click', () => {
6161

6262
getdata.then((response) => {
6363
response.json().then((data) => {
64-
console.log('Message:', data); // eslint-disable-line no-console
64+
console.log('Message:', data);
6565
document.getElementById('message').textContent = '';
6666
document.getElementById('message').textContent = data.message;
6767
});
@@ -87,7 +87,7 @@ document.getElementById('btn-private').addEventListener('click', () => {
8787

8888
getdata.then((response) => {
8989
response.json().then((data) => {
90-
console.log('Token:', data); // eslint-disable-line no-console
90+
console.log('Token:', data);
9191
document.getElementById('message').textContent = '';
9292
document.getElementById('message').textContent = data.message;
9393
});

aws-node-env-variables-encrypted-in-a-file/handler.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
'use strict';
22

3-
/* eslint-disable no-console */
4-
53
module.exports.resetPassword = (event, context, callback) => {
64
console.log('SESSION_KEY: ', process.env.SESSION_KEY);
75

aws-node-env-variables/handler.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
'use strict';
22

3-
/* eslint-disable no-console */
4-
53
module.exports.createUser = (event, context, callback) => {
64
// logs `4096`
75
console.log('PASSWORD_ITERATIONS: ', process.env.PASSWORD_ITERATIONS);

aws-node-function-compiled-with-babel/handler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ const createResponse = require('./createResponse');
22

33
module.exports.hello = (event, context, callback) => {
44
const response = createResponse({ body: { message: 'Success!' } });
5-
console.log({ response }); // eslint-disable-line no-console
5+
console.log({ response });
66
callback(null, response);
77
};

aws-node-iot-event/handler.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
module.exports.log = (event, context, callback) => {
4-
// eslint-disable-next-line no-console
54
console.log(event);
65
callback(null, {});
76
};

aws-node-rest-api-with-dynamodb/todos/create.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports.create = (event, context, callback) => {
99
const timestamp = new Date().getTime();
1010
const data = JSON.parse(event.body);
1111
if (typeof data.text !== 'string') {
12-
console.error('Validation Failed'); // eslint-disable-line no-console
12+
console.error('Validation Failed');
1313
callback(new Error('Couldn\'t create the todo item.'));
1414
return;
1515
}
@@ -29,7 +29,7 @@ module.exports.create = (event, context, callback) => {
2929
dynamoDb.put(params, (error, result) => {
3030
// handle potential errors
3131
if (error) {
32-
console.error(error); // eslint-disable-line no-console
32+
console.error(error);
3333
callback(new Error('Couldn\'t create the todo item.'));
3434
return;
3535
}

aws-node-rest-api-with-dynamodb/todos/delete.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports.delete = (event, context, callback) => {
1616
dynamoDb.delete(params, (error) => {
1717
// handle potential errors
1818
if (error) {
19-
console.error(error); // eslint-disable-line no-console
19+
console.error(error);
2020
callback(new Error('Couldn\'t remove the todo item.'));
2121
return;
2222
}

aws-node-rest-api-with-dynamodb/todos/get.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports.get = (event, context, callback) => {
1616
dynamoDb.get(params, (error, result) => {
1717
// handle potential errors
1818
if (error) {
19-
console.error(error); // eslint-disable-line no-console
19+
console.error(error);
2020
callback(new Error('Couldn\'t fetch the todo item.'));
2121
return;
2222
}

aws-node-rest-api-with-dynamodb/todos/list.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports.list = (event, context, callback) => {
1212
dynamoDb.scan(params, (error, result) => {
1313
// handle potential errors
1414
if (error) {
15-
console.error(error); // eslint-disable-line no-console
15+
console.error(error);
1616
callback(new Error('Couldn\'t fetch the todos.'));
1717
return;
1818
}

aws-node-rest-api-with-dynamodb/todos/update.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports.update = (event, context, callback) => {
1010

1111
// validation
1212
if (typeof data.text !== 'string' || typeof data.checked !== 'boolean') {
13-
console.error('Validation Failed'); // eslint-disable-line no-console
13+
console.error('Validation Failed');
1414
callback(new Error('Couldn\'t update the todo item.'));
1515
return;
1616
}
@@ -36,7 +36,7 @@ module.exports.update = (event, context, callback) => {
3636
dynamoDb.update(params, (error, result) => {
3737
// handle potential errors
3838
if (error) {
39-
console.error(error); // eslint-disable-line no-console
39+
console.error(error);
4040
callback(new Error('Couldn\'t update the todo item.'));
4141
return;
4242
}

aws-node-scheduled-cron/handler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
module.exports.run = (event, context) => {
44
const time = new Date();
5-
console.log(`Your cron function "${context.functionName}" ran at ${time}`); // eslint-disable-line no-console
5+
console.log(`Your cron function "${context.functionName}" ran at ${time}`);
66
};

aws-node-text-analysis-via-sns-post-processing/addNote.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const sns = new AWS.SNS();
88
module.exports.addNote = (event, context, callback) => {
99
const data = JSON.parse(event.body);
1010
if (typeof data.note !== 'string') {
11-
console.error('Validation Failed'); // eslint-disable-line no-console
11+
console.error('Validation Failed');
1212
callback(new Error('Couldn\'t add the note.'));
1313
return;
1414
}
@@ -20,7 +20,6 @@ module.exports.addNote = (event, context, callback) => {
2020

2121
sns.publish(params, (error) => {
2222
if (error) {
23-
// eslint-disable-next-line no-console
2423
console.error(error);
2524
callback(new Error('Couldn\'t add the note due an internal error. Please try again later.'));
2625
}

aws-node-text-analysis-via-sns-post-processing/analyzeNote.js

-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ module.exports.analyzeNote = (event) => {
66
const note = event.Records[0].Sns.Message;
77
const result = sentiment(note);
88
if (result.score > 2) {
9-
// eslint-disable-next-line no-console
109
console.log(`Positive note - will be published: ${note}`);
1110
} else {
12-
// eslint-disable-next-line no-console
1311
console.log(`Negative note - won't be published: ${note}`);
1412
}
1513
};

openwhisk-node-scheduled-cron/handler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
function cron() {
44
const time = new Date();
55
const name = '__OW_ACTION_NAME';
6-
console.log(`Your cron function "${process.env[name]}" ran at ${time}`); // eslint-disable-line no-console
6+
console.log(`Your cron function "${process.env[name]}" ran at ${time}`);
77
}
88

99
module.exports.cron = cron;

0 commit comments

Comments
 (0)