Skip to content

Commit

Permalink
style: prettier for formatting JSON, MD, JS and TS files (dequelabs#1229
Browse files Browse the repository at this point in the history
)

This PR does the below:
- Put `prettier` to work for `json, md, js, ts` files.
- Remove usage of `grunt-markdownlint`.

Main changes are here - https://github.com/dequelabs/axe-core/compare/prettier-update?expand=1#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R68

Closes issue: NA

## Reviewer checks

**Required fields, to be filled out by PR reviewer(s)**
- [x] Follows the commit message policy, appropriate for next version
- [x] Has documentation updated, a DU ticket, or requires no documentation change
- [x] Includes new tests, or was unnecessary
- [x] Code is reviewed for security by: @WilcoFiers
  • Loading branch information
jeeyyy authored and WilcoFiers committed Nov 20, 2018
1 parent 2a6fedf commit 05e4f82
Show file tree
Hide file tree
Showing 245 changed files with 6,231 additions and 6,087 deletions.
18 changes: 0 additions & 18 deletions .markdownlint.json

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
788 changes: 387 additions & 401 deletions CHANGELOG.md

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ We expect all code to be 100% covered by tests. We don't have or want code cover

Functions should contain a preceding comment block with [jsdoc](http://usejsdoc.org/) style documentation of the function. For example:

```javascript
```js
/**
* Runs the Audit; which in turn should call `run` on each rule.
* @async
Expand All @@ -54,7 +54,7 @@ Functions should contain a preceding comment block with [jsdoc](http://usejsdoc.

Classes should contain a jsdoc comment block for each attribute. For example:

```javascript
```js
/**
* Constructor for the result of checks
* @param {Object} check CheckResult specification
Expand Down Expand Up @@ -132,19 +132,19 @@ tsc --noImplicitAny typings/axe-core/axe-core-tests.ts

Installing aXe to run accessibility tests in your TypeScript project should be as simple as importing the module:

```javascript
```js
import * as axe from 'axe-core';

describe('Module', () => {
it('should have no accessibility violations', (done) => {
axe.run(compiledFixture)
.then((results) => {
expect(results.violations.length).toBe(0);
done()
}, done);
it('should have no accessibility violations', done => {
axe.run(compiledFixture).then(results => {
expect(results.violations.length).toBe(0);
done();
}, done);
});
});
```

## Debugging tests that only fail on CircleCI

First install an X-Windows client on your machine. XQuartz is a good one.
Expand Down
12 changes: 1 addition & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-parallel');
grunt.loadNpmTasks('grunt-markdownlint');
grunt.loadNpmTasks('grunt-run');
grunt.loadTasks('build/tasks');

Expand Down Expand Up @@ -345,14 +344,6 @@ module.exports = function(grunt) {
cmd: 'npm',
args: ['run', 'eslint']
}
},
markdownlint: {
all: {
options: {
config: grunt.file.readJSON('.markdownlint.json')
},
src: ['README.md', '.github/*.md', 'doc/**/*.md']
}
}
});

Expand Down Expand Up @@ -382,8 +373,7 @@ module.exports = function(grunt) {
'fixture',
'connect',
'mocha',
'parallel',
'markdownlint'
'parallel'
]);

