Migrate eslint to v9 and use @jupyter/eslint-plugin#141
Migrate eslint to v9 and use @jupyter/eslint-plugin#141Darshan808 wants to merge 9 commits intojupyterlab:mainfrom
eslint to v9 and use @jupyter/eslint-plugin#141Conversation
| "@typescript-eslint/eslint-plugin": "^6.1.0", | ||
| "@typescript-eslint/parser": "^6.1.0", | ||
| "@eslint/js": "^9.0.0", | ||
| "@jupyter/eslint-plugin": "^0.0.3", |
There was a problem hiding this comment.
@Darshan808 shall we update to latest version and add translation rules to config file as warn or off (extensions often start without translations and add them later, having the rule in config file will already improve discoverability IMO)
There was a problem hiding this comment.
shall we update to latest version
Yes definitely.
add translation rules to config file as warn or off
The eslintconfig in this template includes all the recommended rules for extensions that we defined using
jupyterPlugin.configs.recommended,These are available in the docs
There was a problem hiding this comment.
Pull request overview
Updates the JupyterLab extension template’s linting setup to ESLint v9, moving configuration out of package.json into the new flat config format and adopting @jupyter/eslint-plugin’s recommended rules.
Changes:
- Bumps ESLint to v9 and updates related devDependencies (adds
@eslint/js,globals,typescript-eslint,@jupyter/eslint-plugin). - Replaces
eslintConfig/eslintIgnoreinpackage.jsonwith a neweslint.config.mjsflat config template. - Simplifies the
eslint:checkscript to runeslint . --cache.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| template/package.json.jinja | Updates ESLint-related scripts and devDependencies; removes embedded eslintConfig/eslintIgnore. |
| template/eslint.config.mjs.jinja | Adds the new ESLint v9 flat config using TypeScript + Jupyter recommended configs and Prettier integration. |
| template/.prettierignore.jinja | Adds an ignore entry for eslint.config.mjs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| tseslint.configs.recommended, | ||
| jupyterPlugin.configs.recommended, |
There was a problem hiding this comment.
typescript-eslint flat-config configs.recommended is an array of config objects; including it as a single array element produces a nested array that ESLint won’t accept. Spread the recommended configs into the top-level config array (same concern for jupyterPlugin.configs.recommended if it is also an array).
| tseslint.configs.recommended, | |
| jupyterPlugin.configs.recommended, | |
| ...(Array.isArray(tseslint.configs.recommended) | |
| ? tseslint.configs.recommended | |
| : [tseslint.configs.recommended]), | |
| ...(Array.isArray(jupyterPlugin.configs.recommended) | |
| ? jupyterPlugin.configs.recommended | |
| : [jupyterPlugin.configs.recommended]), |
| **/package.json | ||
| !/package.json | ||
| {{python_name}} | ||
| eslint.config.mjs |
There was a problem hiding this comment.
This .prettierignore entry is currently a no-op: the prettier:base script only targets .ts/.tsx/.js/.jsx/.css/.json/.md, so eslint.config.mjs won’t be formatted anyway. Either remove this ignore line or update the Prettier glob to include .mjs if you want the config file formatted/checked.
| eslint.config.mjs |
| import js from '@eslint/js'; | ||
| import { defineConfig } from 'eslint/config'; |
There was a problem hiding this comment.
The PR description mentions migrating to .eslint.config.mjs, but the template adds eslint.config.mjs (no leading dot). Please align the description and the generated filename so users know what to expect (and so tooling/docs references don’t drift).
Description
eslintto v9 and use new flat config format (.eslint.config.mjs)@jupyter/eslint-pluginwith recommeded config for extensions.