Skip to content

Commit

Permalink
use plugin for object.fromentries. Fixes #40
Browse files Browse the repository at this point in the history
  • Loading branch information
robatwilliams committed Jan 14, 2022
1 parent 5df534c commit b80f561
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Static detectability of recently-added features
| ------------------------------------- | ---------------------------- | ------------ |
| `Array.prototype.{flat, flatMap}` | 😐 no-restricted-syntax | 69 |
| JSON superset | es/no-json-superset | 66 |
| `Object.fromEntries` | no-restricted-properties | 73 |
| `Object.fromEntries` | es/no-object-fromentries | 73 |
| Optional `catch` binding | es/no-optional-catch-binding | 66 |
| Revised `Function.prototype.toString` ||
| Stable `Array.prototype.sort` ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ module.exports = [
compatFeatures: [compatData.javascript.builtins.JSON.json_superset],
},
{
ruleConfig: {
definition: coreRules.get('no-restricted-properties'),
options: [{ object: 'Object', property: 'fromEntries', message: '(ES2019)' }],
},
ruleConfig: { definition: esPlugin.rules['no-object-fromentries'] },
compatFeatures: [compatData.javascript.builtins.Object.fromEntries],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ ruleTester.run('compat', require('../rule'), {
},
{
code: 'Object.fromEntries();',
errors: [
{ message: "'Object.fromEntries' is restricted from being used. (ES2019)" },
],
errors: [{ message: "ES2019 'Object.fromEntries' method is forbidden." }],
},
{
code: 'try {} catch {}',
Expand Down

0 comments on commit b80f561

Please sign in to comment.