Skip to content

[JS] Remaining JS rules test#9

Open
trolit wants to merge 1 commit intomainfrom
feature/remaining-js-rules-test
Open

[JS] Remaining JS rules test#9
trolit wants to merge 1 commit intomainfrom
feature/remaining-js-rules-test

Conversation

@trolit
Copy link
Owner

@trolit trolit commented Jul 31, 2022

No description provided.

Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
Repository owner deleted a comment from patchron bot Jul 31, 2022
}

function test2() {
this.helpers.doSomething().then((rules) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, stick to await asynchronous pattern in the project.


let index = 0;

while (index < data.length) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that length property is initialized in condition statement. Please initialize it before loop.


do {
index++;
} while (index < data.length);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, remove extension from marked require.

@@ -0,0 +1,29 @@
const test = false;

if (test === true) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, simplify marked code.

value === true, value !== false -> value
value === false, value !== true -> !value


const test2 = null;

if (test2 === null) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, simplify marked code.

value === null/undefined -> !value
value !== null/undefined -> !!value, value


const result = -1;

if (result !== -1) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, simplify marked code.

value !== -1 -> ~value

@@ -0,0 +1,14 @@
const a = {
test1: test1,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that there is redundant value assignment (assigned value has the same name as key) 🤔

test1: test1,
b: 5,
c: 15,
test15: test15
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that there is redundant value assignment (assigned value has the same name as key) 🤔

test15: test15
};

const b = { a: 15, b: b };
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 };
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 } } };
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 } } } };
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that there is redundant value assignment (assigned value has the same name as key) 🤔

@patchron
Copy link

patchron bot commented Jul 31, 2022

pull request review completed

💬 18 comment(s) require attention.
🔨 1 commit(s)
➕ 99 additions
➖ 0 deletions
➗ 6 changed files

@trolit trolit force-pushed the main branch 3 times, most recently from 459394f to d8a500d Compare September 2, 2022 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant