Interesting Bugs Caught by ESLint's no-constant-binary-expression

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • eslint-plugin-react

    React-specific linting rules for ESLint

  • This is pretty compelling. Why isn't it in the "recommended" preset of lints?

    In general, I find it frustrating that the eslint recommended presets don't document why they are recommended. I disable several of the rules in all my projects because they seem to be arbitrary stylistic choices (e.g. [0], [1], [2]).

    [0] https://typescript-eslint.io/rules/no-empty-function/

    [1] https://github.com/jsx-eslint/eslint-plugin-react/blob/maste...

    [2] Specifically checkLoops of https://eslint.org/docs/latest/rules/no-constant-condition

  • ESLint

    Find and fix problems in your JavaScript code.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • vscode

    Visual Studio Code (by captbaritone)

  • This is the approach I take as well. But it's not necessarily best of both worlds. Removing (or not inserting) technically useless parens can obscure bugs if you are not perfectly fluent in the precedence rules of the language. Their doubly easy to miss if there's a lot going on on one line.

    Here's one example that the rule caught: https://github.com/captbaritone/vscode/blob/ab86e0229d6b4d0c...

    I've been writing JS for over 10 years now, and I'm not sure I would have caught that in code review.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts