-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style(eslint-config): allow globals that SES makes powerless #1071
Conversation
// Allow what SES makes powerless, copied from its whitelist | ||
// *** Constructor Properties of the Global Object |
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.
JS comments in a JSON file? If this is read by something other than a JSON parser, note that at the top, maybe?
I wonder about maintenance... is it straightforward to add a test that fails if this list and the SES whitelist get out of sync? |
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.
I too am a JSON comments skeptic. Perhaps we can describe the design choices in README.md. Looks good when lint is green.
This is a good idea. A SES test could import this JSON and the permits to raise any discrepancies. I believe our expectation is for eslint to include everything that’s permitted in SES. We also should permit things that are not present in SES since Endo adds them, like the text encoder, URL, and HandledPromise. I’m comfortable with our Base64 hack being left out since that should only be used in a few places. |
Config comments I also prefer not to put comments in
I'd be happy to follow up with a PR to change the config format to YAML. Maintenance of the sync between esilnt config and the SES whitelist I agree it's a good idea. I see it as out of scope for this change and something that could be prioritized, though I don't anticipate it being a high priority because the list changes very rarely and the consequences for it getting out of sync are very small. |
Though YAML is awful, I’m okay with YAML for this purpose. @michaelfig is also a stake-holder in that decision. |
As long as I'm not maintaining it, I don't have a preference. |
YAML conversion PR ^ While looking for examples of ESLint configs, I noticed ESlint projects defines globals like this https://github.com/eslint/eslint/blob/main/conf/globals.js Also with Lerna on this monorepo we have a build step so maybe building the whitelist from SES wouldn't be as much work as I thought. Still putting this down for now. :) |
The @Endo lint config was unnecessarily conservative in what globals it allowed. One effect was requiring code adopting this config to manually opt into safe globals such as
BigUint64Array
(example).All of the SES whitelist of powerless globals are safe to use so this adds them all to the eslint config.