ni / javascript-styleguide

JavaScript and TypeScript Style Guide
MIT License
9 stars 9 forks source link

Disable some rules in Angular tests #67

Closed jattasNI closed 2 years ago

jattasNI commented 2 years ago

Rationale

In at least two repos we've disabled use-component-selector in test specs. This seems like a common pattern so @rajsite proposed sharing this configuration across all repos.

We also recommended manually disabling no-floating-promises and unbound-method because of jasminewd2 and it would be preferable to avoid that manual step.

Implementation

  1. Modify our Angular eslint configuration to have an override which disables this use-component-selector in all *.spec.ts files.
  2. Add a new config @eslint-config-angular/requiring-type-checking. This was needed to disable no-floating-promises and unbound-method since they were set in @eslint-config-typescript/requiring-type-checking (which has higher precedence than the base Angular config, so overriding those rules for tests in the base config would have no effect)
  3. Updated docs