Skip to content

eslint.config.js hand-rolls the org's strictest ruleset instead of the shared preset #26

Description

@quotentiroler

Context

eslint.config.js builds a flat config from scratch: strictTypeChecked + stylisticTypeChecked, plus no-unnecessary-condition, no-non-null-assertion, no-floating-promises, no-misused-promises, require-await, and a no-restricted-syntax ban on TS enums. @max-health-inc/config/eslint/react is not used.

This is the strictest lint configuration in the org, and it is the one configuration no other repo can import.

The consequence is backwards. Apps consuming this package are linted by the shared preset, which enables neither strictTypeChecked nor no-unnecessary-condition nor no-non-null-assertion nor the enum ban. So this library holds itself to a materially higher standard than the code calling into it, and none of that rigor is reachable by consumers.

Ask

Two directions, either resolves it:

  1. Contribute upstream. Add the strict rules to @max-health-inc/config as a strict: true option on createReactConfig, then consume the preset here. Build configuration belongs in the config package, and this puts the strict rules within reach of every consumer that wants them.
  2. Export the rules. Keep the local config, but export the rule objects from this package so consumers can opt in.

(1) is preferable. It is also the only one of the two that stops this file from drifting away from the preset again.

Smaller divergence in the same file

no-console here allows warn and error. The shared preset also allows info. Whichever is right, it should be decided in one place; tracked from the config side in Max-Health-Inc/config#5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions