πŸ“… You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP β†’
Socket
Sign inDemoInstall
Socket

eslint-plugin-functional

Package Overview
Dependencies
Maintainers
0
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-functional

ESLint rules to promote functional programming in TypeScript.

9.0.1
latest
Source
npm
Version published
Weekly downloads
161K
-14.65%
Maintainers
0
Weekly downloads
Β 
Created

What is eslint-plugin-functional?

eslint-plugin-functional is an ESLint plugin that enforces functional programming best practices. It helps developers write code that is more predictable, easier to test, and less prone to bugs by discouraging side effects, mutable data, and other non-functional programming patterns.

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

No Mutations

This feature enforces immutability by disallowing the use of `let`, `this`, and `class`. This ensures that variables and data structures remain constant throughout the code.

module.exports = {
  rules: {
    'functional/no-let': 'error',
    'functional/no-this-expression': 'error',
    'functional/no-class': 'error'
  }
};

No Expressions with Side Effects

This feature prevents the use of expressions that produce side effects, such as assignments and conditionals. This helps in maintaining pure functions that are easier to test and reason about.

module.exports = {
  rules: {
    'functional/no-expression-statement': 'error',
    'functional/no-conditional-statement': 'error'
  }
};

No Loops

This feature disallows the use of loop statements like `for`, `while`, and `do-while`. Instead, it encourages the use of higher-order functions like `map`, `filter`, and `reduce` for iteration.

module.exports = {
  rules: {
    'functional/no-loop-statement': 'error'
  }
};

Other packages similar to eslint-plugin-functional

Keywords

eslint

FAQs

Package last updated on 24 Feb 2025

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