-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(eslint-plugin): accept the syntax currently allowed at Agoric #60
Conversation
cb2c08c
to
43a0b96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, though I haven't tested it.
create(context) { | ||
return { | ||
AwaitExpression: node => { | ||
// As a hint to future readers, I used the following ASTExplorer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for leaving breadcrumbs :)
selector: `ArrowFunctionExpression[async=true]`, | ||
message: `async functions are ${nono}`, | ||
selector: `FunctionExpression[generator=true]`, | ||
message: `generators are ${nono}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have library function alternatives to generators?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In progress. It takes some explanation, though, so I'm not sure yet what to put in the linting failure.
The most major addition to the
@jessie.js/eslint-plugin
is to enableasync
functions and properly lint the use ofawait
. The rules allow for:await
expression statements at the top level of anasync
function (either the topmost block or the only expression, if an arrow function).SOMETHING = await somethingElse;
statements at the function's topmost block or expression.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.