Pa11y Lint Config
Linter configurations for Pa11y projects. This module should be used to ensure that the Pa11y coding style is consistent across all of our repositories.
Table Of Contents
Requirements
This library requires Node.js 4+.
Usage
Pa11y Lint Config provides some linter config files which can be included in your project.
ESLint
To use the ESLint config files, first install this module and ESLint, saving them to development dependencies:
npm install --save-dev eslint pa11y-lint-config
Now you should create .eslintrc.js
and .eslintignore
files in your project root. The command below provides some defaults which should be enough for most new Pa11y projects:
printf "coverage\n" > .eslintignore
printf "'use strict';\n\nmodule.exports = require('pa11y-lint-config/eslint/2015');\n" > .eslintrc.js
If your project uses ES5 syntax (should mostly be browser or legacy projects), then you'll need to include eslint/legacy
instead of eslint/2015
:
printf "'use strict';\n\nmodule.exports = require('pa11y-lint-config/eslint/legacy');\n" > .eslintrc.js
If your project uses more modern syntax (including async
/await
), then you'll need to include eslint/2017
instead of eslint/2015
:
printf "'use strict';\n\nmodule.exports = require('pa11y-lint-config/eslint/2017');\n" > .eslintrc.js
If your project contains a mix of ES6 and ES5 (e.g. Node.js and browser) then you can include different config files in each directory.
Contributing
There are many ways to contribute to Pa11y Lint Config, we cover these in the contributing guide for this repo.
If you're ready to contribute some code, clone this repo locally and commit your code on a new branch.
Please check that everything works by running the following before opening a PR:
make ci
Licence
Licensed under the Lesser General Public License (LGPL-3.0).
Copyright © 2017, Team Pa11y