Skip to content

Commit 166e37c

Browse files
authored
feat: bundle in CJS and ESM formats (#1130)
1 parent 9c78006 commit 166e37c

File tree

108 files changed

+1326
-914
lines changed

Some content is hidden

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

108 files changed

+1326
-914
lines changed

.eslint-doc-generatorrc.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
const prettier = require('prettier');
2-
3-
const prettierConfig = require('./.prettierrc.js');
1+
import * as prettier from 'prettier';
42

53
/** @type {import('eslint-doc-generator').GenerateOptions} */
6-
const config = {
4+
export default {
75
ignoreConfig: [
86
'flat/angular',
97
'flat/dom',
@@ -12,8 +10,8 @@ const config = {
1210
'flat/svelte',
1311
'flat/vue',
1412
],
15-
postprocess: (content) =>
16-
prettier.format(content, { ...prettierConfig, parser: 'markdown' }),
13+
postprocess: async (content, path) => {
14+
const prettierConfig = await prettier.resolveConfig(path);
15+
return prettier.format(content, { ...prettierConfig, parser: 'markdown' });
16+
},
1717
};
18-
19-
module.exports = config;

.github/workflows/smoke-test.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
name: Smoke test
22

33
on:
4-
schedule:
4+
schedule: # Every Sunday at midnight
55
- cron: '0 0 * * SUN'
6-
workflow_dispatch:
6+
workflow_dispatch: # Manual trigger
77
release:
88
types: [published]
99

10+
permissions:
11+
issues: write # To create issues for test results
12+
1013
jobs:
1114
test:
1215
runs-on: ubuntu-latest
@@ -27,12 +30,8 @@ jobs:
2730
pnpm install
2831
pnpm run build
2932
30-
- run: pnpm link
31-
working-directory: ./dist
32-
33-
- run: pnpm link eslint-plugin-testing-library
34-
3533
- uses: AriPerkkio/eslint-remote-tester-run-action@v4
3634
with:
37-
issue-title: 'Results of weekly scheduled smoke test'
38-
eslint-remote-tester-config: tests/eslint-remote-tester.config.js
35+
issue-title: 'Results of smoke test'
36+
issue-label: 'smoke-test'
37+
eslint-remote-tester-config: eslint-remote-tester.config.ts

.github/workflows/verifications.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
validation-script:
17-
['lint', 'type-check', 'format:check', 'generate-all:check']
17+
[
18+
'lint',
19+
'type-check',
20+
'format:check',
21+
'validate-gen-all',
22+
'bundle-check',
23+
]
1824
steps:
1925
- name: Checkout
2026
uses: actions/checkout@v6
@@ -41,8 +47,8 @@ jobs:
4147
strategy:
4248
fail-fast: false
4349
matrix:
44-
node: [18.18.0, 18, 20.9.0, 20, 21.1.0, 21, 22, 23]
45-
eslint: [8.57.0, 8, 9]
50+
node: [18, 20, 21, 22, 23]
51+
eslint: [8, 9]
4652
steps:
4753
- name: Checkout
4854
uses: actions/checkout@v6

.releaserc.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ Based on [ESLint's Rule Naming Conventions](https://eslint.org/docs/developer-gu
5757
In the [same way as ESLint](https://eslint.org/docs/developer-guide/working-with-rules),
5858
each rule has three files named with its identifier (e.g. `no-debugging-utils`):
5959
60-
- in the `lib/rules` directory: a source file (e.g. `no-debugging-utils.ts`)
61-
- in the `tests/lib/rules` directory: a test file (e.g. `no-debugging-utils.ts`)
60+
- in the `src/rules` directory: a source file (e.g. `no-debugging-utils.ts`)
61+
- in the `tests/rules` directory: a test file (e.g. `no-debugging-utils.ts`)
6262
- in the `docs/rules` directory: a Markdown documentation file (e.g. `no-debugging-utils.md`)
6363
6464
Additionally, you need to do a couple of extra things:
6565
66-
- Run `pnpm run generate:rules-doc` to include your rule in the "Supported Rules" table within the [README.md](./README.md)
66+
- Run `pnpm run generate:docs` to include your rule in the "Supported Rules" table within the [README.md](./README.md)
6767
6868
### Custom rule creator
6969

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module.exports = {
1+
export default {
22
extends: ['@commitlint/config-conventional'],
33
};

eslint-remote-tester.config.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import {
2+
getPathIgnorePattern,
3+
getRepositories,
4+
} from 'eslint-remote-tester-repositories';
5+
import { parser } from 'typescript-eslint';
6+
7+
import testingLibraryPlugin from './src';
8+
9+
import type { Config } from 'eslint-remote-tester';
10+
11+
const eslintRemoteTesterConfig: Config = {
12+
repositories: getRepositories({ randomize: true }),
13+
pathIgnorePattern: getPathIgnorePattern(),
14+
extensions: ['js', 'jsx', 'ts', 'tsx'],
15+
concurrentTasks: 3,
16+
cache: false,
17+
logLevel: 'info',
18+
eslintConfig: [
19+
{
20+
plugins: { 'testing-library': testingLibraryPlugin },
21+
rules: {
22+
...Object.fromEntries(
23+
Object.keys(testingLibraryPlugin.rules).map((rule) => [
24+
`testing-library/${rule}`,
25+
'error',
26+
])
27+
),
28+
29+
// Rules with required options without default values
30+
'testing-library/consistent-data-testid': [
31+
'error',
32+
{ testIdPattern: '^{fileName}(__([A-Z]+[a-z]_?)+)_$' },
33+
],
34+
},
35+
},
36+
{ languageOptions: { parser } },
37+
] as Config['eslintConfig'],
38+
};
39+
40+
export default eslintRemoteTesterConfig;
File renamed without changes.

index.d.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

lib/index.ts

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)