Skip to content

Commit 5644b95

Browse files
nschonniWilcoFiers
authored andcommitted
chore: Further markdown linting (dequelabs#848)
* chore(markdownlint): Fix MD040 Fenced code blocks should have a language Removed fence from "Breaking Change since it didn't seem like code * chore(markdownlint): Fix MD030 Spaces after list markers * chore(markdownlint): Fix MD012 Multiple consecutive blank lines * chore(markdownlint): Fix MD007 Unordered list indentation * chore(markdownlint): Fix MD010 Hard tabs Modified the EditorConfig file to enforce this in Markdown files too * chore(markdownlint): Fix MD022 Headers should be surrounded byblank line
1 parent e7a8bf0 commit 5644b95

11 files changed

+446
-463
lines changed

.editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ indent_size = 2
1717
[*.yml]
1818
indent_style = space
1919
indent_size = 2
20+
21+
[*.md]
22+
indent_style = space
23+
indent_size = 2

.github/PULL_REQUEST_TEMPLATE.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## PR Checklist
2+
23
Please check if your PR fulfills the following requirements:
34

45
- [ ] The commit message(s) follow our guidelines: https://github.com/dequelabs/axe-core/blob/develop/doc/code-submission-guidelines.md#git-commits
@@ -8,14 +9,12 @@ Please check if your PR fulfills the following requirements:
89
- [ ] Docs have been added / updated (for bug fixes / features)
910

1011
## Description of the changes
11-
- Github issue:
1212

13+
- Github issue:
1314

1415
## Does this PR introduce a breaking change?
15-
```
16-
[ ] Yes
17-
[ ] No
18-
```
1916

17+
- [ ] Yes
18+
- [ ] No
2019

2120
## Other information

.markdownlint.json

-6
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,15 @@
44
"MD002": false,
55
"MD004": false,
66
"MD006": false,
7-
"MD007": false,
87
"MD009": false,
9-
"MD010": false,
10-
"MD012": false,
118
"MD013": false,
12-
"MD022": false,
139
"MD024": false,
1410
"MD026": false,
1511
"MD029": false,
16-
"MD030": false,
1712
"MD031": false,
1813
"MD032": false,
1914
"MD033": false,
2015
"MD034": false,
2116
"MD036": false,
22-
"MD040": false,
2317
"MD041": false
2418
}

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ aXe is the third generation of accessibility rules for HTML-based user interface
4343

4444
First download the package:
4545

46-
```
46+
```console
4747
npm install axe-core --save-dev
4848
```
4949

@@ -57,12 +57,13 @@ Now insert calls at each point in your tests where a new piece of UI becomes vis
5757

5858
```js
5959
axe.run(function (err, results) {
60-
if (err) throw err;
60+
if (err) throw err;
6161
ok(results.violations.length === 0, 'Should be no accessibility issues');
6262
// complete the async call
6363
...
6464
});
6565
```
66+
6667
## Supported Browsers
6768

6869
The [aXe API](doc/API.md) fully supports the following browsers:

doc/API.md

+254-264
Large diffs are not rendered by default.

doc/accessibility-supported.md

-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@ In addition, we disallow invalid attributes starting with `aria-` and invalid at
3131
We recognize that there are best practices that significantly improve the usability of application, even though they are not strictly required in order to conform with WCAG 2. We develop the best practice rules to help content developers to identify these and adhere to them.
3232

3333
We recognize that this topic is somewhat controvertial and the rules we have represent Deque's opinion on what constitutes a best practice.
34-

doc/code-submission-guidelines.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A detailed explanation of Angular's guidelines and conventions can be found [on
2222
Each commit message should consist of a header, a body and a footer. The header has a special format
2323
that includes a type, a scope and a subject. Here's a sample of the format:
2424

25-
```
25+
```html
2626
<type>(<scope>): <subject>
2727
<BLANK LINE>
2828
<body>
@@ -35,7 +35,7 @@ that includes a type, a scope and a subject. Here's a sample of the format:
3535
```sh
3636
perf(rule): improve speed of color contrast rules
3737

