Skip to content

Conversation

@sbastn
Copy link
Member

@sbastn sbastn commented Jan 14, 2026

Summary

This PR adds ESLint to the project for linting JavaScript and Vue files. We were running an old version of ESLint that was removed in #909

Changes

New Dependencies

  • eslint v9.18.0 - Core ESLint package
  • @eslint/js - ESLint recommended JavaScript rules
  • eslint-plugin-vue v9.32.0 - Vue 3 component linting
  • globals v15.14.0 - Environment globals definitions

New Files

  • eslint.config.js - ESLint flat config with:
    • JavaScript recommended rules
    • Vue 3 recommended rules (with some stylistic rules relaxed)
    • Browser globals for source files
    • Node.js globals for webpack config and GitHub scripts
    • Ignores for dist/, output/, node_modules/, tmp/

Modified Files

  • package.json:
    • Added "type": "module" for ES modules support
    • Added ESLint dependencies
    • Added lint and lint:fix scripts
  • webpack.config.jswebpack.config.cjs - Renamed for CommonJS compatibility
  • src/components/tabs.vue - Changed v-if to v-show to fix Vue best practice warning
  • .github/scripts/validate-fixtures-json.js - Prefixed unused catch variable with underscore

Usage

yarn lint       # Check for linting issues
yarn lint:fix   # Auto-fix fixable issues

Testing

- Add ESLint 9.x with flat config format
- Add eslint-plugin-vue for Vue 3 component linting
- Add lint and lint:fix npm scripts
- Rename webpack.config.js to webpack.config.cjs for ES modules compatibility
- Fix minor linting issues in existing code:
  - Use v-show instead of v-if with v-for in tabs.vue
  - Prefix unused catch variable with underscore
Copy link

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 adds ESLint to the project to enforce code quality standards for JavaScript and Vue files. The changes establish a linting infrastructure with automated checks in CI, configured to work with the project's ES module setup while maintaining compatibility with CommonJS files like the webpack configuration.

Changes:

  • Added ESLint v9.18.0 with Vue 3 plugin support and recommended rule configurations
  • Fixed existing linting issues in Vue components and JavaScript utility files

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yarn.lock Added ESLint and related dependency entries
package.json Added module type and ESLint dependencies with lint scripts
eslint.config.js New flat config with JavaScript and Vue 3 rules, environment-specific globals
src/components/tabs.vue Changed v-if to v-show to comply with Vue best practices
.github/scripts/validate-fixtures-json.js Prefixed unused catch variable with underscore and fixed trailing whitespace
.github/workflows/ci.yml Added lint job to CI workflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Use eslint.config.mjs instead of adding type:module to package.json
- Keep webpack.config.js and validate-fixtures-json.js as regular .js files
- No changes needed to project module system
- Add semi and curly rules to ESLint config
- Remove Vue-specific rule overrides
- Fix code to comply with new linting rules
- Use empty catch block syntax (ES2019)
@sbastn sbastn merged commit 064a48f into main Jan 14, 2026
8 checks passed
@sbastn sbastn deleted the add-eslint branch January 14, 2026 17:25
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.

2 participants