Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify rule s4144: Add exception for identical functions. #1151

Merged
merged 3 commits into from
Aug 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion rules/S4144/javascript/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,18 @@ function getName() {

== Exceptions

Functions with fewer than 3 lines are ignored.
* Functions with fewer than 3 lines are ignored.

* This rule does not apply to function expressions and arrow functions because they don't have explicit names and are often used in a way where refactoring is not applicable.

[source,javascript]
----
list.map((item) => ({
name: item.name,
address: item.address,
country: item.country
}));
----

ifdef::env-github,rspecator-view[]

Expand Down