Skip to content

Commit

Permalink
Fix microsoft#531: export-name should be case-insensitive by default
Browse files Browse the repository at this point in the history
  • Loading branch information
RPraneetha committed Oct 8, 2018
1 parent 3d5036d commit 673c483
Show file tree
Hide file tree
Showing 3 changed files with 563 additions and 563 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Rule Name | Description | Since
:---------- | :------------ | -------------
`chai-prefer-contains-to-index-of` | Avoid Chai assertions that invoke indexOf and compare for a -1 result. It is better to use the chai .contain() assertion API instead because the failure message will be more clearer if the test fails. | 2.0.10
`chai-vague-errors` | Avoid Chai assertions that result in vague errors. For example, asserting `expect(something).to.be.true` will result in the failure message "Expected true received false". This is a vague error message that does not reveal the underlying problem. It is especially vague in TypeScript because stack trace line numbers often do not match the source code. A better pattern to follow is the xUnit Patterns [Assertion Message](http://xunitpatterns.com/Assertion%20Message.html) pattern. The previous code sample could be better written as `expect(something).to.equal(true, 'expected something to have occurred');`| 1.0
`export-name` | The name of the exported module must match the filename of the source file. This is case-sensitive by default but ignores file extension. It can be configured to be case-insensitive or to allow names matching a regex. For example, to allow names that differ only in case and an exported name like myChartOptions, then configure the rule like this: `"export-name": [true, { "ignore-case": true, "allow": ["myChartOptions"] }]`. You can also just give a list of allowed names, like `"export-name": [true, "myChartOptions"]`| 0.0.3
`export-name` | The name of the exported module must match the filename of the source file. This is case-insensitive by default but ignores file extension. It can be configured to be case-insensitive or to allow names matching a regex. For example, to allow names that differ only in case and an exported name like myChartOptions, then configure the rule like this: `"export-name": [true, { "ignore-case": true, "allow": ["myChartOptions"] }]`. You can also just give a list of allowed names, like `"export-name": [true, "myChartOptions"]`| 0.0.3
`function-name` | Applies a naming convention to function names and method names. You can configure the naming convention by passing parameters. Please note, the private-method-regex does take precedence over the static-method-regex, so a private static method must match the private-method-regex. The default values are: <br> [ true, { <br> "method-regex": "^[a-z][\\w\\d]+$",<br> "private-method-regex": "^[a-z][\\w\\d]+$",<br> "protected-method-regex": "^[a-z][\\w\\d]+$",<br> "static-method-regex": "^[A-Z_\\d]+$",<br> "function-regex": "^[a-z][\\w\\d]+$"<br> }<br/>This rule has some overlap with the [tslint variable-name rule](https://palantir.github.io/tslint/rules/variable-name/); however, the rule here is more configurable.] | 2.0.7, 2.0.14
`import-name` | The name of the imported module must match the name of the thing being imported. For example, it is valid to name imported modules the same as the module name: `import Service = require('x/y/z/Service')` and `import Service from 'x/y/z/Service'`. But it is invalid to change the name being imported, such as: `import MyCoolService = require('x/y/z/Service')` and `import MyCoolService from 'x/y/z/Service'`. Since version 2.0.9 it is possible to configure this rule with a list of exceptions. For example, to allow `underscore` to be imported as `_`, add this configuration: `'import-name': [ true, { 'underscore': '_' }]`| 2.0.5
`insecure-random` | Do not use insecure sources for random bytes. Use a secure random number generator instead. Bans all uses of Math.random and crypto.pseudoRandomBytes. Better alternatives are crypto.randomBytes and window.crypto.getRandomValues.<br/>References:<br/>* [CWE 330](https://cwe.mitre.org/data/definitions/330.html)<br/>* [MDN Math.random](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)<br/>* [Node.js crypto.randomBytes()](https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback)<br/>* [window.crypto.getRandomValues()](https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues)<br/> | 2.0.11
Expand Down
Loading

0 comments on commit 673c483

Please sign in to comment.