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

Update for eslint v8 #29

Merged
merged 1 commit into from
Oct 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module.exports = {
{ devDependencies: true }
],
"no-console": "off",
"@typescript-eslint/no-unsafe-argument": "off",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for the e2e test - jest objectContaining will return an any. I did not find a way around it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

See the example.serial-test.ts changes in commit [7840c91] of the release/v2.0 branch, I used a type-cast since that is the only way to override jest's poor decision to explicitly return any rather than a generic.

https://github.com/testcafe-community/eslint-plugin-testcafe-community/blob/release/v2.0/tests/example.serial-test.ts

"@typescript-eslint/no-non-null-assertion": "off" // Tests should throw errors, jest will catch them
}
},
Expand Down
1 change: 0 additions & 1 deletion lib/rules/expect-expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default createRule({
},
docs: {
description: "Ensure tests have at least one expect",
category: "Best Practices",
codejedi365 marked this conversation as resolved.
Show resolved Hide resolved
recommended: "error"
},
schema: []
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export default createRule({
docs: {
description:
"Don't allow `t.debug()` to be committed to the repository. ",
category: "Best Practices",
recommended: "error"
},
schema: []
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-identical-title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export default createRule({
},
docs: {
description: "Don't use identical titles for your tests",
category: "Best Practices",
recommended: "error"
},
schema: []
Expand Down
1 change: 0 additions & 1 deletion lib/rules/no-only.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default createRule({
docs: {
description:
"Don't allow `test.only` to be added to the repository",
category: "Best Practices",
recommended: "error"
},
schema: []
Expand Down
3 changes: 1 addition & 2 deletions lib/rules/no-skip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ export default createRule({
messages: {
noSkip: "Do not use the `.skip` hook."
},
type: "suggestion",
type: "problem",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A suggestion needs to also provide a suggestion array - at least if I understood the docs correctly.
This is actually also the underlying error - if you have a suggestion, you need to set hasSuggestion also to true. But if you do that the require-meta-has-suggestions rule will break.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I did not run into this error about suggestions when I worked on the update to eslint@v8. Will this be a breaking change for v7?

docs: {
description:
"Don't allow `test.skip` or `fixture.skip` to be added to the repository",
category: "Best Practices",
recommended: "warn"
},
schema: []
Expand Down