palantir/blueprint

Dynamic imports false positive on class-constants ESLint rule

Open

#6209 aperta il 7 giu 2023

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)TypeScript (2167 fork)batch import
Domain: toolingP2Type: bughelp wanted

Metriche repository

Star
 (20.263 star)
Metriche merge PR
 (Merge medio 43g 10h) (27 PR mergiate in 30 g)

Descrizione

Normal imports don't seem to be impacted by this, though dynamic imports are. Packages imported dynamically that include pt in their name seem to trigger an ESLint rule related to Blueprint.

root@______ # ./gradlew :subproject:eslint

> Task :subproject:eslint
error: use Blueprint `Classes` constant instead of string literal (@blueprintjs/classes-constants) at <redacted_filename>:

  49 | 
> 50 |         const { compileTypeScript } = await import("@example/pt-typescript");
     |                                                    ^

1 error found.
1 error potentially fixable with the `--fix` option.

> Task :subproject:eslint FAILED

FAILURE: Build failed with an exception.```

Guida contributor