Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to ESLint Shareable Config, eslint-config-pa11y #11

Merged
merged 7 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
dryRun:
description: 'Dry run only'
description: Dry run only
required: true
default: true
type: boolean
Expand All @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
registry-url: https://registry.npmjs.org
- run: npm ci

- name: Publish package
Expand Down
37 changes: 36 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,43 @@ jobs:
node-version: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test

use-in-a-client-project:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- name: Pack our shareable config
run: |
mkdir ${{ runner.temp }}/packed
npm pack --pack-destination ${{ runner.temp }}/packed

- name: Create a client project
working-directory: ${{ runner.temp }}
run: |
mkdir some-project
cd some-project
npm init -y
touch index.js

- name: Install our config in the client project
working-directory: ${{ runner.temp }}/some-project
run: |
npm install --save-dev ../packed/*.tgz

- name: Use shareable config (also checks peer dependencies)
working-directory: ${{ runner.temp }}/some-project
run: |
echo '{ "extends": "pa11y" }' > .eslintrc.json
npx --no eslint .
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "pa11y-lint-config",
"name": "eslint-config-pa11y",
"version": "3.0.0",
"description": "Linter configurations for Pa11y projects",
"author": "Team Pa11y",
Expand Down
Loading