Enforce stricter linting across the entire codebase, covering both TypeScript and Python files.#96
Conversation
|
Used an AI agent to resolve the Ruff lint errors; it handled most cases well. |
krassowski
left a comment
There was a problem hiding this comment.
I would disable FBT001 it is just not practical here since we need to maintain compatibility, and it appears everywhere now
krassowski
left a comment
There was a problem hiding this comment.
Looks good to my human eye, I will ask copilot for a pass
There was a problem hiding this comment.
Pull request overview
This PR tightens linting across the repository by upgrading the JavaScript/TypeScript linting stack to ESLint v9 (flat config) and by enabling Ruff’s full rule set for Python, with targeted per-file ignores to keep third-party/legacy code workable.
Changes:
- Upgrade ESLint to v9, migrate from
package.jsoneslint config toeslint.config.mjs, and update TypeScript lint dependencies. - Enable
ruffrule selection"ALL"and add/adjust per-file ignores for the semver port. - Apply widespread typing/cleanup refactors across TS and Python code to satisfy stricter lint rules.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
yarn.lock |
Updates JS tooling dependency graph for ESLint v9 / typescript-eslint / related packages. |
package.json |
Switches lint dependencies to ESLint v9 + flat-config ecosystem and removes inline eslint config. |
eslint.config.mjs |
Adds ESLint flat config with TS + Prettier integration and global ignores. |
src/webpack.config.base.ts |
Tightens types for SVG data URL generator callback. |
src/webpack-plugins.ts |
Replaces any usage with rspack types and tightens watch filesystem wrapper typing. |
src/extensionConfig.ts |
Improves typing for shared deps/config generation and rspack plugin/rules definitions. |
src/build.ts |
Minor TS cleanup/typing changes (e.g., avoid unused destructured vars; tighten SVG generator types). |
src/build-labextension.ts |
Improves callback typings and error handling types around rspack compiler output. |
pyproject.toml |
Enables Ruff select = ["ALL"] and expands per-file ignores for the semver port. |
.pre-commit-config.yaml |
Adjusts ruff hooks configuration (notably adds exclude: tests). |
.licenserc.yaml |
Exempts the semver port file from license header enforcement. |
jupyter_builder/yarn.js |
Removes eslint-disable header from bundled yarn script (generated file). |
jupyter_builder/main.py |
Adds module docstring and tightens typing/docstrings. |
jupyter_builder/jlpm.py |
Adds typing, pathlib usage, and docstring improvements. |
jupyter_builder/jupyterlab_semver.py |
Large Ruff-driven cleanup: typing, docstrings, small refactors, and regex flag constants. |
jupyter_builder/federated_extensions.py |
Broad pathlib + typing refactor for extension build/develop/watch utilities. |
jupyter_builder/federated_extensions_requirements.py |
Moves to pathlib globs and typing cleanups. |
jupyter_builder/extension_commands/* |
Adds docstrings, typing, and pathlib usage in CLI command apps. |
jupyter_builder/base_extension_app.py |
Typing/docstring improvements and pathlib-based HERE. |
jupyter_builder/debug_log_file_mixin.py |
Typing improvements and pathlib usage for log file handling. |
jupyter_builder/core_path.py |
Docstring formatting and signature formatting tweaks. |
jupyter_builder/commands.py |
Adds typing and minor refactors to overlap comparison helpers. |
jupyter_builder/__init__.py / jupyter_builder/extension_commands/__init__.py |
Adds module docstrings. |
Comments suppressed due to low confidence (1)
src/extensionConfig.ts:31
IOptionsstill exposeswatchMode?: boolean, butgenerateConfigno longer reads or applies it (it’s not referenced anywhere in the file). This makes the option a no-op and can confuse downstream callers; either remove it fromIOptionsor reintroduce handling so it affects the generated rspack configuration.
export interface IOptions {
packagePath?: string;
corePackageFile?: string;
staticUrl?: string;
mode?: 'development' | 'production';
devtool?: string;
watchMode?: boolean;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Could you ask copilot for one more pass? |
|
Also needs resolving conflicts due to rspack 2 merge |
|
In general, changes in semver file are why I went for another round of copilot. These are hard to reason about and there are no unit tests for that functionality. I worry that we could break some version checking here due to subtle differences in logic flow. Could you revert the more involved changes (typing additions are fine) and just add comments asking linter to ignore specific lines in that file? |
|
The semver file’s original source has also remained unchanged for the past 9 years. Given that, I agree it’s probably safer to ignore the mypy errors here rather than risk introducing subtle logic regressions. |
Fixes #80
Description
"ALL"ruff rules and used an AI agent (Claude Code with Sonnet 4.6) to fix ~500 lint errors across python files.