grunt.registerTask('ci-build', [
Expand Down
59 changes: 30 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ npm install axe-core --save-dev

Now include the javascript file in each of your iframes in your fixtures or test systems:

```html
<script src="node_modules/axe-core/axe.min.js" ></script>
```
<script src="node_modules/axe-core/axe.min.js"></script>
```

Now insert calls at each point in your tests where a new piece of UI becomes visible or exposed:
Expand All @@ -68,11 +68,11 @@ axe.run(function (err, results) {

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

* Microsoft Edge v40 and above
* Google Chrome v42 and above
* Mozilla Firefox v38 and above
* Apple Safari v7 and above
* Internet Explorer v9, 10, 11
- Microsoft Edge v40 and above
- Google Chrome v42 and above
- Mozilla Firefox v38 and above
- Apple Safari v7 and above
- Internet Explorer v9, 10, 11

Support means that we will fix bugs and attempt to test each browser regularly. Only Firefox and Chrome are currently tested on every pull request.

Expand All @@ -86,8 +86,8 @@ The complete list of rules run by axe-core can be found in [doc/rule-description

The [aXe API](doc/API.md) package consists of:

* `axe.js` - the JavaScript file that should be included in your web site under test (API)
* `axe.min.js` - a minified version of the above file
- `axe.js` - the JavaScript file that should be included in your web site under test (API)
- `axe.min.js` - a minified version of the above file

## Localization

Expand All @@ -105,26 +105,27 @@ Additionally, locale can be applied at runtime by passing a `locale` object to `

```js
axe.configure({
locale: {
lang: 'de',
rules: {
accesskeys: {
help: 'Der Wert des accesskey-Attributes muss einzigartig sein.'
},
// ...
},
checks: {
abstractrole: {
fail: 'Abstrakte ARIA-Rollen dürfen nicht direkt verwendet werden.'
},
'aria-errormessage': {
// Note: doT (https://github.com/olado/dot) templates are supported here.
fail: 'Der Wert der aria-errormessage {{~it.data:value}} `{{=value}}{{~}}` muss eine Technik verwenden, um die Message anzukündigen (z. B., aria-live, aria-describedby, role=alert, etc.).'
}
// ...
}
}
})
locale: {
lang: 'de',
rules: {
accesskeys: {
help: 'Der Wert des accesskey-Attributes muss einzigartig sein.'
}
// ...
},
checks: {
abstractrole: {
fail: 'Abstrakte ARIA-Rollen dürfen nicht direkt verwendet werden.'
},
'aria-errormessage': {
// Note: doT (https://github.com/olado/dot) templates are supported here.
fail:
'Der Wert der aria-errormessage {{~it.data:value}} `{{=value}}{{~}}` muss eine Technik verwenden, um die Message anzukündigen (z. B., aria-live, aria-describedby, role=alert, etc.).'
}
// ...
}
}
});
```

## Supported ARIA Roles and Attributes.
Expand Down
82 changes: 38 additions & 44 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,40 @@
{
"name": "axe-core",
"version": "3.1.2",
"contributors": [
{
"name": "David Sturley",
"organization": "Deque Systems, Inc.",
"url": "http://deque.com/"
},
{
"name": "Dylan Barrell",
"organization": "Deque Systems, Inc.",
"url": "http://deque.com/"
},
{
"name": "Wilco Fiers",
"organization": "Deque Systems, Inc.",
"url": "http://deque.com/"
},
{
"name": "Dian Fay",
"organization": "Deque Systems, Inc.",
"url": "http://deque.com/"
},
{
"name": "Marcy Sutton",
"organization": "Deque Systems, Inc.",
"url": "http://deque.com/"
}
],
"repository": {
"type": "git",
"url": "https://github.com/dequelabs/axe-core.git"
},
"main": "axe.js",
"typings": "axe.d.ts",
"license": "MPL-2.0",
"ignore": [
"**/.*",
"node_modules",
"test",
"build",
"typings"
],
"devDependencies": {}
"name": "axe-core",
"version": "3.1.2",
"contributors": [
{
"name": "David Sturley",
"organization": "Deque Systems, Inc.",
"url": "http://deque.com/"
},
{
"name": "Dylan Barrell",
"organization": "Deque Systems, Inc.",
"url": "http://deque.com/"
},
{
"name": "Wilco Fiers",
"organization": "Deque Systems, Inc.",
"url": "http://deque.com/"
},
{
"name": "Dian Fay",
"organization": "Deque Systems, Inc.",
"url": "http://deque.com/"
},
{
"name": "Marcy Sutton",
"organization": "Deque Systems, Inc.",
"url": "http://deque.com/"
}
],
"repository": {
"type": "git",
"url": "https://github.com/dequelabs/axe-core.git"
},
"main": "axe.js",
"typings": "axe.d.ts",
"license": "MPL-2.0",
"ignore": ["**/.*", "node_modules", "test", "build", "typings"],
"devDependencies": {}
}
4 changes: 2 additions & 2 deletions build/tasks/test-webdriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ module.exports = function(grunt) {
}

/*
* Build web driver depends whether REMOTE_SELENIUM_URL is set
*/
* Build web driver depends whether REMOTE_SELENIUM_URL is set
*/
function buildWebDriver(browser) {
var webdriver, capabilities;
var mobileBrowser = browser.split('-mobile');
Expand Down
Loading

0 comments on commit 05e4f82

Please sign in to comment.