Skip to content

Commit 7ab273d

Browse files
committed
Merge upstream/main into feature branch
2 parents bfbd457 + acc0acd commit 7ab273d

File tree

90 files changed

+8049
-30915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+8049
-30915
lines changed

.all-contributorsrc

+18
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,24 @@
689689
"code",
690690
"test"
691691
]
692+
},
693+
{
694+
"login": "nostrorom",
695+
"name": "nostro",
696+
"avatar_url": "https://avatars.githubusercontent.com/u/49858211?v=4",
697+
"profile": "https://github.com/nostrorom",
698+
"contributions": [
699+
"code"
700+
]
701+
},
702+
{
703+
"login": "danielrentz",
704+
"name": "Daniel Rentz",
705+
"avatar_url": "https://avatars.githubusercontent.com/u/5064304?v=4",
706+
"profile": "https://github.com/danielrentz",
707+
"contributions": [
708+
"doc"
709+
]
692710
}
693711
],
694712
"contributorsPerLine": 7,

.eslint-doc-generatorrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const config = {
88
'flat/dom',
99
'flat/marko',
1010
'flat/react',
11+
'flat/svelte',
1112
'flat/vue',
1213
],
1314
postprocess: (content) =>

.eslintrc.js

+2-13
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@ module.exports = {
1414
rules: {
1515
// Base
1616
'max-lines-per-function': 'off',
17-
'no-restricted-imports': [
18-
'error',
19-
{
20-
patterns: [
21-
{
22-
group: ['@typescript-eslint/utils/dist/*'],
23-
message: 'Import from `@typescript-eslint/utils` instead.',
24-
},
25-
],
26-
},
27-
],
2817

2918
// Import
3019
'import/order': [
@@ -51,12 +40,12 @@ module.exports = {
5140
files: ['**/*.ts?(x)'],
5241
parser: '@typescript-eslint/parser',
5342
parserOptions: {
43+
project: './tsconfig.eslint.json',
5444
tsconfigRootDir: __dirname,
55-
project: ['./tsconfig.eslint.json'],
5645
},
5746
extends: [
5847
'plugin:@typescript-eslint/recommended',
59-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
48+
'plugin:@typescript-eslint/recommended-type-checked',
6049
'plugin:import/typescript',
6150
],
6251
rules: {

.github/workflows/release.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,31 @@ permissions:
2323

2424
jobs:
2525
publish:
26-
name: Publish NPM package
26+
name: Publish package
2727
runs-on: ubuntu-latest
2828
# Avoid publishing in forks
2929
if: github.repository == 'testing-library/eslint-plugin-testing-library'
3030
steps:
3131
- name: Checkout
3232
uses: actions/checkout@v4
3333

34+
- name: Install pnpm
35+
uses: pnpm/action-setup@v4
36+
3437
- name: Set up Node
3538
uses: actions/setup-node@v4
3639
with:
37-
cache: npm
40+
cache: 'pnpm'
3841
node-version-file: '.nvmrc'
3942

4043
- name: Install dependencies
41-
run: npm install
44+
run: pnpm install
4245

4346
- name: Build package
44-
run: npm run build
47+
run: pnpm run build
4548

4649
- name: Release new version
47-
run: npx semantic-release
50+
run: pnpm exec semantic-release
4851
env:
4952
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5053
NPM_CONFIG_PROVENANCE: true

.github/workflows/smoke-test.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,23 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v4
1616

17+
- name: Install pnpm
18+
uses: pnpm/action-setup@v4
19+
1720
- name: Use Node
1821
uses: actions/setup-node@v4
1922
with:
23+
cache: 'pnpm'
2024
node-version-file: '.nvmrc'
2125

2226
- run: |
23-
npm install
24-
npm run build
27+
pnpm install
28+
pnpm run build
2529
26-
- run: npm link
30+
- run: pnpm link
2731
working-directory: ./dist
2832

29-
- run: npm link eslint-plugin-testing-library
33+
- run: pnpm link eslint-plugin-testing-library
3034

3135
- uses: AriPerkkio/eslint-remote-tester-run-action@v4
3236
with:

.github/workflows/verifications.yml

+16-28
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,20 @@ jobs:
1616
- name: Checkout
1717
uses: actions/checkout@v4
1818

19+
- name: Install pnpm
20+
uses: pnpm/action-setup@v4
21+
1922
- name: Set up Node
2023
uses: actions/setup-node@v4
2124
with:
22-
cache: npm
25+
cache: 'pnpm'
2326
node-version-file: '.nvmrc'
2427

2528
- name: Install dependencies
26-
run: npm install
29+
run: pnpm install
2730

2831
- name: Run script
29-
run: npm run ${{ matrix.validation-script }}
32+
run: pnpm run ${{ matrix.validation-script }}
3033

3134
tests:
3235
name: Tests (Node v${{ matrix.node }} - ESLint v${{ matrix.eslint }})
@@ -35,46 +38,31 @@ jobs:
3538
strategy:
3639
fail-fast: false
3740
matrix:
38-
node: [12.22.0, 12, 14.17.0, 14, 16, 17, 18, 19, 20, 22]
39-
eslint: [7.5, 7, 8, 9]
40-
exclude:
41-
# eslint@9 doesn't support < Node v18
42-
- node: 17
43-
eslint: 9
44-
- node: 16
45-
eslint: 9
46-
- node: 14
47-
eslint: 9
48-
- node: 14.17.0
49-
eslint: 9
50-
- node: 12
51-
eslint: 9
52-
- node: 12.22.0
53-
eslint: 9
41+
node: [18.18.0, 18, 20.9.0, 20, 21.1.0, 21, 22, 23]
42+
eslint: [8.57.0, 8, 9]
5443
steps:
5544
- name: Checkout
5645
uses: actions/checkout@v4
5746

47+
- name: Install pnpm
48+
uses: pnpm/action-setup@v4
49+
5850
- name: Set up Node
5951
uses: actions/setup-node@v4
6052
with:
61-
cache: npm
53+
cache: 'pnpm'
6254
node-version: ${{ matrix.node }}
6355

6456
- name: Install dependencies
65-
run: npm install
66-
67-
# see https://github.com/npm/cli/issues/7349
68-
- if: ${{ matrix.eslint == 9 }}
69-
run: npm un @typescript-eslint/eslint-plugin eslint-plugin-jest eslint-doc-generator
57+
run: pnpm install
7058

7159
- name: Install ESLint v${{ matrix.eslint }}
72-
run: npm install --no-save --force eslint@${{ matrix.eslint }}
60+
run: pnpm add eslint@${{ matrix.eslint }}
7361

7462
- name: Run tests
75-
run: npm run test:ci
63+
run: pnpm run test:ci
7664

7765
- name: Upload coverage reports to Codecov
78-
uses: codecov/codecov-action@v4
66+
uses: codecov/codecov-action@v5
7967
env:
8068
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ yarn-error.log
6767
# Yarn Integrity file
6868
.yarn-integrity
6969

70-
# Ignore locks other than npm
71-
pnpm-lock.yaml
70+
# Ignore locks other than pnpm
71+
package-lock.json
7272
yarn.lock

.gitpod.yml

-2
This file was deleted.

.husky/commit-msg

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
# Skip commit-msg hook on CI
52
[ -n "$CI" ] && exit 0
63

7-
npx commitlint --edit $1
4+
commitlint --edit $1

.husky/pre-commit

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
# Skip pre-commit hook on CI
52
[ -n "$CI" ] && exit 0
63

7-
npx lint-staged
4+
lint-staged

.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
auto-install-peers=true
22
enable-pre-post-scripts=true
3+
public-hoist-pattern[]=@commitlint*
4+
public-hoist-pattern[]=commitlint

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
22

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ dist
22
node_modules
33
coverage
44
.all-contributorsrc
5+
pnpm-lock.yaml

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Tweaking ESLint rules is mostly about traversing through the AST. [AST Explorer]
1111

1212
1. Fork this repository
1313
2. Clone your forked repository
14-
3. Run `npm install` to install corresponding dependencies
14+
3. Run `pnpm install` to install corresponding dependencies
1515
4. Create a branch for your PR named like `pr/your-branch-name` (you can do this through git CLI with `git checkout -b pr/your-branch-name`)
1616

1717
> Tip: Keep your `main` branch pointing at the original repository and make
@@ -63,7 +63,7 @@ each rule has three files named with its identifier (e.g. `no-debugging-utils`):
6363
6464
Additionally, you need to do a couple of extra things:
6565
66-
- Run `npm run generate:rules-doc` to include your rule in the "Supported Rules" table within the [README.md](./README.md)
66+
- Run `pnpm run generate:rules-doc` to include your rule in the "Supported Rules" table within the [README.md](./README.md)
6767
6868
### Custom rule creator
6969
@@ -99,7 +99,7 @@ If you need some check related to Testing Library which is not available in any
9999
- pass it through `helpers`
100100
- write some generic test within `fake-rule.ts`, which is a dumb rule to be able to test all enhanced behavior from our custom Rule Creator.
101101
102-
Take also into account that we're using our own `recommendedConfig` meta instead of the default `recommended` one. This is done so that our tools can automatically generate (`npm run generate:configs`) our configs.
102+
Take also into account that we're using our own `recommendedConfig` meta instead of the default `recommended` one. This is done so that our tools can automatically generate (`pnpm run generate:configs`) our configs.
103103
104104
## Updating existing rules
105105

0 commit comments

Comments
 (0)