endojs / Jessie

Tiny subset of JavaScript for ocap-safe universal mobile code
Apache License 2.0
279 stars 16 forks source link

feat(eslint-plugin): accept the syntax currently allowed at Agoric #60

Closed michaelfig closed 3 years ago

michaelfig commented 3 years ago

The most major addition to the @jessie.js/eslint-plugin is to enable async functions and properly lint the use of await. The rules allow for:

  1. await expression statements at the top level of an async function (either the topmost block or the only expression, if an arrow function).
  2. SOMETHING = await somethingElse; statements at the function's topmost block or expression.
  3. no other use of await.

The other changes should be fairly self-explanatory. They were determined by examining the Jessica grammars for Jessie, driven by @dckc's Agoric/documentation#540.