From d59862969021003eab6792cd911072be057dd8ba Mon Sep 17 00:00:00 2001 From: 43081j <43081j@users.noreply.github.com> Date: Thu, 4 Jan 2024 19:14:38 +0000 Subject: [PATCH] chore: remove object.entries dependency This removes the `object.entries` package and uses the widely available built-in native `Object.entries`. --- packages/eslint-config-airbnb-base/package.json | 3 +-- packages/eslint-config-airbnb-base/whitespace-async.js | 3 +-- packages/eslint-config-airbnb-base/whitespace.js | 3 +-- packages/eslint-config-airbnb/package.json | 3 +-- packages/eslint-config-airbnb/whitespace-async.js | 3 +-- packages/eslint-config-airbnb/whitespace.js | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/eslint-config-airbnb-base/package.json b/packages/eslint-config-airbnb-base/package.json index 39c0fdf944..4a62d8dea9 100644 --- a/packages/eslint-config-airbnb-base/package.json +++ b/packages/eslint-config-airbnb-base/package.json @@ -87,7 +87,6 @@ "node": "^10.12.0 || >=12.0.0" }, "dependencies": { - "confusing-browser-globals": "^1.0.11", - "object.entries": "^1.1.6" + "confusing-browser-globals": "^1.0.11" } } diff --git a/packages/eslint-config-airbnb-base/whitespace-async.js b/packages/eslint-config-airbnb-base/whitespace-async.js index d6742fb7c4..f7994fca04 100755 --- a/packages/eslint-config-airbnb-base/whitespace-async.js +++ b/packages/eslint-config-airbnb-base/whitespace-async.js @@ -1,6 +1,5 @@ #!/usr/bin/env node -const entries = require('object.entries'); const { ESLint } = require('eslint'); const baseConfig = require('.'); @@ -26,7 +25,7 @@ async function onlyErrorOnRules(rulesToError, config) { }); const baseRules = (await cli.calculateConfigForFile(require.resolve('./'))).rules; - entries(baseRules).forEach((rule) => { + Object.entries(baseRules).forEach((rule) => { const ruleName = rule[0]; const ruleConfig = rule[1]; const severity = getSeverity(ruleConfig); diff --git a/packages/eslint-config-airbnb-base/whitespace.js b/packages/eslint-config-airbnb-base/whitespace.js index f4b93bb492..fcc5099af9 100644 --- a/packages/eslint-config-airbnb-base/whitespace.js +++ b/packages/eslint-config-airbnb-base/whitespace.js @@ -4,7 +4,6 @@ const { CLIEngine } = require('eslint'); if (CLIEngine) { /* eslint no-inner-declarations: 0 */ - const entries = require('object.entries'); const whitespaceRules = require('./whitespaceRules'); const baseConfig = require('.'); @@ -26,7 +25,7 @@ if (CLIEngine) { const cli = new CLIEngine({ baseConfig: config, useEslintrc: false }); const baseRules = cli.getConfigForFile(require.resolve('./')).rules; - entries(baseRules).forEach((rule) => { + Object.entries(baseRules).forEach((rule) => { const ruleName = rule[0]; const ruleConfig = rule[1]; const severity = getSeverity(ruleConfig); diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json index 1ac7a902a2..3c8773ba16 100644 --- a/packages/eslint-config-airbnb/package.json +++ b/packages/eslint-config-airbnb/package.json @@ -66,8 +66,7 @@ }, "homepage": "https://github.com/airbnb/javascript", "dependencies": { - "eslint-config-airbnb-base": "^15.0.0", - "object.entries": "^1.1.6" + "eslint-config-airbnb-base": "^15.0.0" }, "devDependencies": { "@babel/runtime": "^7.22.6", diff --git a/packages/eslint-config-airbnb/whitespace-async.js b/packages/eslint-config-airbnb/whitespace-async.js index d6742fb7c4..f7994fca04 100755 --- a/packages/eslint-config-airbnb/whitespace-async.js +++ b/packages/eslint-config-airbnb/whitespace-async.js @@ -1,6 +1,5 @@ #!/usr/bin/env node -const entries = require('object.entries'); const { ESLint } = require('eslint'); const baseConfig = require('.'); @@ -26,7 +25,7 @@ async function onlyErrorOnRules(rulesToError, config) { }); const baseRules = (await cli.calculateConfigForFile(require.resolve('./'))).rules; - entries(baseRules).forEach((rule) => { + Object.entries(baseRules).forEach((rule) => { const ruleName = rule[0]; const ruleConfig = rule[1]; const severity = getSeverity(ruleConfig); diff --git a/packages/eslint-config-airbnb/whitespace.js b/packages/eslint-config-airbnb/whitespace.js index f4b93bb492..fcc5099af9 100644 --- a/packages/eslint-config-airbnb/whitespace.js +++ b/packages/eslint-config-airbnb/whitespace.js @@ -4,7 +4,6 @@ const { CLIEngine } = require('eslint'); if (CLIEngine) { /* eslint no-inner-declarations: 0 */ - const entries = require('object.entries'); const whitespaceRules = require('./whitespaceRules'); const baseConfig = require('.'); @@ -26,7 +25,7 @@ if (CLIEngine) { const cli = new CLIEngine({ baseConfig: config, useEslintrc: false }); const baseRules = cli.getConfigForFile(require.resolve('./')).rules; - entries(baseRules).forEach((rule) => { + Object.entries(baseRules).forEach((rule) => { const ruleName = rule[0]; const ruleConfig = rule[1]; const severity = getSeverity(ruleConfig);