diff --git a/eslint.config.mjs b/eslint.config.mjs index 71d322b9..295a6f97 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -18,51 +18,89 @@ export default tsEslint.config( { plugins: { stylistic, - importPlugin + importPlugin, }, languageOptions: { parser: tsEslint.parser, parserOptions: { - project: true, + project: ['tsconfig.json', 'tsconfig.test.json'], sourceType: 'module', - ecmaVersion: 'latest' - } + ecmaVersion: 'latest', + }, }, rules: { 'stylistic/arrow-parens': ['error', 'always'], 'stylistic/object-curly-spacing': ['error', 'always'], 'stylistic/jsx-pascal-case': 'error', - 'stylistic/jsx-curly-spacing': ['error', { when: 'never', children: true }], + 'stylistic/jsx-curly-spacing': [ + 'error', + { when: 'never', children: true }, + ], 'stylistic/jsx-sort-props': 'error', - 'prettier/prettier': ['error', { singleQuote: true, semi: true, tabWidth: 2, trailingComma: 'all', quoteProps: 'preserve' }], + 'prettier/prettier': [ + 'error', + { + singleQuote: true, + semi: true, + tabWidth: 2, + trailingComma: 'all', + quoteProps: 'preserve', + }, + ], '@typescript-eslint/no-floating-promises': 'off', - '@typescript-eslint/no-misused-promises': ['off', { checksVoidReturn: false }], - '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], + '@typescript-eslint/no-misused-promises': [ + 'off', + { checksVoidReturn: false }, + ], + '@typescript-eslint/no-unused-vars': [ + 'warn', + { argsIgnorePattern: '^_' }, + ], '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/consistent-type-imports': ['error', { - fixStyle: 'inline-type-imports', - prefer: 'type-imports', - disallowTypeAnnotations: false, - }], + '@typescript-eslint/consistent-type-imports': [ + 'error', + { + fixStyle: 'inline-type-imports', + prefer: 'type-imports', + disallowTypeAnnotations: false, + }, + ], 'importPlugin/first': 'error', 'importPlugin/newline-after-import': 'off', 'importPlugin/no-default-export': 'off', 'importPlugin/no-duplicates': 'error', - 'importPlugin/no-unresolved': ['error', { ignore: ['^virtual:', '\\?inline$', '\\?raw$', '\\?asset&asarUnpack'] }], - 'importPlugin/order': ['error', { - 'groups': ['builtin', 'external', ['internal', 'index', 'sibling'], 'parent', 'type'], - 'newlines-between': 'always-and-inside-groups', - 'alphabetize': { order: 'ignore', caseInsensitive: false } - }], + 'importPlugin/no-unresolved': [ + 'error', + { + ignore: ['^virtual:', '\\?inline$', '\\?raw$', '\\?asset&asarUnpack'], + }, + ], + 'importPlugin/order': [ + 'error', + { + 'groups': [ + 'builtin', + 'external', + ['internal', 'index', 'sibling'], + 'parent', + 'type', + ], + 'newlines-between': 'always-and-inside-groups', + 'alphabetize': { order: 'ignore', caseInsensitive: false }, + }, + ], 'importPlugin/prefer-default-export': 'off', 'camelcase': ['error', { properties: 'never' }], 'class-methods-use-this': 'off', - 'stylistic/lines-around-comment': ['error', { - beforeBlockComment: false, - afterBlockComment: false, - beforeLineComment: false, - afterLineComment: false, - }], + 'stylistic/lines-around-comment': [ + 'error', + { + beforeBlockComment: false, + afterBlockComment: false, + beforeLineComment: false, + afterLineComment: false, + }, + ], 'stylistic/max-len': 'off', 'stylistic/no-mixed-operators': 'warn', // prettier does not support no-mixed-operators 'stylistic/no-multi-spaces': ['error', { ignoreEOLComments: true }], @@ -70,16 +108,20 @@ export default tsEslint.config( 'no-void': 'error', 'no-empty': 'off', 'prefer-promise-reject-errors': 'off', - 'stylistic/quotes': ['error', 'single', { - avoidEscape: true, - allowTemplateLiterals: 'never', - }], + 'stylistic/quotes': [ + 'error', + 'single', + { + avoidEscape: true, + allowTemplateLiterals: 'never', + }, + ], 'stylistic/quote-props': ['error', 'consistent'], 'stylistic/semi': ['error', 'always'], }, settings: { 'import/parsers': { - '@typescript-eslint/parser': ['.ts'] + '@typescript-eslint/parser': ['.ts'], }, 'import/resolver': { typescript: {}, diff --git a/package.json b/package.json index bc3708e4..53716493 100644 --- a/package.json +++ b/package.json @@ -168,7 +168,6 @@ "eslint-plugin-solid": "0.14.5", "glob": "11.1.0", "node-gyp": "11.4.2", - "playwright": "1.55.1", "ts-morph": "27.0.2", "typescript": "5.9.3", "typescript-eslint": "8.43.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6f86ade6..1a3ceade 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -343,9 +343,6 @@ importers: node-gyp: specifier: 11.4.2 version: 11.4.2 - playwright: - specifier: 1.55.1 - version: 1.55.1 ts-morph: specifier: 27.0.2 version: 27.0.2 @@ -3902,21 +3899,11 @@ packages: engines: {node: '>=18'} hasBin: true - playwright-core@1.55.1: - resolution: {integrity: sha512-Z6Mh9mkwX+zxSlHqdr5AOcJnfp+xUWLCt9uKV18fhzA8eyxUd8NUWzAjxUh55RZKSYwDGX0cfaySdhZJGMoJ+w==} - engines: {node: '>=18'} - hasBin: true - playwright@1.55.0: resolution: {integrity: sha512-sdCWStblvV1YU909Xqx0DhOjPZE4/5lJsIS84IfN9dAZfcl/CIZ5O8l3o0j7hPMjDvqoTF8ZUcc+i/GL5erstA==} engines: {node: '>=18'} hasBin: true - playwright@1.55.1: - resolution: {integrity: sha512-cJW4Xd/G3v5ovXtJJ52MAOclqeac9S/aGGgRzLabuF8TnIb6xHvMzKIa6JmrRzUkeXJgfL1MhukP0NK6l39h3A==} - engines: {node: '>=18'} - hasBin: true - plist@3.1.0: resolution: {integrity: sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==} engines: {node: '>=10.4.0'} @@ -8933,20 +8920,12 @@ snapshots: playwright-core@1.55.0: {} - playwright-core@1.55.1: {} - playwright@1.55.0: dependencies: playwright-core: 1.55.0 optionalDependencies: fsevents: 2.3.2 - playwright@1.55.1: - dependencies: - playwright-core: 1.55.1 - optionalDependencies: - fsevents: 2.3.2 - plist@3.1.0: dependencies: '@xmldom/xmldom': 0.8.11 diff --git a/tests/index.test.js b/tests/index.test.js index ac158275..5c35a97c 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -1,7 +1,7 @@ import path from 'node:path'; import process from 'node:process'; -import { _electron as electron } from 'playwright'; -import { test, expect } from '@playwright/test'; + +import { test, expect, _electron as electron } from '@playwright/test'; process.env.NODE_ENV = 'test'; @@ -32,7 +32,11 @@ test('Pear Desktop App - With default settings, app is launched and visible', as // expect(title.replaceAll(/\s/g, ' ')).toEqual('Pear Desktop'); const url = window.url(); - expect(url.startsWith('https://music.\u0079\u006f\u0075\u0074\u0075\u0062\u0065.com')).toBe(true); + expect( + url.startsWith( + 'https://music.\u0079\u006f\u0075\u0074\u0075\u0062\u0065.com', + ), + ).toBe(true); await app.close(); }); diff --git a/tsconfig.json b/tsconfig.json index 495cdbd7..e19ac78a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,7 +25,8 @@ "exclude": ["./dist"], "include": [ "electron.vite.config.mts", + "playwright.config.ts", "./src/**/*", - "*.config.*js", + "*.config.*js" ] } diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 00000000..e3414144 --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["./dist"], + "include": [ + "playwright.config.ts", + "./tests/**/*" + ] +}