Skip to content

Commit d4f39e2

Browse files
annervisserrenovate[bot]
authored andcommitted
Upgrade to eslint flat config
1 parent b69abd5 commit d4f39e2

File tree

6 files changed

+140
-48
lines changed

6 files changed

+140
-48
lines changed

e2e-test/.eslintrc.js

-29
This file was deleted.

e2e-test/eslint.config.mjs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import globals from 'globals';
2+
import pluginJs from '@eslint/js';
3+
import tseslint from 'typescript-eslint';
4+
import playwright from 'eslint-plugin-playwright';
5+
import eslintConfigPrettier from 'eslint-config-prettier';
6+
7+
/** @type { import("eslint").Linter.Config[] } */
8+
export default [
9+
{ files: ['**/*.{js,mjs,cjs,ts}'] },
10+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access
11+
{ languageOptions: { globals: globals.node } },
12+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
13+
pluginJs.configs.recommended,
14+
eslintConfigPrettier,
15+
playwright.configs['flat/recommended'],
16+
...tseslint.configs.strictTypeChecked,
17+
{
18+
languageOptions: {
19+
parserOptions: {
20+
projectService: {
21+
allowDefaultProject: ['eslint.config.mjs'],
22+
},
23+
tsconfigRootDir: import.meta.dirname,
24+
},
25+
},
26+
},
27+
{
28+
rules: {
29+
'@typescript-eslint/no-unused-vars': [
30+
'error',
31+
{
32+
argsIgnorePattern: '^_',
33+
},
34+
],
35+
},
36+
},
37+
];

e2e-test/helpers/CLI.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ export class CLI {
1818
await this.page.keyboard.press(key);
1919
}
2020

21-
async command(command: string): Promise<void>;
22-
async command(commands: string[]): Promise<void>;
2321
async command(commands: string | string[]): Promise<void> {
2422
commands = typeof commands === 'string' ? [commands] : commands;
2523
for (const command of commands) {
@@ -34,6 +32,6 @@ export class CLI {
3432

3533
async assertExitCode(code: number) {
3634
await this.command('echo $?'); // get exit code
37-
await expect(this.lineN(-2)).toHaveText(`${code}`);
35+
await expect(this.lineN(-2)).toHaveText(code.toString());
3836
}
3937
}

e2e-test/helpers/cli-test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect, test as base } from '@playwright/test';
22
import { CLI } from '@helpers/CLI';
33

4-
export const test = base.extend<{ cli: CLI; _tmpdir: void }>({
4+
export const test = base.extend<{ cli: CLI; _tmpdir: undefined }>({
55
cli: async ({ page }, use) => {
66
await page.goto('/');
77
await expect(page).toHaveTitle(/bash/);

e2e-test/package-lock.json

+93-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e-test/package.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@
1111
"fix:prettier": "prettier --write ."
1212
},
1313
"devDependencies": {
14+
"@eslint/js": "^9.10.0",
1415
"@playwright/test": "1.47.1",
16+
"@types/eslint": "^9.6.1",
17+
"@types/eslint__js": "^8.42.3",
1518
"@types/node": "20.16.5",
1619
"@typescript-eslint/eslint-plugin": "8.6.0",
1720
"@typescript-eslint/parser": "8.6.0",
18-
"eslint": "9.10.0",
21+
"eslint": "^9.10.0",
1922
"eslint-config-prettier": "9.1.0",
2023
"eslint-plugin-playwright": "1.6.2",
24+
"globals": "^15.9.0",
2125
"npm-run-all2": "6.2.3",
22-
"prettier": "3.3.3"
26+
"prettier": "3.3.3",
27+
"typescript": "^5.6.2",
28+
"typescript-eslint": "^8.6.0"
2329
}
2430
}

0 commit comments

Comments
 (0)