Skip to content

Commit 769cce9

Browse files
committed
fix: allow settings.n (fixes #3)
1 parent 26c90b1 commit 769cce9

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

lib/util/get-allow-modules.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function get(option) {
2323
* Gets "allowModules" setting.
2424
*
2525
* 1. This checks `options` property, then returns it if exists.
26-
* 2. This checks `settings.node` property, then returns it if exists.
26+
* 2. This checks `settings.n` | `settings.node` property, then returns it if exists.
2727
* 3. This returns `[]`.
2828
*
2929
* @param {RuleContext} context - The rule context.
@@ -32,7 +32,7 @@ function get(option) {
3232
module.exports = function getAllowModules(context) {
3333
return (
3434
get(context.options && context.options[0]) ||
35-
get(context.settings && context.settings.node) ||
35+
get(context.settings && (context.settings.n || context.settings.node)) ||
3636
DEFAULT_VALUE
3737
)
3838
}

lib/util/get-convert-path.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function parse(option) {
125125
* Gets "convertPath" setting.
126126
*
127127
* 1. This checks `options` property, then returns it if exists.
128-
* 2. This checks `settings.node` property, then returns it if exists.
128+
* 2. This checks `settings.n` | `settings.node` property, then returns it if exists.
129129
* 3. This returns a function of identity.
130130
*
131131
* @param {RuleContext} context - The rule context.
@@ -134,7 +134,7 @@ function parse(option) {
134134
module.exports = function getConvertPath(context) {
135135
return (
136136
parse(context.options && context.options[0]) ||
137-
parse(context.settings && context.settings.node) ||
137+
parse(context.settings && (context.settings.n || context.settings.node)) ||
138138
identity
139139
)
140140
}

lib/util/get-resolve-paths.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function get(option) {
2323
* Gets "resolvePaths" setting.
2424
*
2525
* 1. This checks `options` property, then returns it if exists.
26-
* 2. This checks `settings.node` property, then returns it if exists.
26+
* 2. This checks `settings.n` | `settings.node` property, then returns it if exists.
2727
* 3. This returns `[]`.
2828
*
2929
* @param {RuleContext} context - The rule context.
@@ -32,7 +32,7 @@ function get(option) {
3232
module.exports = function getResolvePaths(context, optionIndex = 0) {
3333
return (
3434
get(context.options && context.options[optionIndex]) ||
35-
get(context.settings && context.settings.node) ||
35+
get(context.settings && (context.settings.n || context.settings.node)) ||
3636
DEFAULT_VALUE
3737
)
3838
}

lib/util/get-try-extensions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function get(option) {
2323
* Gets "tryExtensions" setting.
2424
*
2525
* 1. This checks `options` property, then returns it if exists.
26-
* 2. This checks `settings.node` property, then returns it if exists.
26+
* 2. This checks `settings.n` | `settings.node` property, then returns it if exists.
2727
* 3. This returns `[".js", ".json", ".node"]`.
2828
*
2929
* @param {RuleContext} context - The rule context.
@@ -32,7 +32,7 @@ function get(option) {
3232
module.exports = function getTryExtensions(context, optionIndex = 0) {
3333
return (
3434
get(context.options && context.options[optionIndex]) ||
35-
get(context.settings && context.settings.node) ||
35+
get(context.settings && (context.settings.n || context.settings.node)) ||
3636
DEFAULT_VALUE
3737
)
3838
}

0 commit comments

Comments
 (0)