Skip to content

Commit

Permalink
Updates dependencies and removes unneeded Lodash libs (#64)
Browse files Browse the repository at this point in the history
- eslint node plugin is no longer maintained, so switching to the eslint recommended presets that are based on our es2021 settings
- removes lodash dependencies that can be replaced by basic native code.
- version bump in prep for a release of the changes
  • Loading branch information
acolchado authored Apr 1, 2024
1 parent aee5966 commit da28ea6
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 170 deletions.
37 changes: 0 additions & 37 deletions .eslintrc

This file was deleted.

10 changes: 10 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"env": {
"commonjs": true,
"es2021": true,
"node": true
},
"extends": "eslint:recommended",
"rules": {
}
}
99 changes: 0 additions & 99 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "spur-config",
"description": "Configuration framework to help manage complex application configurations in Node.js.",
"version": "2.0.5",
"version": "2.0.6",
"main": "./src/SpurConfig",
"author": {
"name": "Agustin Colchado",
Expand Down Expand Up @@ -32,15 +32,11 @@
"url": "git://github.com/opentable/spur-config.git"
},
"dependencies": {
"lodash.foreach": "4.5.0",
"lodash.isfunction": "3.0.9",
"lodash.merge": "4.6.2",
"require-all": "3.0.0"
},
"devDependencies": {
"@types/jest": "29.5.12",
"eslint": "8.57.0",
"eslint-plugin-node": "11.1.0",
"jest": "29.7.0"
}
}
11 changes: 6 additions & 5 deletions src/SpurConfig.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const fs = require('fs');
const path = require('path');
const _forEach = require('lodash.foreach');
const _isFunction = require('lodash.isfunction');
const _merge = require('lodash.merge');
const requireAll = require('require-all');

Expand Down Expand Up @@ -60,9 +58,12 @@ class SpurConfig {
}
}

loadPluginsByObject(pluginsObject) {
_forEach(pluginsObject, (plugin, pluginName) => {
if (_isFunction(plugin)) {
loadPluginsByObject(pluginsObject = {}) {
const pluginNames = Object.keys(pluginsObject);

pluginNames.forEach((pluginName) => {
const plugin = pluginsObject[pluginName];
if (typeof plugin === 'function') {
this.plugins[pluginName] = plugin.bind(this);
} else {
this.loadPluginsByObject(plugin);
Expand Down
24 changes: 0 additions & 24 deletions test/.eslintrc

This file was deleted.

9 changes: 9 additions & 0 deletions test/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../.eslintrc.json",
"env": {
"jest": true
},
"rules": {
"no-unused-vars": 0
}
}

0 comments on commit da28ea6

Please sign in to comment.