Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-fp

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-fp

ESLint rules for functional programming

  • 2.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is eslint-plugin-fp?

eslint-plugin-fp is an ESLint plugin that enforces functional programming best practices. It helps developers write more predictable and maintainable code by avoiding side effects, mutations, and other non-functional programming patterns.

What are eslint-plugin-fp's main functionalities?

No Mutating Methods

This rule disallows the use of mutating array methods like push, pop, shift, unshift, etc., to encourage the use of immutable operations.

/* eslint fp/no-mutating-methods: 'error' */
const arr = [1, 2, 3];
arr.push(4); // This will trigger an ESLint error

No Mutating Assign

This rule prevents the mutation of object properties, promoting the use of immutable data structures.

/* eslint fp/no-mutation: 'error' */
let obj = { a: 1 };
obj.a = 2; // This will trigger an ESLint error

No Let

This rule disallows the use of `let` and `var` to encourage the use of `const` for variable declarations, promoting immutability.

/* eslint fp/no-let: 'error' */
let x = 1; // This will trigger an ESLint error

No This

This rule disallows the use of `this` to avoid issues related to context and state, encouraging the use of pure functions.

/* eslint fp/no-this: 'error' */
class MyClass {
  constructor() {
    this.value = 1; // This will trigger an ESLint error
  }
}

Other packages similar to eslint-plugin-fp

Keywords

FAQs

Package last updated on 01 Jan 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc