-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
570ea4d
commit db42f81
Showing
9 changed files
with
440 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
.idea | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
## Schema | ||
|
||
```js | ||
{ | ||
"plugins": ["no-unsanitized"], | ||
"env": { | ||
// $ruleName is either "method" or "property" | ||
"no-unsanitized/$ruleName": ["errorlevel", | ||
// This object is optional would use default config for all default ruleChecks | ||
{ | ||
// optional, omitting or length 0 would be considered permitting all objectNames | ||
objectMatches: ["$stringRegex"], | ||
|
||
// optional, removes default $ruleCheckName's provided by this rule | ||
disableDefault: $boolean, | ||
|
||
// optional, if omitted would disallow use of matched "$ruleCheckName" prop/method | ||
escape: { | ||
// optional: Tagged template permitted as arguments/assignments | ||
taggedTemplates: ["$taggedTemplateFunctionName"], | ||
|
||
// optional: method permitted as arguments/assignments | ||
methods: ["$MethodName"] | ||
} | ||
}, | ||
// optional would use default ruleChecks, will merge each $ruleCheckName with default rule setup so user doesn't have to specify properties if already defined | ||
{ | ||
"$ruleCheckName": { | ||
// optional, same as above and overrides parent even if blank array | ||
objectMatches: ["$stringRegex"], | ||
|
||
// optional, same as above, overrides parent even if blank object | ||
escape: {...} | ||
|
||
// indices to check for arguments passed to a method call. Only applies to $ruleName="method" | ||
properties: [...] | ||
} | ||
... | ||
} | ||
] | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.