38-
Use async process to compare elements without UI lockup
38+
Use async process to compare elements without UI lockup
3939

4040
Closes #1
4141
```
@@ -70,7 +70,6 @@ If the scope is too broad to summarize, use the type only and leave off the pare
7070
`type: some subject`. Keep in mind that a long scope often pushes your commit message over 100 characters.
7171
Brevity is helpful for everyone!
7272

73-
7473
#### Subject
7574

7675
The subject contains succinct description of the change:
@@ -124,7 +123,7 @@ git checkout -b temp-feature-branch
124123

125124
Run the following commands to apply all commits from that pull request on top of your branch's local history:
126125

127-
```
126+
```console
128127
curl -L https://github.com/dequelabs/axe-core/pull/205.patch | git am -3
129128
```
130129

@@ -137,7 +136,7 @@ Before merging a pull request with many commits into develop, make sure there is
137136
changes in the pull request, so the git log stays lean. We particularly want to avoid merge messages and vague commits that don't follow our commit policy (like `Merged develop into featurebranch` or `fixed some stuff`).
138137

139138
You can use git's interactive rebase to manipulate, merge, and rename commits in your local
140-
history. If these steps are followed, a force push shouldn't be necessary.
139+
history. If these steps are followed, a force push shouldn't be necessary.
141140

142141
**Do not force push to develop or master under any circulstances.**
143142

@@ -161,7 +160,7 @@ git pull --rebase origin develop
161160
```
162161

163162
You can then push the latest code to develop (note that force push isn't needed if these steps are followed):
164-
```
163+
```console
165164
git push origin develop
166165
```
167166

doc/developer-guide.md

+37-40
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ aXe 3.0 supports open Shadow DOM: see our virtual DOM APIs and test utilities fo
66

