Package detail

eslint-config-groupon

groupon96BSD-3-Clause11.1.0

ESLint configuration used by Groupon

readme

nlm-github nlm-node nlm-version

JavaScript at Groupon

This repository contains tools & guidelines for using JavaScript at Groupon. It represents the best effort to capture the current practices.

Writing NPM Packages

ES5 or ES2021?

For client-side code we depend on babel-preset-env to ensure that both application- and library code is compiled down to whatever our targeted browsers support.

Versioning and Publishing

We use nlm to manage our libraries. This ensures that:

  1. Every library has a usable CHANGELOG.md file as part of its git history.
  2. Releases are never tied to a single person.
  3. We can easily share best practices across projects.

Groupon JavaScript Style Guide

Fortunately there already is a great and well-documented style guide for JavaScript over at airbnb/javascript. It definitely is worth a read and in many ways we're staying fairly close to it.

There's some important differences that are mostly around our focus on sticking to features natively supported by Node where possible, and a higher bar for rules that don't support --fix: If a rule isn't clearly preventing bugs, it has to support --fix to be enabled.

Additionally, our file naming convention is kabab-case. File names should be entirely in lowercase to avoid any renaming issues with file systems.

Regarding code organization, we generally structure code by domain, not by layer (todos/model.js instead of models/todo.js).

To ensure good automation support, we're also dropping any rules that conflict with prettier's formatting.

The Longer Answer

We split our rules into three categories:

  • Mistakes: Things that should only appear because the developer made a mistake, 99% of the time. If these errors aren't fixed, we wouldn't expect the program to work correctly. This is the only category where we allow "error" even for rules that don't support --fix.
  • Conventions: Points out patterns that we believe could lead to confusion or maintenance issues down the line. If a rule isn't fixable, there should be a high bar for it to be enabled to not cause noise. Even if a rule is enabled, it may at most warn.
  • Opinions: Things that are arbitrary choices. Most whitespace and formatting rules fall into this category. Everything in here must support --fix and shouldn't require human intervention.

Groupon TypeScript Style Guide

You may have your .eslintrc extend groupon/typescript to get a set of configs based on our JavaScript lint configs, but with tweaks to work better with TypeScript (parsing, defaults, etc.).

changelog

v11.1.0 (2022-04-01)

🏡 Internal

v11.0.6 (2022-03-16)

🏡 Internal

v11.0.5 (2022-02-02)

🏡 Internal

v11.0.4 (2022-02-02)

🏡 Internal

v11.0.3 (2021-11-22)

🏡 Internal

v11.0.2 (2021-11-08)

🐛 Bug Fixes

  • 3bc4a85 fix: wrong typescript peerDep

v11.0.1 (2021-11-08)

🏡 Internal

  • #55 modify ts lint rules to coexist better with js (@dbushong)

v11.0.0 (2021-11-05)

💥 Breaking Changes

#54 upgrades and typescript (@dbushong)

requires bumping eslint-plugin-prettier to ^4

🏡 Internal

v10.0.5 (2021-08-16)

🔼 Dependencies

v10.0.4 (2021-06-04)

🔼 Dependencies

🏡 Internal

v10.0.3 (2021-03-26)

🏡 Internal

10.0.2 - 2021-02-17

10.0.1 - 2020-07-20

10.0.0 - 2020-05-12

Breaking Changes

See: f4373ab

Commits

  • refactor: upgrade to eslint 7.x & drop Node 8 support - @aaarichter #45
    • f4373ab refactor: upgrade to Eslint 7.x & drop Node 8 support
    • 7f3cbde refactor: use assert instead of assertive

9.0.0

Breaking Changes

requires prettier 2.x peerDep and will result in a lot of style changes around chained method invocations

See: 6c004e6

Commits

8.1.1

8.1.0

  • feat: update rules & packages - @aaarichter #42
    • 44bdfaf chore: update / upgrade packages
    • af4f8c3 feat: add no-self-assign rule
    • c896339 fix: set 8.5.0 as min required node version & adjust example

