Skip to content

chore: Upgrade to eslint9 #734

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

Closed
wants to merge 7 commits into from
Closed

Conversation

bingenito
Copy link
Member

  • Introduced ESLint9 configuration file with rules and license header enforcement.
  • Added license header to missing files via lint:fix
  • Configured ESLint to ignore specific directories and files, including build artifacts and configuration files.

@Copilot Copilot AI review requested due to automatic review settings May 2, 2025 14:47
@bingenito bingenito requested a review from a team as a code owner May 2, 2025 14:47
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR upgrades the ESLint configuration to version 9 and enforces the inclusion of Apache License headers in various project files, while also updating several test and source files to align with new linting rules and improved type annotations.

  • Added/updated ESLint configuration and license headers in multiple config files.
  • Updated test and source files to use more explicit function signatures and control flow.
  • Enhanced documentation in the README with new linting instructions.

Reviewed Changes

Copilot reviewed 10 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/desktopjs/vite.config.ts Added license header.
packages/desktopjs/tests/setup.ts Added license header.
packages/desktopjs-openfin/vite.config.ts Added license header.
packages/desktopjs-openfin/tests/openfin.spec.ts Updated test callbacks and function signatures; improved event typings.
packages/desktopjs-openfin/src/openfin.ts Refactored getState to use an explicit if/else for clarity.
packages/desktopjs-electron/vite.config.ts Added license header.
packages/desktopjs-electron/tests/setup.ts Added license header.
eslint.config.mjs Introduced ESLint9 configuration with license header enforcement.
README.md Added new linting instructions.
Files not reviewed (3)
  • .eslintrc.json: Language not supported
  • package.json: Language not supported
  • tsconfig.test.json: Language not supported

@@ -902,7 +857,7 @@ describe("OpenFinContainer", () => {

try {
await (container as any).isAutoStartEnabledAtLogin();
expect(true).toBe(false); // This will fail the test if we get here
expect(true).toBe(false);
Copy link
Preview

Copilot AI May 2, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using an explicit fail() function or a more descriptive failure mechanism instead of 'expect(true).toBe(false)' to make the test failure clearer.

Suggested change
expect(true).toBe(false);
fail("The function did not throw an error as expected.");

Copilot uses AI. Check for mistakes.

@@ -166,7 +166,12 @@ export class OpenFinContainerWindow extends ContainerWindow {

public getState(): Promise<any> {
return new Promise<any>(resolve => {
(this.nativeWindow && (<any>this.nativeWindow).getState) ? resolve((<any>this.nativeWindow).getState()) : resolve(undefined);
// Use explicit if/else instead of ternary for side-effect
if (this.nativeWindow && (<any>this.nativeWindow).getState) {
Copy link
Preview

Copilot AI May 2, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider replacing the cast with a proper type guard or explicit type conversion to improve type safety and maintainability.

Copilot uses AI. Check for mistakes.

@bingenito bingenito closed this May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant