Skip to content

chore: migrate ESLint config to @qlik/eslint-config@1.4.30#1983

Draft
Copilot wants to merge 12 commits into
mainfrom
copilot/update-eslint-config-version
Draft

chore: migrate ESLint config to @qlik/eslint-config@1.4.30#1983
Copilot wants to merge 12 commits into
mainfrom
copilot/update-eslint-config-version

Conversation

Copilot AI commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Replaces the legacy FlatCompat/eslint-config-airbnb bridge with @qlik/eslint-config@1.4.30, a modern flat-config package from qlik-oss/dev-tools-js. Prettier is removed from the linter and should be run as a separate check.

Dependencies (package.json)

  • Added: @qlik/eslint-config@1.4.30, svelte^5 (required non-optional peer dependency of @qlik/eslint-config — needed even though nebula.js does not use Svelte, because the plugin eagerly imports svelte/compiler at load time)
  • Removed: eslint-config-airbnb, eslint-config-prettier, eslint-plugin-import, eslint-plugin-jsx-a11y, eslint-plugin-react, eslint-plugin-jest, eslint-plugin-prettier — all now bundled transitively or no longer needed

eslint.config.mjs rewrite

  • Drops @eslint/js, @eslint/eslintrc, FlatCompat, and the compat.extends('airbnb', 'prettier') shim
  • Base config switched to ...qlik.configs.react (covers JS/JSX, react, jsx-a11y, react-hooks, import-x, prettier-compat)
  • Jest rules now use qlik.configs.jest[0] with an extended files glob to cover **/*.spec.js, **/*.test.js etc. (the default only targets __tests__/ directories)
  • eslint-plugin-mocha block for .int/.comp files is unchanged
  • All import/ rule prefixes renamed to import-x/
  • import-x and react plugin instances are reused from qlik.configs.react[0].plugins to avoid duplicate-plugin conflicts
  • prettier/prettier rule removed; prettier is no longer part of linting
  • .eslintignore removed — content migrated to globalIgnores in eslint.config.mjs; additional ignores added for .github/**, .storybook_old/**, and **/*.d.ts

Source file changes

  • Removed unused import React from 'react' from 98 JSX/JS files — the React 17+ automatic JSX transform makes the import unnecessary
  • Fixed babel.config.cjs to correctly use @babel/preset-react with runtime: 'automatic', aligning Jest's Babel transform with the new JSX transform
  • Added Node.js globals for CJS command files, test files, and Playwright config files
  • Fixed useDeauthorizePrevOAuthInstance.js: replaced mixed require('react') call with a proper import
  • Renamed stale import/import-x/ eslint-disable comments in source files

Rule overrides preserved

Overrides kept where @qlik/eslint-config defaults differ from this codebase's established behaviour:
no-bitwise: 0, no-plusplus: 0, no-unused-expressions: 0, react/destructuring-assignment: 0, react/prop-types: 0, react/no-deprecated: 0, import-x/no-dynamic-require: 0, no-unused-vars with caughtErrors: none.

New rules introduced by @qlik/eslint-config that are turned off for this codebase: react-hooks/exhaustive-deps, react-hooks/rules-of-hooks, React Compiler rules (react-hooks/refs, react-hooks/immutability, etc.), all testing-library/* rules, import-x/no-unresolved, import-x/extensions, and react/no-array-index-key (downgraded to warning).

Copilot AI and others added 4 commits April 27, 2026 08:01
This reverts commit 436ef6f.

Co-authored-by: enell <968450+enell@users.noreply.github.com>
Comment thread package.json
"rollup": "4.60.1",
"rollup-plugin-sass": "1.15.3",
"style-loader": "4.0.0",
"svelte": "^5.0.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot why was svelte added

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@qlik/eslint-config@1.4.30 bundles eslint-plugin-svelte as a dependency and lists svelte as a (non-optional) peer dependency. eslint-plugin-svelte eagerly imports svelte/compiler at module load time, so ESLint crashes with Cannot find package 'svelte' the moment @qlik/eslint-config is imported — even though nebula.js itself doesn't use Svelte. Adding svelte as a devDependency is the minimum required to satisfy that load-time import. The ideal fix is for @qlik/eslint-config to mark svelte as optional, but until that's done upstream we need it here.

Copilot AI and others added 2 commits April 27, 2026 10:05
… warning, fix babel config

Agent-Logs-Url: https://github.com/qlik-oss/nebula.js/sessions/dc42f716-2455-47ae-ad16-adebce639fae

Co-authored-by: enell <968450+enell@users.noreply.github.com>
Copilot AI requested a review from enell April 27, 2026 10:19
Signed-off-by: Johan Enell <johan.enell@qlik.com>
@enell enell force-pushed the copilot/update-eslint-config-version branch from f309d1a to dd902dc Compare April 27, 2026 11:07
enell and others added 5 commits April 27, 2026 15:03
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Johan Enell <johan.enell@qlik.com>
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Johan Enell <johan.enell@qlik.com>
- Replace findAll* (async) with synchronous getAll*/queryAll* queries
  since elements are already in DOM after await render()
- Update toHaveBeenCalledTimes(3) → 4 to reflect correct call count
  under automatic JSX runtime (babel.config.cjs migration)
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Johan Enell <johan.enell@qlik.com>
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