8.0.1

8.0.0

Breaking Changes

/nodeN entrypoints are gone; you must specify a engines.node section in your package.json; new defaults as specified by adding extends: plugin:node/recommended; dropped support for node 6 and node 4 and es5

See: a207b40

Commits

  • Complete refactor + Node 12.x (and beyond) support - @dbushong #40
    • 20ce479 chore: update the peerDeps
    • 02a5a35 chore: check in package-lock
    • 16297a4 chore: upgrade pkgs & builds
    • a207b40 feat: support all versions automatically
    • 6d3fd0f fix: tweak default node/* settings
    • 55315c9 test: add negative test for node supported

7.2.1

7.2.0

7.1.0

  • add object-shorthand as fixable error - @dbushong #35
    • e7a0496 feat: add object-shorthand as fixable error

7.0.0

Breaking Changes

This config now builds on top of ESLint 5. This also affects other peerDependencies like certain plugins.

See: 986105d

Commits

6.1.1

  • consistent-return: allow implicit undefined - @dbushong #31
    • 21b9ac3 fix: consistent-return: allow implicit undefined

6.1.0

6.0.0

Breaking Changes

adds eslint-plugin-mocha as a peerDep

See: 897dbb0

Commits

5.4.2

  • docs: update file naming and organization - Closes #7 - @markowsiak #28
    • 6593962 docs: update filenaming and organization - Closes #7 - see: #7

5.4.1

5.4.0

  • resurrect prefer-arrow-callback - @dbushong #26
    • 7de330c feat: resurrect prefer-arrow-callback

5.3.0

  • apply === rule with null expection - @dbushong #25
    • c727390 feat: apply === rule with null expection

5.2.1

5.2.0

  • resurrect no-console as error - @dbushong #23
    • f66914e feat: resurrect no-console as error
    • 57a5ff9 chore: add nvmrc for node8 dev compliance

5.1.1

  • fix: set prefer-template to off for es5 - @markowsiak #22
    • fb601e6 fix: set prefer-template to off for es5

5.1.0

  • feat: support object spread and mjs - @jkrems #21
    • 344fe64 feat: support object spread and mjs

5.0.0

Breaking Changes

This switches our linting to an entirely new set of rules. For the most part we're trying to stay consistent with the old format to reduce churn but it explicitly is a departure.

See: 559c99f

Commits

  • Simplify package structure and decouple from Airbnb - @jkrems #20
    • 559c99f refactor: Drop dependency on lerna & airbnb
    • 98ce778 feat: Add prettier for node 6 config
    • 15b1ec6 feat: Bring back basic bug prevention rules
    • 5c3d500 fix: Use proper import syntax
    • f849bdc feat: Add import checks
    • 366813b fix: Add missing test file pattern
    • 94d539c refactor: Run tests on node 8
    • f898741 refactor: Reuse rule list
    • 1396cb1 test: Verify ES5 vs. ES6 behavior
    • 5eff6a0 test: Enable coffee tests
    • ef674e4 feat: Bring back style linting
    • c42aeb7 fix: Add more --fix test cases
    • f4d8eb6 test: Add test case of newline after import
    • f9cdaaf docs: Add links to opinion rules
    • ff1ddca fix: Remove console.log
    • 38d19d3 style: Self-lint with latest deps
    • 6dc9135 fix: Lint self for node 4
    • 74df77c docs: Update readme with updated overview
    • decdae0 docs: Elaborate on rule categories
    • b8c7123 chore: Include stylint config in package
    • 7951d90 feat: Port more airbnb rules
    • 7041f12 feat: Cover more variable conventions
    • 3a93a0c chore: Add nlm & license headers
    • 3a9e573 chore: Ignore package-lock.json since it's not stable
    • 2952567 chore: Rename and clean up dependencies
    • 64630f8 refactor: Back out coffee & stylus linting
    • 4d86376 chore: Apply latest generator
    • 4270b97 docs: Clarify our lack of compliance with airbnb