-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Implement a new warning (and probe) monkey-patch when native JavaScript prototype are overrided.
Array.prototype.map = function() {};My idea is to iterate step by step to implement the new probe:
- Detect AssignExpression of prototypes and usage of Object.defineProperty
- Use VariableTracer to detect re-assignment
- Resolve evaluation (eval)
We can take inspiration from the no-extend-native rule of ESLint: https://eslint.org/docs/latest/rules/no-extend-native
Code itself can be an inspiration too: https://github.com/dustinspecker/eslint-plugin-no-use-extend-native/blob/main/src/no-use-extend-native.js
List of JavaScript types are available here: https://github.com/sindresorhus/js-types/blob/main/js-types.json
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed