Skip to content

Commit 46528ae

Browse files
Convert to ESLint Shareable Config, eslint-config-pa11y (#11)
* Set `package.name` to `eslint-config-pa11y` from `pa11y-lint-config` * Add test job `use-in-a-client-project` * Shorten `packed-eslint-config-pa11y` to `packed` * Rename `client-project` to `some-project` and fix working directory bug * Improve naming * In CI use `setup-node@v4`, as in `pa11y` * In CI use quoteless YAML descriptions, as in `pa11y`
1 parent efbb008 commit 46528ae

File tree

4 files changed

+42
-7
lines changed

4 files changed

+42
-7
lines changed

.github/workflows/publish.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
dryRun:
7-
description: 'Dry run only'
7+
description: Dry run only
88
required: true
99
default: true
1010
type: boolean
@@ -14,10 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17-
- uses: actions/setup-node@v3
17+
- uses: actions/setup-node@v4
1818
with:
1919
node-version: 20
20-
registry-url: 'https://registry.npmjs.org'
20+
registry-url: https://registry.npmjs.org
2121
- run: npm ci
2222

2323
- name: Publish package

.github/workflows/tests.yml

+36-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,43 @@ jobs:
1212
node-version: [18, 20]
1313
steps:
1414
- uses: actions/checkout@v4
15-
- uses: actions/setup-node@v3
15+
- uses: actions/setup-node@v4
1616
with:
1717
node-version: ${{ matrix.node-version }}
1818
- run: npm ci
1919
- run: npm test
20+
21+
use-in-a-client-project:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
node-version: [18, 20]
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
- run: npm ci
32+
- name: Pack our shareable config
33+
run: |
34+
mkdir ${{ runner.temp }}/packed
35+
npm pack --pack-destination ${{ runner.temp }}/packed
36+
37+
- name: Create a client project
38+
working-directory: ${{ runner.temp }}
39+
run: |
40+
mkdir some-project
41+
cd some-project
42+
npm init -y
43+
touch index.js
44+
45+
- name: Install our config in the client project
46+
working-directory: ${{ runner.temp }}/some-project
47+
run: |
48+
npm install --save-dev ../packed/*.tgz
49+
50+
- name: Use shareable config (also checks peer dependencies)
51+
working-directory: ${{ runner.temp }}/some-project
52+
run: |
53+
echo '{ "extends": "pa11y" }' > .eslintrc.json
54+
npx --no eslint .

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "pa11y-lint-config",
2+
"name": "eslint-config-pa11y",
33
"version": "3.0.0",
44
"description": "Linter configurations for Pa11y projects",
55
"author": "Team Pa11y",

0 commit comments

Comments
 (0)