endo icon indicating copy to clipboard operation
endo copied to clipboard

Error or warn on type declaring global vars if type only

Open leotm opened this issue 6 months ago • 3 comments

What is the Problem Being Solved?

Ref: https://github.com/endojs/endo/pull/2845

Disallow type declaring global vars that are only types

Error or warn with linting

Description of the Design

ESLint rule, use previous one or create plugin

Security Considerations

None

Scaling Considerations

Test Plan

ESLint

Compatibility Considerations

Upgrade Considerations

leotm avatar Jun 07 '25 12:06 leotm

We do need the ability to declare some global vars for shims that install such globals, no ?

mhofman avatar Jun 09 '25 19:06 mhofman

yes harden/repairIntrinsics/hardenIntrinsics/lockdown/assert/Compartment are ok since src files (shims) install them as globals

but i mistakenly added https://github.com/endojs/endo/pull/2845 which could have been prevented with an eslint rule? called e.g.

  • @endo/require-global-assignment
  • @endo/no-unassigned-global-declarations
  • @endo/enforce-global-runtime-binding
  • @endo/global-declaration-assignment
  • @endo/no-orphaned-global-declarations
  • @endo/no-phantom-globals

leotm avatar Jun 10 '25 14:06 leotm

if more effort than worth then may not be worth the bother

leotm avatar Jun 10 '25 14:06 leotm