Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit d0ddc6d

Browse files
Add lodash.get to do Config#get lookups
1 parent 4d65ef9 commit d0ddc6d

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

lib/config.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use babel';
22
import { CompositeDisposable, Disposable } from 'atom';
3+
import get from 'lodash.get';
34

45
import console from './console';
56

@@ -63,17 +64,13 @@ const Config = {
6364
},
6465

6566
get (keyName = null) {
66-
if (!keyName) {
67-
return Object.assign(
68-
{},
69-
atom.config.get('linter-eslint-node'),
70-
this.overrides
71-
);
72-
}
73-
if (keyName in this.overrides) {
74-
return this.overrides[keyName];
75-
}
76-
return atom.config.get(`linter-eslint-node.${keyName}`);
67+
let config = Object.assign(
68+
{},
69+
atom.config.get('linter-eslint-node'),
70+
this.overrides
71+
);
72+
if (!keyName) { return config; }
73+
return get(config, keyName);
7774
},
7875

7976
triggerConfigChange () {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
"atom-package-deps": "^8.0.0",
167167
"compare-versions": "^4.1.3",
168168
"eslint": "^8.9.0",
169+
"lodash.get": "^4.4.2",
169170
"ndjson": "^2.0.0",
170171
"which": "^2.0.2"
171172
}

0 commit comments

Comments
 (0)