question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What rules do the community tend to override?

See original GitHub issue

I’m opening this issue specifically to gather a list of the rules that those in the community feel are controversial or problematic, such that they override them, and most importantly, why.

This is not an invitation for “+1s” (those belong as reactions on individual posts), or an invitation to hear about everyone’s subjective aesthetic preferences, nor is it an indication that any of these rules necessarily will - or will not - change. I’m simply hoping to primarily gather civil, well-reasoned explanations for why certain rules are overridden, disabled, etc.

Any comments mentioning spaces vs tabs, or semicolons, will be summarily deleted 😃

We’re aware of the following:

  • react/jsx-filename-extension - filed as #985. Why is it controversial? Some believe that .js files should be allowed to contain JSX. Others believe this is an app-level concern, and does not belong in a shared config (like “env” settings).
  • import/no-extraneous-dependencies: in test directories, for example, it needs to be overridden to the following (note: if/when eslint allows glob-based config, then we’d set up some common test directory patterns so you wouldn’t have to do this manually) eslint-config-airbnb v13.0.0 is now released, which resolves this.
  "import/no-extraneous-dependencies": ["error", {
    "devDependencies": true,
    "optionalDependencies": false,
  }],
  • camelcase: when you’re bound to the casing selected by APIs (https://github.com/airbnb/javascript/issues/1089#issuecomment-249396262, but Airbnb suffers from this too) This might also apply to new-cap and no-underscore-dangle.
  • no-param-reassign: this happens frequently with a reduce where the entire operation is pure, but the reducer is not (ie, it mutates the accumulator, but the accumulator began as {} passed into the reducer). You can use Object.assign({}, accumulator, changes), or { ...accumulator, ...changes }, however. (per https://github.com/airbnb/javascript/issues/1089#issuecomment-249396262)
  • no-use-before-define: some enjoy using hoisting to define helper methods at the bottom of the file. This guide discourages relying on hoisting; instead suggesting importing the helpers from another file when possible. (per https://github.com/airbnb/javascript/issues/1089#issuecomment-249396262)
  • no-mixed-operators - specifically where it relates to arithmetic operators, where the PEMDAS rule applies. We’re definitely considering loosening this rule as it applies to *, /, +, and -.

Any others? I’ll update the original post with new examples as I’m made aware of them.

(Note: this does not cover env settings, like “browser”, “node”, “mocha”, etc - these are app-level concerns, and as such, your .eslintrc, tests/.eslintrc, etc should be defining them)

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:17
  • Comments:143 (22 by maintainers)

github_iconTop GitHub Comments

67reactions
jonathanongcommented, Sep 25, 2016
  • arrow-body-style or whatever, because it makes converting regular functions to arrow functions difficult as it’s not fixed automatically.
  • camelcase - because many times i’m bound by other APIs
  • no-param-reassign - makes working with koa/express/node.js difficult
  • no-plusplus - because i += 1 is annoying
  • prefer-template - because it isn’t convenient 5% of the time
  • consistent-return - annoying with early returns
  • new-cap - bound by other APIs
  • no-underscore-dangle - disallows “private” properties. bound by mongodb.
  • no-use-before-define - disallows function declarations at the bottom
26reactions
chadwatsoncommented, Sep 25, 2016

no-use-before-define for functions. I personally don’t like to scroll down to the bottom of a file to see what a module really does. It’s inevitable that for some modules it just makes sense to leave the helper functions in the same file. I prefer to see the declarative stuff first instead of having to scroll through the imperative stuff first.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mores, Law and Morality
Law- rules which are enforced by society. Violations may bring a loss of or reduction in freedom and possessions.
Read more >
What Are Unenforceable HOA Rules? What To Do About Them?
Simply put, HOA rules are rules that members of an HOA community must follow. These rules exist to regulate members' behavior within the...
Read more >
Who draws the lines? - All About Redistricting
State legislatures​​ And usually, these bills are subject to a veto by the Governor (and, potentially, override by the legislators: override thresholds range ......
Read more >
Community Input Is Bad, Actually - The Atlantic
The downsides of new development tend to be very localized: loud noises from construction, or an obscured view. As a result, opponents can...
Read more >
Introduction to Organizing - COMM-ORG
The Ten Rules of Community Organizing ... There are four fundamental strategies available to neighborhood groups to address community problems: community ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found