Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
eslint-plugin-lodash3
Advanced tools
Changelog
19 January 2016
#19
6a2015f
9bca10c
9abe03e
Readme
Lodash3 specific linting rules for ESLint
Install ESLint either locally or globally.
npm install eslint
If you installed ESLint
globally, you have to install lodash3 plugin globally too. Otherwise, install it locally.
$ npm install eslint-plugin-lodash3
Add plugins
section and specify ESLint-plugin-lodash3 as a plugin.
{
"plugins": ["lodash3"]
}
Finally, enable all of the rules that you would like to use.
{
"rules": {
"lodash3/prop-shorthand": 2,
"lodash3/matches-shorthand": [2, "always", 3],
"lodash3/matches-prop-shorthand": [2, "always"],
"lodash3/prefer-chain": [2, 3],
"lodash3/preferred-alias": 2,
"lodash3/no-single-chain": 2,
"lodash3/prefer-reject": [2, 3],
"lodash3/prefer-filter": [2, 3],
"lodash3/no-unnecessary-bind": 2,
"lodash3/unwrap": 2,
"lodash3/prefer-compact": 2,
"lodash3/no-double-unwrap": 2,
"lodash3/prefer-map": 2,
"lodash3/prefer-wrapper-method": 2,
"lodash3/prefer-invoke": 2,
"lodash3/prefer-thru": 2,
"lodash3/prefer-lodash-chain": 2,
"lodash3/prefer-lodash-method": 2,
"lodash3/prefer-lodash-typecheck": 2,
"lodash3/no-commit": 2,
"lodash3/prefer-get": [2, 3],
"lodash3/collection-return": 2,
"lodash3/prefer-matches": [2, 3],
"lodash3/prefer-times": 2,
"lodash3/prefer-startswith": 2,
"lodash3/prefer-noop": 2,
"lodash3/prefer-constant": 2,
"lodash3/chain-style": [2, "as-needed"]
}
}
_(x).map().value()
_.reject
over filter with !(expression)
or x.prop1 !== value
_.filter
over _.forEach
with an if
statement inside.thisArg
over binding.value()
or non-chainable methods like max()
.,_.compact
over _.filter
for only truthy values..value()
on chains that have already ended (e.g. with max()
or reduce()
)_.map
over _.forEach
with a push
inside._(str).split(' ')...
_.invoke
over _.map
with a method call inside._.prototype.thru
in the chain and not call functions in the initial value, e.g. _(x).thru(f).map(g)...
_.map
) over native and mixed chains._.map
) over native array methods._.is*
methods over typeof
and instanceof
checks when applicable..commit()
on chains that should end with .value()
_.get
or _.has
over expression chains like a && a.b && a.b.c
.forEach
._.matches
over conditions like a.foo === 1 && a.bar === 2 && a.baz === 3
._.times
over _.map
without using the iteratee's arguments._.startsWith
over a.indexOf(b) === 0
._.noop
over empty functions._.constant
over functions returning literals.ESLint-plugin-lodash3 is licensed under the MIT License.
FAQs
Lodash specific linting rules for ESLint
The npm package eslint-plugin-lodash3 receives a total of 29 weekly downloads. As such, eslint-plugin-lodash3 popularity was classified as not popular.
We found that eslint-plugin-lodash3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.