[JS] Remaining JS rules test - #9
Conversation
| } | ||
|
|
||
| function test2() { | ||
| this.helpers.doSomething().then((rules) => { |
There was a problem hiding this comment.
Please, stick to await asynchronous pattern in the project.
|
|
||
| let index = 0; | ||
|
|
||
| while (index < data.length) { |
There was a problem hiding this comment.
It seems that length property is initialized in condition statement. Please initialize it before loop.
|
|
||
| do { | ||
| index++; | ||
| } while (index < data.length); |
There was a problem hiding this comment.
It seems that length property is initialized in condition statement. Please initialize it before loop.
| import helpers1 from '@/helpers/index'; | ||
| import helpers2 from '@/helpers'; | ||
|
|
||
| const helpers3 = require('@/helpers/index'); |
There was a problem hiding this comment.
Please do not reference file named index explicitly in require.
| import test1 from '@/helpers/test1.js'; | ||
| import test2 from '@/helpers/test2'; | ||
|
|
||
| const test3 = require('@/helpers/test3.js'); |
There was a problem hiding this comment.
Please, remove extension from marked require.
| @@ -0,0 +1,29 @@ | |||
| const test = false; | |||
|
|
|||
| if (test === true) { | |||
There was a problem hiding this comment.
Please, simplify marked code.
value === true, value !== false -> value
value === false, value !== true -> !value
|
|
||
| const test2 = null; | ||
|
|
||
| if (test2 === null) { |
There was a problem hiding this comment.
Please, simplify marked code.
value === null/undefined -> !value
value !== null/undefined -> !!value, value
|
|
||
| const result = -1; | ||
|
|
||
| if (result !== -1) { |
There was a problem hiding this comment.
Please, simplify marked code.
value !== -1 -> ~value
| @@ -0,0 +1,14 @@ | |||
| const a = { | |||
| test1: test1, | |||
There was a problem hiding this comment.
It seems that there is redundant value assignment (assigned value has the same name as key) 🤔
| test1: test1, | ||
| b: 5, | ||
| c: 15, | ||
| test15: test15 |
There was a problem hiding this comment.
It seems that there is redundant value assignment (assigned value has the same name as key) 🤔
| test15: test15 | ||
| }; | ||
|
|
||
| const b = { a: 15, b: b }; |
There was a problem hiding this comment.
It seems that there is redundant value assignment (assigned value has the same name as key) 🤔
|
|
||
| const b = { a: 15, b: b }; | ||
|
|
||
| const c = { test13: test13 }; |
There was a problem hiding this comment.
It seems that there is redundant value assignment (assigned value has the same name as key) 🤔
|
|
||
| const c = { test13: test13 }; | ||
|
|
||
| const d = { result: { test: { a: a } } }; |
There was a problem hiding this comment.
It seems that there is redundant value assignment (assigned value has the same name as key) 🤔
|
|
||
| const d = { result: { test: { a: a } } }; | ||
|
|
||
| const e = { result: { comments: { summary: { total: total } } } }; |
There was a problem hiding this comment.
It seems that there is redundant value assignment (assigned value has the same name as key) 🤔
|
pull request review completed 💬 18 comment(s) require attention. |
459394f to
d8a500d
Compare
No description provided.