Skip to content
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

Title must be a string for string variables #243

Closed
abigailarmijo opened this issue Feb 21, 2024 · 2 comments
Closed

Title must be a string for string variables #243

abigailarmijo opened this issue Feb 21, 2024 · 2 comments
Labels
bug Something isn't working released

Comments

@abigailarmijo
Copy link

Hi! I have some variable to reuse the step description that is a string but the aslant shows error.

const stepDescription = 'My description';
    await test.step(stepDescription, async () => {
})
@mskelton mskelton added the bug Something isn't working label Feb 24, 2024
@mskelton
Copy link
Member

This behavior is intentional.

https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/valid-title.md#titlemustbestring

You can disable the titleMustBeString error using the ignoreTypeOfDescribeName and ignoreTypeOfTestName options.

{
  "rules": {
    "playwright/valid-title": [
      "error",
      {
        "ignoreTypeOfTestName": true
      }
    ]
  }
}

@mskelton mskelton closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 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
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants