Skip to content

Add named-function-expressions-instead-of-function-declarations#4

Open
masihjahangiri wants to merge 1 commit intoamirhossein693:masterfrom
masihjahangiri:patch-1
Open

Add named-function-expressions-instead-of-function-declarations#4
masihjahangiri wants to merge 1 commit intoamirhossein693:masterfrom
masihjahangiri:patch-1

Conversation

@masihjahangiri
Copy link

No description provided.

Copy link
Owner

@amirhossein693 amirhossein693 left a comment

Choose a reason for hiding this comment

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

And last comment :d
Please add your items at the end of array.
Thank you

title: 'w3schools',
url: 'https://w3schools.com/',
},
],
Copy link
Owner

Choose a reason for hiding this comment

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

Please remove all trailing commas (comma-dangle)
https://eslint.org/docs/rules/comma-dangle

title: 'Use named function expressions instead of function declarations',
slug: 'named-function-expressions-instead-of-function-declarations',
description:
'Why? Function declarations are hoisted, which means that it’s easy - too easy - to reference the function before it is defined in the file. This harms readability and maintainability. If you find that a function’s definition is large or complex enough that it is interfering with understanding the rest of the file, then perhaps it’s time to extract it to its own module! Don’t forget to explicitly name the expression, regardless of whether or not the name is inferred from the containing variable (which is often the case in modern browsers or when using compilers such as Babel). This eliminates any assumptions made about the Error’s call stack.',
Copy link
Owner

Choose a reason for hiding this comment

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

Description are to long, It needs a TLDR alternative.
We want to show a quick description. more info can be found in the reference link.
Thanks

description: `When executing lengthy "for" statements, don't make the engine work any harder than it must`,
codes: [
`for(var i = 0; i < someArray.length; i++) {
`for(var i = 0; i < someArray.length; i++) {
Copy link
Owner

Choose a reason for hiding this comment

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

Please remove this space
It cause some issues in html pre tag

'1 === "1";',
'1 === true;'
]
codes: ['0 === "";', '1 === "1";', '1 === true;'],
Copy link
Owner

Choose a reason for hiding this comment

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

Please do not change this lines
It cause some issues in html pre tag

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.

2 participants