Skip to content

add eslint & ci - #100

Draft
dale-wahl wants to merge 1 commit into
masterfrom
lint_ci
Draft

add eslint & ci#100
dale-wahl wants to merge 1 commit into
masterfrom
lint_ci

Conversation

@dale-wahl

Copy link
Copy Markdown
Member

Adding automated linting and testing to the repository. Hoping to catch undefined global references in extension scripts and ensuring code quality for both our code and the LLM generated code. The main changes include adding a GitHub Actions workflow for CI, integrating ESLint with a custom configuration, and centralizing the discovery of global names used across scripts and tests.

Continuous integration and automation:

  • Added .github/workflows/ci.yml to run tests and linting on every push and pull request, to ensure missing helper functions and similar bugs are caught early, especially for the auto-generated map_item functions.

Linting infrastructure:

  • Introduced eslint.config.mjs with a configuration that enables the no-undef rule for extension scripts and modules, using a dynamically generated list of global names to avoid false positives.
  • Updated tests/package.json to add scripts for running ESLint and included necessary dependencies (eslint, globals).

Global name discovery and sharing:

  • Added tests/lib-globals.cjs, which extracts global helper names from js/lib.js and js/zs-background.js, and exposes them for both the test setup and ESLint configuration.
  • Refactored tests/setup-globals.cjs to use the shared global name list from lib-globals.cjs

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