Skip to content

Commit

Permalink
chore: remove object.entries dependency
Browse files Browse the repository at this point in the history
This removes the `object.entries` package and uses the widely available
built-in native `Object.entries`.
  • Loading branch information
43081j committed Jan 4, 2024
1 parent 11ab371 commit d598629
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions packages/eslint-config-airbnb-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
3 changes: 1 addition & 2 deletions packages/eslint-config-airbnb-base/whitespace-async.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env node

const entries = require('object.entries');
const { ESLint } = require('eslint');

const baseConfig = require('.');
Expand All @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions packages/eslint-config-airbnb-base/whitespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('.');
Expand All @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions packages/eslint-config-airbnb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions packages/eslint-config-airbnb/whitespace-async.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env node

const entries = require('object.entries');
const { ESLint } = require('eslint');

const baseConfig = require('.');
Expand All @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions packages/eslint-config-airbnb/whitespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('.');
Expand All @@ -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);
Expand Down

0 comments on commit d598629

Please sign in to comment.