-
Notifications
You must be signed in to change notification settings - Fork 1
ESLint whole project + standardize ESLint config #29
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
Conversation
- Updated error handling in various functions to omit the error parameter in catch blocks. - Changed type annotations from `any` to `unknown` in several interfaces and function parameters for better type safety. - Removed unnecessary parameters from functions, such as `filename` in `uploadRandomFileAndConfirm`. - Simplified locator functions by removing unused parameters. - Enhanced the `FormServiceInterface` and `I18nServiceInterface` to remove generic type parameters where not needed. - Adjusted the `uploadCompleteBar` locator to not require a filename. - Improved the handling of translations and localization by ensuring type safety in translation-related functions. - Updated tests to ensure they await asynchronous operations correctly and handle potential errors gracefully. - Cleaned up ESLint disable comments for better readability and maintainability.
…suppress unused variable warnings
…nd rule management + add jsdoc plugin
…for clarity and consistency with jsdoc ESLint plugin
tests/playwright.config.ts
Outdated
| { | ||
| apiToken: appConfig.qase.token, | ||
| projectCode: appConfig.qase.project, | ||
| apiToken: (appConfig.qase as any).token, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add alteast known basic typing for qase config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * Helper method to find the appropriate method name for a field. | ||
| */ | ||
| /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */ | ||
| private getMethod(page: any, field: string, methodPrefixes: string[]): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why disabling @typescript-eslint/no-explicit-any?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cause we don't know if the page is really of BasePage base type (or any type whatsover) if it doesn't have the appropriate methods we are looking for.
src/fixtures/index.ts
Outdated
| case 'describe': | ||
| // return a wrapper around the describe method that can skip tests | ||
| return (title: string, annotation?: any, callback?: () => void) => { | ||
| return (title: string, annotation?: unknown, callback?: () => void) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
annotation should have some typing
src/fixtures/index.ts
Outdated
| } | ||
| default: | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access | ||
| return (target as any)[prop]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Target type is known (extension of playwright base test
src/fixtures/index.ts
Outdated
| * will be marked as .skip. | ||
| */ | ||
| apply: (target, thisArg, args: any[]) => { | ||
| apply: (target, thisArg, args: unknown[]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameters typeof target?
src/fixtures/utils.ts
Outdated
|
|
||
| const page_creator = async (fixtures: any, use: UseFunction<L, T>) => { | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| const pageCreator = async (fixtures: any, use: UseFunction<L, T>) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixtures opt has type
src/locators/index.ts
Outdated
| * ``` | ||
| * | ||
| * import { BasePage } from '@inveniosoftware/invenio-e2e'; | ||
| * class MyPage extends BasePage<MyLocators> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Escaped bracket
…tion; enhance README with dependency details
Enhance the ESLint configuration and refactor code to improve type safety and error handling across various functions. Adjustments include removing unnecessary parameters and updating type annotations.
NOTE: Prettify-cation will be done in next PR to not bloat this one with non-important changes.