Skip to content

Commit e73bfc7

Browse files
committed
- add ESLint error-rule for prevent unnecessary console.log
1 parent 9d613ff commit e73bfc7

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

.eslintrc

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,37 @@
1818
"func-style": [
1919
"warn",
2020
"declaration",
21-
{ "allowArrowFunctions": true }
21+
{
22+
"allowArrowFunctions": true
23+
}
2224
],
23-
2425
// disallow declaration of variables already declared in the outer scope
25-
// "no-shadow": "warn",
26+
// "no-shadow": "warn",
2627

2728
// require let or const instead of var
2829
"no-var": "warn",
29-
3030
"no-unused-vars": "warn",
31-
31+
"no-console": "error",
3232
"max-len": [
3333
"warn",
3434
120
3535
],
36-
3736
// require or disallow use of semicolons instead of ASI
3837
"semi": [
3938
"warn",
4039
"never"
4140
],
42-
4341
// require the use of === and !== except null comparison
4442
"eqeqeq": [
4543
"warn",
4644
"smart"
4745
],
48-
4946
// specify whether double or single quotes should be used
5047
"quotes": [
5148
"warn",
5249
"single",
5350
"avoid-escape"
5451
],
55-
5652
// require space before/after arrow function"s arrow
5753
"arrow-spacing": [
5854
"warn",
@@ -61,23 +57,21 @@
6157
"after": true
6258
}
6359
],
64-
65-
"arrow-parens": ["warn", "as-needed"],
66-
60+
"arrow-parens": [
61+
"warn",
62+
"as-needed"
63+
],
6764
// suggest using of const declaration for variables that are never modified after declared
6865
"prefer-const": "warn",
69-
7066
// restrict what can be thrown as an exception
7167
"no-throw-literal": "warn",
72-
7368
// disallow Unused Expressions
7469
"no-unused-expressions": [
7570
"warn",
7671
{
7772
"allowShortCircuit": true
7873
}
7974
],
80-
8175
// require padding inside curly braces
8276
"object-curly-spacing": [
8377
"warn",

src/decorators/deprecated.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const deprecated = (namespace, alternative) => function(target, prop, des
55
const mainMessage = `"${namespace}.${prop}" is deprecated and will be removed in the nearest release.`
66
const helpMessage = `Please use "${alternative}" instead of.`
77

8+
// eslint-disable-next-line no-console
89
console.warn(`${mainMessage} ${alternative ? helpMessage : ''}`)
910

1011
return value.apply(this, arguments)

src/request/request.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const sendRequest = config => {
99
//--TODO remove this checking when we get rid of all sync methods
1010
if (config.isAsync === false || !config.asyncHandler) {
1111
if (LocalVars.XMLHttpRequest) {
12+
// eslint-disable-next-line no-console
1213
console.warn(
1314
'The sync methods of the Backendless API are deprecated and will be removed in the nearest future.\n' +
1415
'Please, use async methods instead.'

src/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ const Utils = {
165165

166166
synchronized(method) {
167167
return function() {
168+
// eslint-disable-next-line no-console
168169
console.warn('Using of sync methods is an outdated approach. Please, use async methods.')
169170

170171
const context = this

0 commit comments

Comments
 (0)