77
1. [Getting Started](#getting-started)
88
1. [Architecture Overview](#architecture-overview)
9-
1. [Rules](#rules)
10-
1. [Checks](#checks)
11-
1. [Common Functions](#common-functions)
12-
1. [Virtual Nodes](#virtual-nodes)
13-
1. [Core Utilities](#core-utilities)
9+
1. [Rules](#rules)
10+
1. [Checks](#checks)
11+
1. [Common Functions](#common-functions)
12+
1. [Virtual Nodes](#virtual-nodes)
13+
1. [Core Utilities](#core-utilities)
1414
1. [Virtual DOM APIs](#virtual-dom-apis)
15-
1. [API Name: axe.utils.getFlattenedTree](#api-name-axeutilsgetflattenedtree)
16-
1. [API Name: axe.utils.getNodeFromTree](#api-name-axeutilsgetnodefromtree)
15+
1. [API Name: axe.utils.getFlattenedTree](#api-name-axeutilsgetflattenedtree)
16+
1. [API Name: axe.utils.getNodeFromTree](#api-name-axeutilsgetnodefromtree)
1717
1. [Test Utilities](#test-utilities)
18-
1. [Test Util Name: axe.testUtils.MockCheckContext](#test-util-name-axetestutilsmockcheckcontext)
19-
1. [Test Util Name: axe.testUtils.shadowSupport](#test-util-name-axetestutilsshadowsupport)
20-
1. [Test Util Name: axe.testUtils.fixtureSetup](#test-util-name-axetestutilsfixturesetup)
21-
1. [Test Util Name: axe.testUtils.checkSetup](#test-util-name-axetestutilschecksetup)
18+
1. [Test Util Name: axe.testUtils.MockCheckContext](#test-util-name-axetestutilsmockcheckcontext)
19+
1. [Test Util Name: axe.testUtils.shadowSupport](#test-util-name-axetestutilsshadowsupport)
20+
1. [Test Util Name: axe.testUtils.fixtureSetup](#test-util-name-axetestutilsfixturesetup)
21+
1. [Test Util Name: axe.testUtils.checkSetup](#test-util-name-axetestutilschecksetup)
2222

2323
## Getting Started
2424

2525
### Environment Pre-requisites
2626

27-
1. You must have NodeJS installed.
28-
2. Grunt must be installed globally. `npm install -g grunt-cli` (You may need to do this as `sudo npm install -g grunt-cli`)
29-
3. Install npm development dependencies. In the root folder of your axe-core repository, run `npm install`
27+
1. You must have NodeJS installed.
28+
2. Grunt must be installed globally. `npm install -g grunt-cli` (You may need to do this as `sudo npm install -g grunt-cli`)
29+
3. Install npm development dependencies. In the root folder of your axe-core repository, run `npm install`
3030

3131
### Building axe.js
3232

@@ -38,12 +38,11 @@ To run all tests from the command line you can run `grunt test`, which will run
3838

3939
You can also load tests in any supported browser, which is helpful for debugging. Tests require a local server to run, you must first start a local server to serve files. You can use Grunt to start one by running `grunt dev`. Once your local server is running you can load the following pages in any browser to run tests:
4040

41-
42-
1. [Core Tests](../test/core/)
43-
2. [Commons Tests](../test/commons/)
44-
3. [Check Tests](../test/checks/)
45-
4. [Integration Tests](../test/integration/rules/)
46-
5. There are additional tests located in [test/integration/full/](../test/integration/full/) for tests that need to be run against their own document.
41+
1. [Core Tests](../test/core/)
42+
2. [Commons Tests](../test/commons/)
43+
3. [Check Tests](../test/checks/)
44+
4. [Integration Tests](../test/integration/rules/)
45+
5. There are additional tests located in [test/integration/full/](../test/integration/full/) for tests that need to be run against their own document.
4746

4847
## Architecture Overview
4948

@@ -53,7 +52,6 @@ Upon execution, a Rule runs each of its Checks against all relevant nodes. Which
5352

5453
After execution, a Check will return `true` or `false` depending on whether or not the tested condition was satisfied. The result, as well as more information on what caused the Check to pass or fail, will be stored in either the `passes` array or the `violations` array.
5554

56-
5755
### Rules
5856

5957
Rules are defined by JSON files in the [lib/rules directory](../lib/rules). The JSON object is used to seed the [Rule object](../lib/core/base/rule.js#L30). A valid Rule JSON consists of the following:
@@ -66,9 +64,9 @@ Rules are defined by JSON files in the [lib/rules directory](../lib/rules). The
6664
* `matches` - **optional** `String` Relative path to the JavaScript file of a custom matching function. See [matches function](#matches-function) for more information.
6765
* `tags` - **optional** `Array` Strings of the accessibility guidelines of which the Rule applies.
6866
* `metadata` - `Object` Consisting of:
69-
* `description` - `String` Text string that describes what the rule does.
70-
* `helpUrl` - `String` **optional** URL that provides more information about the specifics of the violation. Links to a page on the Deque University site.
71-
* `help` - `String` Help text that describes the test that was performed.
67+
* `description` - `String` Text string that describes what the rule does.
68+
* `helpUrl` - `String` **optional** URL that provides more information about the specifics of the violation. Links to a page on the Deque University site.
69+
* `help` - `String` Help text that describes the test that was performed.
7270
* `any` - `Array` Checks that make up this Rule; one of these checks must return `true` for a Rule to pass.
7371
* `all` - `Array` Checks that make up this Rule; all these checks must return `true` for a Rule to pass.
7472
* `none` - `Array` Checks that make up this Rule; none of these checks must return `true` for a Rule to pass.
@@ -97,11 +95,11 @@ Similar to Rules, Checks are defined by JSON files in the [lib/checks directory]
9795
* `after` - **optional** `String` Relative path to the JavaScript file which contains the function body of a Check's after (or post-processing) function.f
9896
* `options` - **optional** `Mixed` Any information the Check needs that you might need to customize and/or is locale specific. Options can be overridden at runtime (with the options parameter) or config-time. For example, the [valid-lang](../lib/checks/language/valid-lang.json) Check defines what ISO 639-1 language codes it should accept as valid. Options do not need to follow any specific format or type; it is up to the author of a Check to determine the most appropriate format.
9997
* `metadata` - `Object` Consisting of:
100-
* `impact` - `String` (one of `minor`, `moderate`, `serious`, or `critical`)
101-
* `messages` - `Object` These messages are displayed when the Check passes or fails
102-
* `pass` - `String` [doT.js](http://olado.github.io/doT/) template string displayed when the Check passes
103-
* `fail` - `String` [doT.js](http://olado.github.io/doT/) template string displayed when the Check fails
104-
* `incomplete` – `String|Object` – [doT.js](http://olado.github.io/doT/) template string displayed when the Check is incomplete OR an object with `missingData` on why it returned incomplete. Refer to [rules.md](./rules.md).
98+
* `impact` - `String` (one of `minor`, `moderate`, `serious`, or `critical`)
99+
* `messages` - `Object` These messages are displayed when the Check passes or fails
100+
* `pass` - `String` [doT.js](http://olado.github.io/doT/) template string displayed when the Check passes
101+
* `fail` - `String` [doT.js](http://olado.github.io/doT/) template string displayed when the Check fails
102+
* `incomplete``String|Object`[doT.js](http://olado.github.io/doT/) template string displayed when the Check is incomplete OR an object with `missingData` on why it returned incomplete. Refer to [rules.md](./rules.md).
105103

106104
#### Check `evaluate`
107105

@@ -132,11 +130,11 @@ The after function must return an `Array` of CheckResults, due to this, it is a
132130
```javascript
133131
var uniqueIds = [];
134132
return results.filter(function (r) {
135-
if (uniqueIds.indexOf(r.data) === -1) {
136-
uniqueIds.push(r.data);
137-
return true;
138-
}
139-
return false;
133+
if (uniqueIds.indexOf(r.data) === -1) {
134+
uniqueIds.push(r.data);
135+
return true;
136+
}
137+
return false;
140138
});
141139
```
142140

@@ -245,12 +243,11 @@ The queue function creates an asynchronous "queue", list of functions to be invo
245243
* `then(callback)` The callback to execute once all "deferred" functions have completed. Will only be invoked once.
246244
* `abort()` Abort the "queue" and prevent `then` function from firing
247245

248-
249246
#### DqElement Class
250247

251248
The DqElement is a "serialized" `HTMLElement`. It will calculate the CSS selector, grab the source outerHTML and offer an array for storing frame paths. The DqElement class takes the following parameters:
252-
* `Element` - `HTMLElement` The element to serialize
253-
* `Spec` - `Object` Properties to use in place of the element when instantiated on Elements from other frames
249+
* `Element` - `HTMLElement` The element to serialize
250+
* `Spec` - `Object` Properties to use in place of the element when instantiated on Elements from other frames
254251

255252
```javascript
256253
var firstH1 = document.getElementByTagName('h1')[0];
@@ -263,7 +260,6 @@ Elements returned by the DqElement class have the following methods and properti
263260
* `element` - `DOMNode` The element which this object is based off or the containing frame, used for sorting.
264261
* `toJSON()` - Returns an object containing the selector and source properties
265262

266-
267263
## Virtual DOM APIs
268264

269265
Note: You shouldn’t need the Shadow DOM APIs below unless you’re working on the axe-core
@@ -286,8 +282,9 @@ axe.utils.getFlattenedTree(element, shadowId)
286282
```
287283

288284
#### Parameters
289-
- `node` – HTMLElement. The current HTML node for which you want a flattened DOM tree.
290-
- `shadowId` – string(optional). ID of the shadow DOM that is the closest shadow ancestor of the node
285+
286+
- `node` – HTMLElement. The current HTML node for which you want a flattened DOM tree.
287+
- `shadowId` – string(optional). ID of the shadow DOM that is the closest shadow ancestor of the node
291288

292289
#### Returns
293290

0 commit comments

Comments
 (0)