Skip to content

Commit dd189ac

Browse files
committed
Added eslint.config.mjs file
1 parent b67c761 commit dd189ac

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

eslint.config.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import tseslint from '@typescript-eslint/eslint-plugin';
22
import tsParser from '@typescript-eslint/parser';
33
import prettierPlugin from 'eslint-plugin-prettier';
44
import playwright from 'eslint-plugin-playwright';
5+
import { fileURLToPath } from 'url';
6+
import { dirname } from 'path';
57

68
const prettierConfig = {
79
semi: true,
@@ -15,6 +17,8 @@ const prettierConfig = {
1517
proseWrap: 'preserve',
1618
};
1719

20+
const __dirname = dirname(fileURLToPath(import.meta.url));
21+
1822
const config = [
1923
{
2024
ignores: ['node_modules', 'dist', 'playwright-report', 'test-results'],
@@ -36,8 +40,8 @@ const config = [
3640
playwright,
3741
},
3842
rules: {
39-
...((tseslint.configs.recommended as any).rules ?? {}),
40-
...((playwright.configs['flat/recommended'] as any).rules ?? {}),
43+
...(tseslint.configs.recommended?.rules ?? {}),
44+
...(playwright.configs['flat/recommended']?.rules ?? {}),
4145
'prettier/prettier': ['error', prettierConfig],
4246
'@typescript-eslint/explicit-function-return-type': 'error',
4347
'@typescript-eslint/no-explicit-any': 'error',

0 commit comments

Comments
 (0)