Skip to content

Commit f67311b

Browse files
authored
docs: add markdownlint (#115)
1 parent 2aa2b42 commit f67311b

11 files changed

+208
-31
lines changed

.markdownlint.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"line-length": false
3+
}

.markdownlintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CHANGELOG.md
2+
LICENSE
3+
node_modules

README.md

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# eslint-plugin-qunit
2+
23
![CI](https://github.com/platinumazure/eslint-plugin-qunit/workflows/CI/badge.svg)
34
[![Coverage Status](https://coveralls.io/repos/platinumazure/eslint-plugin-qunit/badge.svg?branch=master&service=github)](https://coveralls.io/github/platinumazure/eslint-plugin-qunit?branch=master)
45
[![devDependency Status](https://david-dm.org/platinumazure/eslint-plugin-qunit/dev-status.svg)](https://david-dm.org/platinumazure/eslint-plugin-qunit#info=devDependencies)
@@ -21,8 +22,8 @@ For more details on how to extend your configuration from one or both of these p
2122

2223
Each rule has emojis denoting:
2324

24-
- What configuration it belongs to
25-
- :wrench: if some problems reported by the rule are automatically fixable by the `--fix` [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) option
25+
* What configuration it belongs to
26+
* :wrench: if some problems reported by the rule are automatically fixable by the `--fix` [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) option
2627

2728
<!--RULES_TABLE_START-->
2829

@@ -101,27 +102,29 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
101102
<!-- prettier-ignore-end -->
102103
<!-- ALL-CONTRIBUTORS-LIST:END -->
103104

105+
<!-- markdownlint-disable line-length -->
106+
104107
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
105108

106109
## Semantic Versioning Policy
107110

108111
Like ESLint itself, this ESLint plugin follows [semantic versioning](http://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy, based on the policy used by ESLint:
109112

110113
* Patch release (intended not to break your lint build)
111-
* A bug fix in a plugin rule that results in ESLint reporting fewer errors.
112-
* Improvements to documentation.
113-
* Non-user-facing changes such as refactoring code; adding, deleting, or modifying tests; and increasing test coverage.
114-
* Re-releasing after a failed release (i.e., after having published a release that doesn't work for anyone).
114+
* A bug fix in a plugin rule that results in ESLint reporting fewer errors.
115+
* Improvements to documentation.
116+
* Non-user-facing changes such as refactoring code; adding, deleting, or modifying tests; and increasing test coverage.
117+
* Re-releasing after a failed release (i.e., after having published a release that doesn't work for anyone).
115118
* Minor release (might break your lint build)
116-
* A bug fix in a rule that results in ESLint reporting more errors.
117-
* A new rule is created (without being added to plugin configuration).
118-
* A new option to an existing rule is created (without any default options changing).
119-
* A new plugin configuration is created.
120-
* An existing rule is deprecated.
119+
* A bug fix in a rule that results in ESLint reporting more errors.
120+
* A new rule is created (without being added to plugin configuration).
121+
* A new option to an existing rule is created (without any default options changing).
122+
* A new plugin configuration is created.
123+
* An existing rule is deprecated.
121124
* Major release (likely to break your lint build)
122-
* An existing plugin configuration is changed in any way, including but not limited to:
123-
* A new rule is added to the configuration.
124-
* A rule is removed from the configuration.
125-
* The options used in configuration for a rule are changed
126-
* An existing rule is removed.
127-
* A backward-incompatible change is made to the options of a rule.
125+
* An existing plugin configuration is changed in any way, including but not limited to:
126+
* A new rule is added to the configuration.
127+
* A rule is removed from the configuration.
128+
* The options used in configuration for a rule are changed
129+
* An existing rule is removed.
130+
* A backward-incompatible change is made to the options of a rule.

docs/rules/assert-args.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ We can apply the same analysis to all of QUnit's assertions. In general,
1616
optional message; and the other assertions expect two arguments and one optional
1717
message.
1818

19-
# Rule Details
19+
## Rule Details
2020

2121
The following patterns are considered warnings:
2222

@@ -148,15 +148,15 @@ assert.notPropEqual(result, expected, 'message');
148148

149149
```
150150

151-
# Known Limitations
151+
## Known Limitations
152152

153153
At this point, there is no special validation for assertion message arguments.
154154
We eventually want to add support for different types of validation for
155155
assertion message arguments (for example, requiring that assertion messages be
156156
string literals). However, we learned early on that enforcing string literal
157157
assertion messages makes the rule nearly unusable in some codebases.
158158

159-
# When Not to Use It
159+
## When Not to Use It
160160

161161
This rule should be reasonably safe to use in all circumstances.
162162

docs/rules/literal-compare-order.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ regarded as "expected" values, rather than actual values, and then flags
2020
assertions in which the literal/"expected" value is known to be in the argument
2121
slot reserved for the "actual" value.
2222

23-
# Rule Details
23+
## Rule Details
2424

2525
The following patterns are considered warnings:
2626

@@ -98,7 +98,7 @@ assert.notPropEqual(variable, "Literal", "message");
9898

9999
```
100100

101-
# When Not to Use It
101+
## When Not to Use It
102102

103103
This rule can be disabled if you aren't concerned about the readability of test
104104
reports.

docs/rules/no-assert-ok.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
`assert.ok` and `assert.notOk` pass for any truthy/falsy argument. As [many expressions evaluate to true/false in JavaScript](https://developer.mozilla.org/en-US/docs/Glossary/Truthy) the usage of `assert.ok` is potentially error prone. In general, it should be advisable to always test for exact values in tests which makes tests a lot more solid.
44

55
An example when using `assert.ok` can involuntarily go wrong:
6-
```
6+
7+
```js
78
test('test myFunc returns a truthy value' (assert) => {
89
assert.ok(myFunc);
910
});
1011
```
12+
1113
Here by mistake a developer just passed to `assert.ok` a pointer to `myFunc` instead of explicitly calling it. This test is going pass no matter how `myFunc` changes. Using `assert.strictEqual(myFunc, theReturnValue)` solves the problem as this becomes an explicit check for equality.
1214

1315
## Rule Details

docs/rules/no-loose-assertions.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ The `assert.equal`/`assert.notEqual` assertion methods in QUnit use loose equali
55
`assert.ok` and `assert.notOk` pass for any truthy/falsy argument. As [many expressions evaluate to true/false in JavaScript](https://developer.mozilla.org/en-US/docs/Glossary/Truthy) the usage of `assert.ok` is potentially error prone. In general, it should be advisable to always test for exact values in tests which makes tests a lot more solid.
66

77
An example when using `assert.ok` can involuntarily go wrong:
8-
```
8+
9+
```js
910
test('test myFunc returns a truthy value' (assert) => {
1011
assert.ok(myFunc);
1112
});
1213
```
14+
1315
Here by mistake a developer just passed to `assert.ok` a pointer to `myFunc` instead of explicitly calling it. This test is going pass no matter how `myFunc` changes. Using `assert.strictEqual(myFunc, theReturnValue)` solves the problem as this becomes an explicit check for equality.
1416

1517
The assertions to lint against can be controlled with an array of assertions (default `["equal", "notEqual", "ok", "notOk"]`).
1618

1719
To fine tune the error message (which by default will recommend to use `strictEqual`, `notStrictEqual`, `deepEqual`, or `propEqual`) a configuration object can be passed as an option instead of a string. The configuration object has two properties:
20+
1821
* `disallowed`: the name of the assertion to disallow (either `equal`, `ok`, or `notOk`);
1922
* `recommended`: an array of strings representing the recommended options to display as an error message. The strings in the array will be concatenated to build the error message: `Unexpected {{assertVar}}.{{assertion}}. Use {{assertVar}}.<recommended_1>, {{assertVar}}.<recommended_2>.` when using local assertions and `Unexpected {{assertion}}. Use <recommended_1>, <recommended_2>.` when using global assertions.
2023

docs/rules/no-nested-tests.md

-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,3 @@ It should be safe to use this rule. However it may cause false positive when usi
4949

5050
* [QUnit.module() Nested Scope](https://github.com/qunitjs/qunit/blob/master/docs/QUnit/module.md#nested-scope)
5151
* [QUnit.test](https://github.com/qunitjs/qunit/blob/master/docs/QUnit/test.md)
52-

docs/rules/require-expect.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ The "never-except-zero" option disallows `except` calls, except when used to
2626
explicitly assert that a test performs no assertions, which would otherwise
2727
be considered an error.
2828

29-
# Rule Details
29+
## Rule Details
3030

31-
## always
31+
### always
3232

3333
When using the default "always" option, each test needs an expect call. So the
3434
following would warn.
@@ -53,7 +53,7 @@ test('name', function() {
5353
});
5454
```
5555

56-
## except-simple
56+
### except-simple
5757

5858
When using the "except-simple" option, the following patterns are considered
5959
warnings.
@@ -127,7 +127,7 @@ test('name', function(assert) {
127127
});
128128
```
129129

130-
## never
130+
### never
131131

132132
The following would warn.
133133

@@ -152,7 +152,7 @@ test('name', function(assert) {
152152
});
153153
```
154154

155-
## never-except-zero
155+
### never-except-zero
156156

157157
The following would warn.
158158

@@ -177,7 +177,7 @@ test('name', function(assert) {
177177
});
178178
```
179179

180-
# When Not to Use It
180+
## When Not to Use It
181181

182182
1. If your tests have some logic that relies on an unpredictable number of
183183
assertions being called.

0 commit comments

Comments
 (0)