From dec56b94addaf92f0a96bac0200d4c7cab6f8298 Mon Sep 17 00:00:00 2001 From: Gordon Whamond Date: Thu, 26 Oct 2017 15:53:30 +0100 Subject: [PATCH 1/3] document terminating-properties extension --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index 193c30b..4511c91 100755 --- a/README.md +++ b/README.md @@ -43,6 +43,44 @@ Enable the rules that you would like to use: - `terminating-properties` - Prevent calling `to.be.ok` and other assertion properties as functions +### Additional configuration + +#### terminating-properties rule + +A number of extenstions to chai add additional terminating properties. For example [chai-http](https://github.com/chaijs/chai-http) adds: + + - headers + - html + - ip + - json + - redirect + - text + +The terminating-properties rule can be configured to ensure these (or other) additional properties are not used as functions: + +```json +{ + "rules": { + "chai-expect/terminating-properties": [ "error", 1, { + properties: ['headers', 'html', 'ip', 'json', 'redirect', 'test'] + }] + } +} +``` + +```yaml +rules: + "chai-expect/terminating-properties": + - 2 + - properties: + - headers + - html + - ip + - json + - redirect + - text +``` + ## License eslint-plugin-chai-expect is licensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php). From b2145a4fa291f32bcb784a294096f91bc16757fe Mon Sep 17 00:00:00 2001 From: Gordon Whamond Date: Thu, 26 Oct 2017 15:57:14 +0100 Subject: [PATCH 2/3] fix json --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4511c91..aad3359 100755 --- a/README.md +++ b/README.md @@ -61,8 +61,8 @@ The terminating-properties rule can be configured to ensure these (or other) add ```json { "rules": { - "chai-expect/terminating-properties": [ "error", 1, { - properties: ['headers', 'html', 'ip', 'json', 'redirect', 'test'] + "chai-expect/terminating-properties": ["error", 1, { + "properties": ["headers", "html", "ip", "json", "redirect", "test"] }] } } From 378a10d4a401e3bddd3d334524984a8be6613ab8 Mon Sep 17 00:00:00 2001 From: Gordon Whamond Date: Fri, 27 Oct 2017 13:01:45 +0100 Subject: [PATCH 3/3] remove yaml and clean docs --- README.md | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/README.md b/README.md index aad3359..226d4bc 100755 --- a/README.md +++ b/README.md @@ -61,26 +61,13 @@ The terminating-properties rule can be configured to ensure these (or other) add ```json { "rules": { - "chai-expect/terminating-properties": ["error", 1, { + "chai-expect/terminating-properties": ["error", { "properties": ["headers", "html", "ip", "json", "redirect", "test"] }] } } ``` -```yaml -rules: - "chai-expect/terminating-properties": - - 2 - - properties: - - headers - - html - - ip - - json - - redirect - - text -``` - ## License eslint-plugin-chai-expect is licensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php).