Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
14 changes: 6 additions & 8 deletions .eslint-doc-generatorrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
const prettier = require('prettier');

const prettierConfig = require('./.prettierrc.js');
import * as prettier from 'prettier';

/** @type {import('eslint-doc-generator').GenerateOptions} */
const config = {
export default {
ignoreConfig: [
'flat/angular',
'flat/dom',
Expand All @@ -12,8 +10,8 @@ const config = {
'flat/svelte',
'flat/vue',
],
postprocess: (content) =>
prettier.format(content, { ...prettierConfig, parser: 'markdown' }),
postprocess: async (content, path) => {
const prettierConfig = await prettier.resolveConfig(path);
return prettier.format(content, { ...prettierConfig, parser: 'markdown' });
},
};

module.exports = config;
17 changes: 8 additions & 9 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Smoke test

on:
schedule:
schedule: # Every Sunday at midnight
- cron: '0 0 * * SUN'
workflow_dispatch:
workflow_dispatch: # Manual trigger
release:
types: [published]

permissions:
issues: write # To create issues for test results

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -27,12 +30,8 @@ jobs:
pnpm install
pnpm run build
- run: pnpm link
working-directory: ./dist

- run: pnpm link eslint-plugin-testing-library

- uses: AriPerkkio/eslint-remote-tester-run-action@v4
with:
issue-title: 'Results of weekly scheduled smoke test'
eslint-remote-tester-config: tests/eslint-remote-tester.config.js
issue-title: 'Results of smoke test'
issue-label: 'smoke-test'
eslint-remote-tester-config: eslint-remote-tester.config.ts
12 changes: 9 additions & 3 deletions .github/workflows/verifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ jobs:
fail-fast: false
matrix:
validation-script:
['lint', 'type-check', 'format:check', 'generate-all:check']
[
'lint',
'type-check',
'format:check',
'validate-gen-all',
'bundle-check',
]
steps:
- name: Checkout
uses: actions/checkout@v6
Expand All @@ -41,8 +47,8 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [18.18.0, 18, 20.9.0, 20, 21.1.0, 21, 22, 23]
eslint: [8.57.0, 8, 9]
node: [18, 20, 21, 22, 23]
eslint: [8, 9]
steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down
16 changes: 0 additions & 16 deletions .releaserc.json

This file was deleted.

6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ Based on [ESLint's Rule Naming Conventions](https://eslint.org/docs/developer-gu
In the [same way as ESLint](https://eslint.org/docs/developer-guide/working-with-rules),
each rule has three files named with its identifier (e.g. `no-debugging-utils`):

- in the `lib/rules` directory: a source file (e.g. `no-debugging-utils.ts`)
- in the `tests/lib/rules` directory: a test file (e.g. `no-debugging-utils.ts`)
- in the `src/rules` directory: a source file (e.g. `no-debugging-utils.ts`)
- in the `tests/rules` directory: a test file (e.g. `no-debugging-utils.ts`)
- in the `docs/rules` directory: a Markdown documentation file (e.g. `no-debugging-utils.md`)

Additionally, you need to do a couple of extra things:

- Run `pnpm run generate:rules-doc` to include your rule in the "Supported Rules" table within the [README.md](./README.md)
- Run `pnpm run generate:docs` to include your rule in the "Supported Rules" table within the [README.md](./README.md)

### Custom rule creator

Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
};
40 changes: 40 additions & 0 deletions eslint-remote-tester.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {
getPathIgnorePattern,
getRepositories,
} from 'eslint-remote-tester-repositories';
import { parser } from 'typescript-eslint';

import testingLibraryPlugin from './src';

import type { Config } from 'eslint-remote-tester';

const eslintRemoteTesterConfig: Config = {
repositories: getRepositories({ randomize: true }),
pathIgnorePattern: getPathIgnorePattern(),
extensions: ['js', 'jsx', 'ts', 'tsx'],
concurrentTasks: 3,
cache: false,
logLevel: 'info',
eslintConfig: [
{
plugins: { 'testing-library': testingLibraryPlugin },
rules: {
...Object.fromEntries(
Object.keys(testingLibraryPlugin.rules).map((rule) => [
`testing-library/${rule}`,
'error',
])
),

// Rules with required options without default values
'testing-library/consistent-data-testid': [
'error',
{ testIdPattern: '^{fileName}(__([A-Z]+[a-z]_?)+)_$' },
],
},
},
{ languageOptions: { parser } },
] as Config['eslintConfig'],
};

export default eslintRemoteTesterConfig;
File renamed without changes.
27 changes: 0 additions & 27 deletions index.d.ts

This file was deleted.

76 changes: 0 additions & 76 deletions lib/node-utils/is-node-of-type.ts

This file was deleted.

File renamed without changes.
61 changes: 31 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,41 @@
"testing"
],
"homepage": "https://github.com/testing-library/eslint-plugin-testing-library",
"bugs": {
"url": "https://github.com/testing-library/eslint-plugin-testing-library/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/testing-library/eslint-plugin-testing-library.git"
},
"bugs": "testing-library/eslint-plugin-testing-library/issues",
"repository": "testing-library/eslint-plugin-testing-library",
"license": "MIT",
"author": {
"name": "Mario Beltrán Alarcón",
"email": "me@mario.dev",
"url": "https://mario.dev/"
},
"author": "Mario Beltrán (https://mario.dev)",
"files": [
"dist",
"README.md",
"LICENSE",
"index.d.ts"
"dist"
],
"main": "./dist/index.js",
"types": "index.d.ts",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.cts",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./package.json": "./package.json"
},
"scripts": {
"prebuild": "del-cli dist",
"build": "tsc -p ./tsconfig.build.json",
"build": "tsdown --format esm --format cjs",
"bundle-check": "pnpm run build && publint",
"generate-all": "pnpm run --parallel \"/^generate:.*/\"",
"generate-all:check": "pnpm run generate-all && git diff --exit-code",
"generate:configs": "ts-node tools/generate-configs",
"generate:rules-doc": "pnpm run build && pnpm run rule-doc-generator",
"generate:configs": "jiti tools/generate-configs",
"generate:docs": "pnpm run build && pnpm run eslint-doc-generator",
"validate-gen-all": "pnpm run --parallel \"/^validate-gen:.*/\"",
"validate-gen:configs": "pnpm run generate:configs && git diff --exit-code src/configs",
"validate-gen:docs": "pnpm run build && pnpm run eslint-doc-generator --check",
"format": "pnpm run prettier-base --write",
"format:check": "pnpm run prettier-base --check",
"lint": "eslint --max-warnings 0 .",
"lint:fix": "pnpm run lint --fix",
"prepare": "husky || true",
"prettier-base": "prettier . --ignore-unknown --cache --log-level warn",
"rule-doc-generator": "eslint-doc-generator",
"eslint-doc-generator": "eslint-doc-generator",
"eslint-remote-tester": "eslint-remote-tester --config eslint-remote-tester.config.ts",
"semantic-release": "semantic-release",
"test": "vitest run",
"test:ci": "vitest run --coverage",
Expand All @@ -68,23 +68,24 @@
"@vitest/coverage-v8": "^3.2.4",
"@vitest/eslint-plugin": "^1.5.2",
"@vitest/ui": "3.2.4",
"del-cli": "^6.0.0",
"eslint": "^9.35.0",
"eslint-config-prettier": "^10.1.8",
"eslint-doc-generator": "^2.2.2",
"eslint-doc-generator": "^2.4.0",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import-x": "^4.16.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^7.1.0",
"eslint-remote-tester": "^3.0.1",
"eslint-remote-tester-repositories": "^1.0.1",
"eslint-remote-tester": "^4.0.3",
"eslint-remote-tester-repositories": "^2.0.2",
"globals": "^16.3.0",
"husky": "^9.1.7",
"jiti": "^2.6.1",
"lint-staged": "^15.2.10",
"prettier": "3.6.2",
"publint": "^0.3.16",
"semantic-release": "^25.0.2",
"semver": "^7.6.3",
"ts-node": "^10.9.2",
"tsdown": "^0.17.3",
"typescript": "^5.7.2",
"typescript-eslint": "^8.15.0",
"vitest": "^3.2.4"
Expand All @@ -95,5 +96,5 @@
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"packageManager": "pnpm@9.14.2"
"packageManager": "pnpm@9.15.9"
}
Loading