Skip to content

Commit

Permalink
Fix: relax allowModules option (fixes #35)
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed May 13, 2016
1 parent 789e4dd commit f59bfba
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/rules/no-missing-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports.schema = [
type: "array",
items: {
type: "string",
pattern: "^(?:@[a-zA-Z0-9_]+/)?[a-zA-Z0-9_]+$"
pattern: "^(?:@[a-zA-Z0-9_\\-.]+/)?[a-zA-Z0-9_\\-.]+$"
},
uniqueItems: true
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-missing-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports.schema = [
type: "array",
items: {
type: "string",
pattern: "^(?:@[a-zA-Z0-9_]+/)?[a-zA-Z0-9_]+$"
pattern: "^(?:@[a-zA-Z0-9_\\-.]+/)?[a-zA-Z0-9_\\-.]+$"
},
uniqueItems: true
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unpublished-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports.schema = [
type: "array",
items: {
type: "string",
pattern: "^(?:@[a-zA-Z0-9_]+/)?[a-zA-Z0-9_]+$"
pattern: "^(?:@[a-zA-Z0-9_\\-.]+/)?[a-zA-Z0-9_\\-.]+$"
},
uniqueItems: true
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unpublished-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports.schema = [
type: "array",
items: {
type: "string",
pattern: "^(?:@[a-zA-Z0-9_]+/)?[a-zA-Z0-9_]+$"
pattern: "^(?:@[a-zA-Z0-9_\\-.]+/)?[a-zA-Z0-9_\\-.]+$"
},
uniqueItems: true
},
Expand Down
6 changes: 6 additions & 0 deletions tests/lib/rules/no-missing-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ ruleTester.run("no-missing-require", rule, {
code: "require('electron');",
options: [{allowModules: ["electron"]}],
env: {node: true}
},
{
filename: fixture("test.js"),
code: "require('jquery.cookie');",
options: [{allowModules: ["jquery.cookie"]}],
env: {node: true}
}
],
invalid: [
Expand Down

0 comments on commit f59bfba

Please sign in to comment.