Skip to content

[JS] Remaining JS rules test - #9

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

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

Conversation

@trolit

@trolit trolit commented Jul 31, 2022

Copy link
Copy Markdown
Owner

No description provided.

Comment thread importWithoutExtensionRule.js
Comment thread simplePropertyAssignmentRule.js
Comment thread simplePropertyAssignmentRule.js
Comment thread simplePropertyAssignmentRule.js
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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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.

Comment thread implicitIndexFileImportRule.js
Comment thread implicitIndexFileImportRule.js
import helpers1 from '@/helpers/index';
import helpers2 from '@/helpers';

const helpers3 = require('@/helpers/index');

Copy link
Copy Markdown

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.

Comment thread importWithoutExtensionRule.js
Comment thread importWithoutExtensionRule.js
import test1 from '@/helpers/test1.js';
import test2 from '@/helpers/test2';

const test3 = require('@/helpers/test3.js');

Copy link
Copy Markdown

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.

Comment thread simpleComparisionRule.js
@@ -0,0 +1,29 @@
const test = false;

if (test === true) {

Copy link
Copy Markdown

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

Comment thread simpleComparisionRule.js

const test2 = null;

if (test2 === null) {

Copy link
Copy Markdown

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

Comment thread simpleComparisionRule.js

const result = -1;

if (result !== -1) {

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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

patchron Bot commented Jul 31, 2022

Copy link
Copy Markdown

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