-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Enhance TypeScript code with strict checks and ESLint rules #2469
Conversation
Enable strict type checking and enforce explicit type annotations across the codebase. - Enable `strictNullChecks` and `noImplicitAny` in `tsconfig.json` to enforce strict type checking. - Remove the non-existent `@typescript-eslint/no-implicit-any` rule from `.eslintrc.json` and ensure `@typescript-eslint/no-explicit-any` is set to `"error"`. - Add explicit type annotations to functions and variables in various TypeScript files, including `src/index.ts`, `src/libs/localserver.ts`, and `src/libs/parse-sv-data.ts`, to comply with strict type checking. - Replace `any` types with specific types or justify the use of `any` with comments in files like `src/libs/compare-sv-with-wago.ts` and `src/libs/sort.ts`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/WeakAuras/WeakAuras-Companion/pull/2469?shareId=cd93ba09-69b2-45db-8564-d276ab438aec).
Enable strict type checking and enforce explicit type annotations across the codebase.
For more details, open the Copilot Workspace session. |
Enforces stricter TypeScript type checking and adds explicit type annotations to various functions across the codebase. - Updates `.eslintrc.json` and `tsconfig.json` to enforce stricter type checking by setting `@typescript-eslint/no-explicit-any` to `error` and enabling `noImplicitAny`. - Adds explicit return type annotations (`Promise<void>` and `Promise<any>`) to `getStore`, `setStore`, and `deleteStore` functions in `src/index.ts`. - Implements null checks and adds explicit type annotations in various modules, including `backup.ts`, `build-account-list.ts`, `build-version-list.ts`, `click-outside.ts`, `compare-sv-with-wago.ts`, `contacts.ts`, `gif2tga.ts`, `grab-sv-files.ts`, `grab-wa-version.ts`, `hash.ts`, `i18n.ts`, `is-addon-installed.ts`, `localserver.ts`, `parse-sv-data.ts`, `sanitize.ts`, and `sort.ts` to ensure type safety and handle potential null or undefined values. - Modifies the `handleAuraUpdate` function in `src/libs/compare-sv-with-wago.ts` to use specific types for its parameters instead of `any`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/WeakAuras/WeakAuras-Companion/pull/2469?shareId=8146a12b-4ebd-45d9-b765-20d606a780bc).
Enforces stricter TypeScript type checking and adds explicit type annotations to various functions across the codebase.
For more details, open the Copilot Workspace session. |
Enforces stricter TypeScript rules and adds explicit type annotations across various files.
For more details, open the Copilot Workspace session. |
Enforces stricter TypeScript rules and adds explicit type annotations across various files. - Updates `.eslintrc.json` to set `@typescript-eslint/no-explicit-any` to "off" and adds `@typescript-eslint/no-implicit-any` as "error", aligning with stricter TypeScript practices. - Modifies `tsconfig.json` to enforce `strictNullChecks` and `noImplicitAny`, ensuring code robustness by avoiding implicit `any` types and enforcing null checks. - Adds explicit type annotations and null checks in functions across multiple files, including `src/index.ts`, `src/libs/backup.ts`, and others, improving type safety and code clarity. - Enhances type definitions in utility functions such as `src/libs/gif2tga.ts` and `src/libs/sort.ts`, providing clearer type information and error handling. - Implements explicit type annotations in Vue directive `src/libs/click-outside.ts`, ensuring better type checking within Vue components. - Adjusts `src/libs/localserver.ts` to initialize `stash` with an explicit type annotation and adds type annotations to function parameters, enhancing code readability and maintainability. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/WeakAuras/WeakAuras-Companion/pull/2469?shareId=0126cdd6-d334-4816-b2db-a1d81507a5f8).
This pull request introduces several enhancements to the TypeScript codebase, focusing on improving type safety and code quality by enabling strict null checks, disallowing implicit
any
types, and adding explicit type annotations across various modules. Additionally, it addresses the handling of potentially null objects and updates ESLint rules to enforce these standards.strictNullChecks
andnoImplicitAny
intsconfig.json
to enforce strict null checks and disallow implicitany
types, enhancing type safety..eslintrc.json
to enforce explicit typing, turning on@typescript-eslint/no-explicit-any
and@typescript-eslint/no-implicit-any
rules.For more details, open the Copilot Workspace session.