pa11y-lint-config
Advanced tools
Comparing version 2.0.0 to 3.0.0
{ | ||
"name": "pa11y-lint-config", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Linter configurations for Pa11y projects", | ||
"keywords": [], | ||
"author": "Team Pa11y", | ||
@@ -11,18 +10,15 @@ "contributors": [ | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/pa11y/lint-config.git" | ||
}, | ||
"homepage": "https://github.com/pa11y/lint-config", | ||
"bugs": "https://github.com/pa11y/lint-config/issues", | ||
"repository": "github:pa11y/pa11y-lint-config", | ||
"homepage": "https://github.com/pa11y/pa11y-lint-config", | ||
"bugs": "https://github.com/pa11y/pa11y-lint-config/issues", | ||
"license": "LGPL-3.0", | ||
"engines": { | ||
"node": ">=12" | ||
"node": ">=18" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^7.27.0" | ||
"eslint": "^8.51.0" | ||
}, | ||
"main": "./index.js", | ||
"main": "./.eslintrc.js", | ||
"scripts": { | ||
"test": "make ci" | ||
"test": "eslint ." | ||
}, | ||
@@ -29,0 +25,0 @@ "files": [ |
@@ -1,11 +0,11 @@ | ||
# 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. | ||
Linter configurations for Pa11y projects. We use these configurations to ensure Pa11y's coding style remains consistent across our repositories. | ||
[![NPM version][shield-npm]][info-npm] | ||
[![Latest version published to npm][shield-npm]][info-npm] | ||
[![Node.js version support][shield-node]][info-node] | ||
[![ESLint version target][shield-eslint]][eslint] | ||
[![Build status][shield-build]][info-build] | ||
[![LGPL-3.0 licensed][shield-license]][info-license] | ||
## Table Of Contents | ||
@@ -15,20 +15,13 @@ | ||
- [Usage](#usage) | ||
- [ESLint](#eslint) | ||
- [Contributing](#contributing) | ||
- [License](#license) | ||
## Requirements | ||
This library requires [Node.js] 14+. | ||
This library requires [Node.js] 18 or above. | ||
## Usage | ||
Pa11y Lint Config provides some linter config files which can be included in your project. | ||
To include these config files in your project, first install [ESLint] and this module, saving them to development dependencies. For example, using npm: | ||
### ESLint | ||
To use the [ESLint] config files, first install this module and ESLint, saving them to development dependencies: | ||
```sh | ||
@@ -38,24 +31,16 @@ 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: | ||
Now create the files `.eslintrc.js` and `.eslintignore` in your project root. The following command will create both files and populate them with sensible settings for a new Pa11y project: | ||
```sh | ||
printf "coverage\n" > .eslintignore | ||
printf "'use strict';\n\nmodule.exports = require('pa11y-lint-config/eslint/2015');\n" > .eslintrc.js | ||
printf "'use strict';\n\nmodule.exports = require('pa11y-lint-config/eslint/es2017');\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`: | ||
Two other standards can replace `es2017` above: | ||
```sh | ||
printf "'use strict';\n\nmodule.exports = require('pa11y-lint-config/eslint/legacy');\n" > .eslintrc.js | ||
``` | ||
1. `es2015`, for an ES2015/ES6 project, forgoing the use of more recent syntax additions such as `async` | ||
1. `es2009`, for an ES2009/ES5 project, such as an older client-side codebase | ||
If your project uses more modern syntax (including `async`/`await`), then you'll need to include `eslint/2017` instead of `eslint/2015`: | ||
A project which contains more than one standard, for example ES2017 for the server and ES2015 for the browser, can support each required standard by including a different config file in each relevant subdirectory. | ||
```sh | ||
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 | ||
@@ -70,10 +55,13 @@ | ||
```sh | ||
make ci | ||
npm test | ||
``` | ||
## Support | ||
When we release a new major version we will continue to support the previous major version for 6 months. This support will be limited to fixes for critical bugs and security issues. | ||
## Licence | ||
Licensed under the [Lesser General Public License (LGPL-3.0)](LICENSE).<br/> | ||
Copyright © 2020, Team Pa11y | ||
Copyright © 2023, Team Pa11y | ||
@@ -85,9 +73,11 @@ | ||
[node.js]: https://nodejs.org/ | ||
[twitter]: https://twitter.com/pa11yorg | ||
[info-build]: https://github.com/pa11y/pa11y-lint-config/actions/workflows/tests.yml | ||
[info-license]: LICENSE | ||
[info-npm]: https://www.npmjs.com/package/pa11y-ci | ||
[info-build]: https://travis-ci.org/pa11y/pa11y-lint-config | ||
[shield-license]: https://img.shields.io/badge/license-LGPL%203.0-blue.svg | ||
[shield-npm]: https://img.shields.io/npm/v/pa11y-lint-config.svg | ||
[shield-build]: https://img.shields.io/travis/pa11y/pa11y-lint-config/master.svg | ||
[info-node]: package.json | ||
[info-npm]: https://www.npmjs.com/package/pa11y-lint-config | ||
[shield-build]: https://github.com/pa11y/pa11y-lint-config/actions/workflows/tests.yml/badge.svg | ||
[shield-eslint]: https://img.shields.io/npm/dependency-version/pa11y-lint-config/dev/eslint | ||
[shield-license]: https://img.shields.io/badge/license-LGPL%203.0-blue | ||
[shield-node]: https://img.shields.io/node/v/pa11y-lint-config | ||
[shield-npm]: https://img.shields.io/npm/v/pa11y-lint-config |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
36127
6
1250
80
1