Skip to content

Enforce stricter linting across the entire codebase, covering both TypeScript and Python files.#96

Merged
Darshan808 merged 22 commits into
jupyterlab:mainfrom
Darshan808:enforce-tighter-lint
May 8, 2026
Merged

Enforce stricter linting across the entire codebase, covering both TypeScript and Python files.#96
Darshan808 merged 22 commits into
jupyterlab:mainfrom
Darshan808:enforce-tighter-lint

Conversation

@Darshan808

@Darshan808 Darshan808 commented May 5, 2026

Copy link
Copy Markdown
Member

Fixes #80

Description

  • Upgrade to ESLint v9
  • Resolve all linting issues in TypeScript files
  • Enabled "ALL" ruff rules and used an AI agent (Claude Code with Sonnet 4.6) to fix ~500 lint errors across python files.

@Darshan808 Darshan808 closed this May 5, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in CFP '25 tracking May 5, 2026
@Darshan808 Darshan808 reopened this May 5, 2026
@Darshan808 Darshan808 added the maintenance Change related to maintenance of the repository label May 5, 2026
@Darshan808 Darshan808 moved this from Done to In Progress in CFP '25 tracking May 5, 2026
@Darshan808

Copy link
Copy Markdown
Member Author

Used an AI agent to resolve the Ruff lint errors; it handled most cases well.

@Darshan808 Darshan808 changed the title Enforce tighter lint Enforce stricter linting across the entire codebase, covering both TypeScript and Python files. May 5, 2026
@Darshan808 Darshan808 requested a review from krassowski May 5, 2026 17:30

@krassowski krassowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would disable FBT001 it is just not practical here since we need to maintain compatibility, and it appears everywhere now

Comment thread src/webpack-plugins.ts Outdated
Comment thread jupyter_builder/jupyterlab_semver.py Outdated
Comment thread jupyter_builder/jupyterlab_semver.py

@krassowski krassowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to my human eye, I will ask copilot for a pass

Comment thread src/build-labextension.ts Outdated
Comment thread jupyter_builder/federated_extensions.py Outdated

Copilot AI left a comment

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.

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.json eslint config to eslint.config.mjs, and update TypeScript lint dependencies.
  • Enable ruff rule 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

  • IOptions still exposes watchMode?: boolean, but generateConfig no 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 from IOptions or 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.

Comment thread jupyter_builder/federated_extensions.py Outdated
Comment thread .pre-commit-config.yaml Outdated
@Darshan808

Copy link
Copy Markdown
Member Author

Could you ask copilot for one more pass?

@krassowski krassowski requested a review from Copilot May 7, 2026 18:41
@krassowski

Copy link
Copy Markdown
Member

Also needs resolving conflicts due to rspack 2 merge

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 25 out of 26 changed files in this pull request and generated 2 comments.

Comment thread eslint.config.mjs Outdated
Comment thread .pre-commit-config.yaml Outdated

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 28 out of 29 changed files in this pull request and generated 3 comments.

Comment thread jupyter_builder/federated_extensions.py
Comment thread jupyter_builder/jupyterlab_semver.py Outdated
Comment thread package.json
@krassowski

Copy link
Copy Markdown
Member

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?

Comment thread jupyter_builder/jupyterlab_semver.py Outdated
@Darshan808

Copy link
Copy Markdown
Member Author

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.

@Darshan808 Darshan808 requested a review from krassowski May 8, 2026 13:06

@krassowski krassowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@Darshan808 Darshan808 merged commit 7b1ec5b into jupyterlab:main May 8, 2026
21 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in CFP '25 tracking May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Change related to maintenance of the repository

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Enforce tighter linting (commented out code, top-level imports etc)

3 participants