diff --git a/docs/rules/no-unassigned-import.md b/docs/rules/no-unassigned-import.md index 324962767..85f9b7c3a 100644 --- a/docs/rules/no-unassigned-import.md +++ b/docs/rules/no-unassigned-import.md @@ -10,7 +10,7 @@ This rule aims to remove modules with side-effects by reporting when a module is This rule supports the following option: -`allow`: An Array of globs. The files that match any of these patterns would be ignored/allowed by the linter. This can be usefull for some build environment (e.g. css-loader in webpack). +`allow`: An Array of globs. The files that match any of these patterns would be ignored/allowed by the linter. This can be useful for some build environments (e.g. css-loader in webpack). Note that the globs start from the where the linter is executed (usually project root), but not from each file that includes the source. Learn more in both the pass and fail examples below. diff --git a/src/rules/no-unassigned-import.js b/src/rules/no-unassigned-import.js index e7d5b1e3e..2b1499b34 100644 --- a/src/rules/no-unassigned-import.js +++ b/src/rules/no-unassigned-import.js @@ -11,7 +11,7 @@ function report(context, node) { function testIsAllow(globs, filename, source) { if (!Array.isArray(globs)) { - return false // default doens't allow any pattern + return false // default doesn't allow any patterns } let filePath @@ -60,7 +60,12 @@ module.exports = { 'devDependencies': { 'type': ['boolean', 'array'] }, 'optionalDependencies': { 'type': ['boolean', 'array'] }, 'peerDependencies': { 'type': ['boolean', 'array'] }, - 'allow': { 'type': 'array' }, + 'allow': { + 'type': 'array', + 'items': { + 'type': 'string', + }, + }, }, 'additionalProperties': false, },