Skip to content

[Bug] False throw of valid-title #295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MartinPilny opened this issue Jun 7, 2024 · 2 comments
Closed

[Bug] False throw of valid-title #295

MartinPilny opened this issue Jun 7, 2024 · 2 comments
Labels

Comments

@MartinPilny
Copy link

MartinPilny commented Jun 7, 2024

Let's have following test file

import { TestDetails, test } from '@playwright/test'

test.describe('Suite', () => {
  async function makeTest (testTitle: string, testOptions: TestDetails, urlPath: string) {
    test(testTitle, testOptions, async ({ page }) => {
      await page.goto('www.mywebsite.com/' + urlPath, { waitUntil: 'load' })
    })
  }

  makeTest('Test1', { tag: ['@smoke'] }, 'url_path_1')
  makeTest('Test2', { tag: ['@smoke'] }, 'url_path_2')
  makeTest('Test3', { tag: ['@smoke'] }, 'url_path_3')
})

I get this error
image
which is wrong regarding docs https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/valid-title.md

package version
eslint-plugin-playwright 1.6.2
@playwright/test 1.44.0
@mskelton
Copy link
Member

mskelton commented Jun 9, 2024

@MartinPilny This is not a bug. The Playwright ESLint plugin does not have type information from TypeScript, so it must rely solely on static analysis. Your code is a correct error according to the plugin and should be explicitly ignored with an ESLint disable comment.

@mskelton mskelton closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2024
mskelton added a commit that referenced this issue Oct 19, 2024
Fixes #295
Fixes #243
Fixes #312
Fixes #320

I give in, I've got enough reports of this from users I'm tired of
dealing with it and decided to just support basic semantic analysis. No
doubt at some point someone is going to expect it to work with full type
information cause they'll have some weird use case where they import
some title string function from a util or something dumb like that, but
at least this will quell the nonsense for most simple cases.
Copy link

🎉 This issue has been resolved in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants