Skip to content

Commit b75c386

Browse files
committed
chore: move eslint-remote-tester config to ESM
1 parent 1c2adf6 commit b75c386

File tree

3 files changed

+41
-45
lines changed

3 files changed

+41
-45
lines changed

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 './lib';
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;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"prepare": "husky || true",
4646
"prettier-base": "prettier . --ignore-unknown --cache --log-level warn",
4747
"eslint-doc-generator": "eslint-doc-generator",
48+
"eslint-remote-tester": "eslint-remote-tester --config eslint-remote-tester.config.ts",
4849
"semantic-release": "semantic-release",
4950
"test": "vitest run",
5051
"test:ci": "vitest run --coverage",

tests/eslint-remote-tester.config.cjs

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

0 commit comments

Comments
 (0)