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

chore: add meta.type to rules #186

Merged
merged 1 commit into from Apr 24, 2024

Conversation

MikeMcC399
Copy link
Collaborator

Issue

The plugin:eslint-plugin/recommended rules of eslint-plugin-eslint-plugin include the eslint-plugin/require-meta-type rule. This rule currently fails for all of the Cypress rules if enabled, since none of these has a meta.type defined.

Documentation reference

According to the ESLint documentation Rule Structure:

meta: (object) Contains metadata for the rule:

  • type: (string) Indicates the type of rule, which is one of "problem", "suggestion", or "layout":

    • "problem": The rule is identifying code that either will cause an error or may cause a confusing behavior. Developers should consider this a high priority to resolve.
    • "suggestion": The rule is identifying something that could be done in a better way but no errors will occur if the code isn't changed.
    • "layout": The rule cares primarily about whitespace, semicolons, commas, and parentheses, all the parts of the program that determine how the code looks rather than how it executes. These rules work on parts of the code that aren't specified in the AST.

Changes

Add meta.type to all rules and enable the rule eslint-plugin/require-meta-type.

Rule ID Description Type
assertion-before-screenshot Ensure screenshots are preceded by an assertion problem
no-assigning-return-values Prevent assigning return values of cy calls problem
no-unnecessary-waiting Prevent waiting for arbitrary time periods problem
no-async-before Prevent using async/await in Cypress test case problem
no-async-tests Prevent using async/await in Cypress test case problem
unsafe-to-chain-command Prevent chaining from unsafe to chain commands problem
no-force Disallow using force: true with action commands suggestion
no-pause Disallow cy.pause() parent command suggestion
require-data-selectors Only allow data-* attribute selectors (require-data-selectors) suggestion

@cypress-app-bot
Copy link

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for adding this.

@jennifer-shehane jennifer-shehane merged commit 404387a into cypress-io:master Apr 24, 2024
8 checks passed
@MikeMcC399 MikeMcC399 deleted the update/meta-type branch April 24, 2024 14:14
@cypress-app-bot
Copy link

🎉 This PR is included in version 3.0.1 🎉

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants