diff --git a/packages/eslint-plugin-ecmascript-compat/lib/features/es-versions.md b/packages/eslint-plugin-ecmascript-compat/lib/features/es-versions.md index b9d2978..991891b 100644 --- a/packages/eslint-plugin-ecmascript-compat/lib/features/es-versions.md +++ b/packages/eslint-plugin-ecmascript-compat/lib/features/es-versions.md @@ -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` | ❌ | diff --git a/packages/eslint-plugin-ecmascript-compat/lib/features/es2019.js b/packages/eslint-plugin-ecmascript-compat/lib/features/es2019.js index a4d74cf..2e3e108 100644 --- a/packages/eslint-plugin-ecmascript-compat/lib/features/es2019.js +++ b/packages/eslint-plugin-ecmascript-compat/lib/features/es2019.js @@ -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], }, { diff --git a/packages/eslint-plugin-ecmascript-compat/lib/features/es2019.spec.js b/packages/eslint-plugin-ecmascript-compat/lib/features/es2019.spec.js index 51f28e5..cd5444e 100644 --- a/packages/eslint-plugin-ecmascript-compat/lib/features/es2019.spec.js +++ b/packages/eslint-plugin-ecmascript-compat/lib/features/es2019.spec.js @@ -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 {}',