Skip to content

Commit c2e07a3

Browse files
committed
fix typos, enforce type of array of strings in allow option
1 parent 0c78a5a commit c2e07a3

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

docs/rules/no-unassigned-import.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This rule aims to remove modules with side-effects by reporting when a module is
1010

1111
This rule supports the following option:
1212

13-
`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).
13+
`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).
1414

1515
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.
1616

src/rules/no-unassigned-import.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function report(context, node) {
1111

1212
function testIsAllow(globs, filename, source) {
1313
if (!Array.isArray(globs)) {
14-
return false // default doens't allow any pattern
14+
return false // default doesn't allow any patterns
1515
}
1616

1717
let filePath
@@ -60,7 +60,12 @@ module.exports = {
6060
'devDependencies': { 'type': ['boolean', 'array'] },
6161
'optionalDependencies': { 'type': ['boolean', 'array'] },
6262
'peerDependencies': { 'type': ['boolean', 'array'] },
63-
'allow': { 'type': 'array' },
63+
'allow': {
64+
'type': 'array',
65+
'items': {
66+
'type': 'string',
67+
},
68+
},
6469
},
6570
'additionalProperties': false,
6671
},

0 commit comments

Comments
 (0)