
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
eslint-config-fp
Advanced tools
ESLint configuration combining Standard JavaScript, Prettier and functional programming
ESLint is a code linter for JavaScript.
This configuration combines:
npm install -D eslint-config-fp eslint@^5.6.0 eslint-config-prettier@^3.0.1 eslint-config-standard@^12.0.0 eslint-import-resolver-node@^0.3.2 eslint-plugin-eslint-comments@^3.0.1 eslint-plugin-filenames@^1.3.2 eslint-plugin-fp@^2.3.0 eslint-plugin-html@^5.0.0-alpha.0 eslint-plugin-import@^2.14.0 eslint-plugin-markdown@^1.0.0-beta.8 eslint-plugin-node@^7.0.1 eslint-plugin-promise@^4.0.1 eslint-plugin-standard@^4.0.0 eslint-plugin-unicorn@^6.0.1 eslint-plugin-you-dont-need-lodash-underscore@^6.4.0 prettier@^1.14.3
Then in your .eslintrc.json
:
{
"extends": "eslint-config-fp"
}
The configuration is very opinionated but you can override specific rules in
your .eslintrc.json
to fit your needs and coding style.
Then create a symlink to the Prettier configuration and .editorconfig
in your
project:
ln -sf node_modules/eslint-config-fp/.prettierrc.yml node_modules/eslint-config-fp/.editorconfig .
The following badge can be added to your project:
[](https://github.com/autoquality/eslint-config-fp)
prettier
must be run before eslint
to avoid conflicts.
We recommend using first prettier --write
then eslint --fix --cache
.
Do not forget to add .eslintcache
to your .gitignore
file.
This enforces that state is never directly mutated and global state is not referenced:
module
or
Object
) unless they are Node-specific (e.g. process
) or should be wrapped
(e.g. console
).for
, while
, switch
) are forbidden as they imply state.
Instead functional methods (like Array.map()
and Array.filter()
),
recursion and small if
blocks (with
early returns) can be used.However throwing exceptions are allowed as this can simplify code.
The following rules are enforced to encourage splitting your code into small modules and functions:
require
/import
){ ...object }
instead of Object.assign({}, ...object)
funcName(...args)
instead of
funcName.call(this, ...args)
function(...args)
instead of function(arguments)
async
/await
instead of explicit promises or callbacks.**
instead of Math.pow()
package.json
engines
field.The configuration is very explicit and enforces strict linting. This should help you find bugs and maintain a consistent coding style.
This includes:
use strict
u
flagindex.js
files and require('./dir')
instead of
require('./dir/subdir')
const funcName = function() { ... }
error
eslint-plugin-html and eslint-plugin-markdown are included so you can lint JavaScript inside HTML or Markdown files.
Feel free to submit an issue or PR to add your project to the list above!
FAQs
ESLint configuration combining Standard JavaScript, Prettier and functional programming
We found that eslint-config-fp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.