eslint / eslint

Find and fix problems in your JavaScript code.
https://eslint.org
MIT License
24.39k stars 4.4k forks source link

fix: do not throw when defining a global named __defineSetter__ #18364

Closed aladdin-add closed 3 weeks ago

aladdin-add commented 1 month ago

It replaced {} with Object.create(null) to avoid accessing properties on the Object prototype.

fixes #18363

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update [ x] Bug fix (template) [ ] New rule (template) [ ] Changes an existing rule (template) [ ] Add autofix to a rule [ ] Add a CLI option [ ] Add something to the core [ ] Other, please explain:

What changes did you make? (Give an overview)

Is there anything you'd like reviewers to focus on?

Not sure if I should write a test for eslintrc as well: it's deprecated and will eventually be removed.

netlify[bot] commented 1 month ago

Deploy Preview for docs-eslint ready!

Name Link
Latest commit 6fd6f4b45d23e1c6f90966a19e2ab8872bf06a39
Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/6625cbd2dc2b220008cc9bd7
Deploy Preview https://deploy-preview-18364--docs-eslint.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

aladdin-add commented 4 weeks ago

marking as draft, as I want to refactor the tests, and add a few more tests later.