Closed epmatsw closed 3 weeks ago
https://eslint.org/play/#eyJ0ZXh0IjoiLypnbG9iYWwgX19kZWZpbmVTZXR0ZXJfXywgYSovXG5cbl9fZGVmaW5lU2V0dGVyX18gPSA0MjsiLCJvcHRpb25zIjp7InJ1bGVzIjp7Im5vLXVuZGVmIjpbImVycm9yIl19LCJsYW5ndWFnZU9wdGlvbnMiOnsicGFyc2VyT3B0aW9ucyI6eyJlY21hRmVhdHVyZXMiOnt9fX19fQ==
Default (Espree)
Defining a global named __defineSetter causes eslint to crash if done in an inline comment. It also seems not to work if done in a config file.
__defineSetter
/*global __defineSetter__, a*/ __defineSetter__ = 42;
It should treat __defineSetter__ as a valid global.
__defineSetter__
ESLint crashes. When specified in the globals object in a config rather than an inline comment, it doesn't crash but it also doesn't seem to respect the global.
globals
No response
Thanks for the report, I was able to repro!
Environment
https://eslint.org/play/#eyJ0ZXh0IjoiLypnbG9iYWwgX19kZWZpbmVTZXR0ZXJfXywgYSovXG5cbl9fZGVmaW5lU2V0dGVyX18gPSA0MjsiLCJvcHRpb25zIjp7InJ1bGVzIjp7Im5vLXVuZGVmIjpbImVycm9yIl19LCJsYW5ndWFnZU9wdGlvbnMiOnsicGFyc2VyT3B0aW9ucyI6eyJlY21hRmVhdHVyZXMiOnt9fX19fQ==
What parser are you using?
Default (Espree)
What did you do?
Defining a global named
__defineSetter
causes eslint to crash if done in an inline comment. It also seems not to work if done in a config file.https://eslint.org/play/#eyJ0ZXh0IjoiLypnbG9iYWwgX19kZWZpbmVTZXR0ZXJfXywgYSovXG5cbl9fZGVmaW5lU2V0dGVyX18gPSA0MjsiLCJvcHRpb25zIjp7InJ1bGVzIjp7Im5vLXVuZGVmIjpbImVycm9yIl19LCJsYW5ndWFnZU9wdGlvbnMiOnsicGFyc2VyT3B0aW9ucyI6eyJlY21hRmVhdHVyZXMiOnt9fX19fQ==
Configuration
``` export default [ { "rules": { "no-undef": [ "error" ] } } ]; ```What did you expect to happen?
It should treat
__defineSetter__
as a valid global.What actually happened?
ESLint crashes. When specified in the
globals
object in a config rather than an inline comment, it doesn't crash but it also doesn't seem to respect the global.Link to Minimal Reproducible Example
https://eslint.org/play/#eyJ0ZXh0IjoiLypnbG9iYWwgX19kZWZpbmVTZXR0ZXJfXywgYSovXG5cbl9fZGVmaW5lU2V0dGVyX18gPSA0MjsiLCJvcHRpb25zIjp7InJ1bGVzIjp7Im5vLXVuZGVmIjpbImVycm9yIl19LCJsYW5ndWFnZU9wdGlvbnMiOnsicGFyc2VyT3B0aW9ucyI6eyJlY21hRmVhdHVyZXMiOnt9fX19fQ==
Participation
Additional comments
No response