Skip to content

Commit efbb008

Browse files
Lint for ES2020, update deprecated rules, update tooling (#9)
* Remove unused configs `es2009` and `es2015` * Remove deprecated rule `no-catch-shadow` * Ignore `npm pack` debris * Fix `package.main` not being published, and also change main file to `index.js` * Install `eslint-find-rules` and use it to find deprecated rules during `npm test` * Fix duplicated `package.main` * Narrow `package.engines` to LTS * Add `package.keywords` `pa11y`, `eslint`, `javascript`, `es2020` * Install `eslint-plugin-n` and update deprecated Node.js-related rules * Remove anchor links because most don't work * Remove deprecated rules `require-jsdoc`, `valid-jsdoc`, `no-return-await` * `id-blacklist` → `id-denylist` * `lines-around-directive` → `padding-line-between-statements` * `no-new-object` → `no-object-constructor` * Remove deprecated rules `newline-*-*` * Start warning for `prefer-destructuring` (for objects only) * Start warning for `no-multi-assign` and `no-inline-comments` * Rename `es2017.js` to `es2020.js` * Update readme to reflect that module can be imported, and remove mentions of previous levels * Mention peer dependencies * Describe how to test workflows locally * Update lockfile * Ignore folder `.vscode`
1 parent 1e22f86 commit efbb008

9 files changed

+950
-918
lines changed

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
'use strict';
22

3-
module.exports = require('./eslint/es2017');
3+
module.exports = require('./index');

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
# npm debris
12
node_modules
23
npm-debug.log
4+
/package
5+
*.tgz
6+
7+
# Editors
8+
.vscode

README.md

+33-11
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,21 @@ This library requires [Node.js] 18 or above.
2121

2222
## Usage
2323

24-
To include these config files in your project, first install [ESLint] and this module, saving them to development dependencies. For example, using npm:
24+
To include these config files in your project, install this module as a development dependency. Using npm:
2525

2626
```sh
27-
npm install --save-dev eslint pa11y-lint-config
27+
npm install --save-dev pa11y-lint-config
2828
```
2929

30+
The logging will mention any further peer dependencies required.
31+
3032
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:
3133

3234
```sh
3335
printf "coverage\n" > .eslintignore
34-
printf "'use strict';\n\nmodule.exports = require('pa11y-lint-config/eslint/es2017');\n" > .eslintrc.js
36+
printf "'use strict';\n\nmodule.exports = require('pa11y-lint-config');\n" > .eslintrc.js
3537
```
3638

37-
Two other standards can replace `es2017` above:
38-
39-
1. `es2015`, for an ES2015/ES6 project, forgoing the use of more recent syntax additions such as `async`
40-
1. `es2009`, for an ES2009/ES5 project, such as an older client-side codebase
41-
42-
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.
43-
4439
## Contributing
4540

4641
There are many ways to contribute to Pa11y Lint Config, we cover these in the [contributing guide](CONTRIBUTING.md) for this repo.
@@ -53,6 +48,34 @@ Please check that everything works by running the following before opening a <ab
5348
npm test
5449
```
5550

51+
### Testing the GitHub Actions workflows
52+
53+
This project's GitHub Actions workflows can be tested locally using [nektos/act](https://github.com/nektos/act), which can be installed with Homebrew:
54+
55+
```sh
56+
brew install act
57+
```
58+
59+
To run the testing workflow locally:
60+
61+
```sh
62+
act
63+
```
64+
65+
To validate the testing workflow, without running it:
66+
67+
```sh
68+
act --dryrun
69+
```
70+
71+
To validate the publishing workflow:
72+
73+
```sh
74+
act --dryrun release
75+
```
76+
77+
Add `--verbose` to any `act` command for more output.
78+
5679
## Support
5780

5881
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.
@@ -63,7 +86,6 @@ Licensed under the [Lesser General Public License (LGPL-3.0)](LICENSE).<br/>
6386
Copyright &copy; 2023, Team Pa11y
6487

6588

66-
6789
[eslint]: http://eslint.org/
6890
[issues]: https://github.com/pa11y/pa11y-lint-config/issues
6991
[node.js]: https://nodejs.org/

0 commit comments

Comments
 (0)