You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

eslint-config-problems

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-problems

An eslint config that catches problems in your code, without checking style. For use with prettier.

9.0.0
latest
Source
npmnpm
Version published
Weekly downloads
18K
18.47%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-problems

eslint-config-problems is an ESLint config that doesn't regulate your code style. It only catches actual problems with your code.

It's designed for use with Prettier, the opinionated code formatter.

Contents

Rules

Rules were chosen based on the following criteria:

  • No stylistic rules; nothing that Prettier can fix
  • Prevent guaranteed runtime errors (i.e. no undefined variables)
  • Disallow "evil" things like eval
  • Disallow archaic language features like with
  • Disallow obvious bad practices like new Number(13)
  • Force usage of ES2015+ features
  • Point out places the code could be made shorter. For example:
    if (someCondition) return someValue;
    else {
      // Do something else
    }
    
    The else block is unneeded, since the if block contains a return statement. eslint-config-problems will point this out to you (or auto-fix with the --fix option).

I disagree with rule X; you missed rule Y

If you disagree; feel free to open an issue. I'm open to changing rules if you have a good reason.

If I missed a rule that prevents an actual problem or is otherwise in keeping with the general guidelines above, please open an issue as well; I just might add it.

Installation & Usage

eslint-config-problems is designed to work with ESLint v9+; if you're still using ESLint v8 or earlier, use eslint-config-problems v8.0.0.

npm install -D eslint eslint-config-problems

In your eslint.config.js:

import problems from 'eslint-config-problems';

export default [
  problems,
  {
    rules: {
      // custom rules
    },
  },
];

License

ISC

Keywords

eslint

FAQs

Package last updated on 25 Jan 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.