@ethlete/eslint-plugin 1.0.0-next.21 → 1.0.0-next.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/rules/no-native-observers.js +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.0-next.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`656a886`](https://github.com/ethlete-io/ethdk/commit/656a886de552134e5be027aa215f51e6c234c03c) Thanks [@TomTomB](https://github.com/TomTomB)! - Fixed `no-native-observers` crashing on `new constructor()` or `new toString()` - an identifier naming an inherited `Object.prototype` key was read as a known observer entry.
|
|
8
|
+
|
|
3
9
|
## 1.0.0-next.21
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -73,7 +73,10 @@ const noNativeObservers = {
|
|
|
73
73
|
if (node.callee.type !== 'Identifier') return;
|
|
74
74
|
|
|
75
75
|
const name = node.callee.name;
|
|
76
|
-
|
|
76
|
+
|
|
77
|
+
// hasOwn, not `in`: `new constructor()` / `new toString()` would otherwise match an
|
|
78
|
+
// inherited Object.prototype key and read a function where an entry is expected
|
|
79
|
+
if (!Object.hasOwn(OBSERVER_ALTERNATIVES, name)) return;
|
|
77
80
|
|
|
78
81
|
const info = OBSERVER_ALTERNATIVES[name];
|
|
79
82
|
|