Skip to content

[WIP] Consolidate ESLint dependencies to root frontend#13776

Draft
lukasmasuch wants to merge 2 commits intodevelopfrom
lukasmasuch/eslint-prettier-refactor
Draft

[WIP] Consolidate ESLint dependencies to root frontend#13776
lukasmasuch wants to merge 2 commits intodevelopfrom
lukasmasuch/eslint-prettier-refactor

Conversation

@lukasmasuch
Copy link
Collaborator

Describe your changes

Consolidated all ESLint-related dependencies from frontend/app/package.json to frontend/package.json, making the dependency tree explicit and maintainable. Updated individual package lint scripts to reference the root ESLint binary via relative path.

Changes:

  • Moved 20+ ESLint packages (eslint, @eslint/, typescript-eslint, eslint-plugin-, globals, prettier) to root devDependencies
  • Removed redundant ESLint declarations from lib, connection, utils, component-v2-lib
  • Updated lint scripts in all packages to use ../node_modules/.bin/eslint
  • Added root-level yarn lint and yarn lint:fix scripts
  • Added frontend/ESLINT.md documentation

Testing Plan

All lint commands verified working post-refactor:

  • make frontend-lint
  • Individual package yarn lint in all packages ✅
  • make check ESLint invocation ✅
  • Frontend types check ✅
  • Frontend unit tests (5782 tests) ✅

No new tests required—this is a refactoring that consolidates dependencies without changing behavior.


Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

Move all ESLint-related packages from app/package.json to root frontend/package.json, making dependencies explicit and maintainable. Update individual package lint scripts to reference the root eslint binary via relative path. Add root-level lint scripts and documentation.

- Move 20+ ESLint packages to root devDependencies (eslint, @eslint/*, typescript-eslint, eslint-plugin-*, globals, prettier)
- Remove redundant ESLint declarations from lib, connection, utils, component-v2-lib
- Update lint scripts in all packages to use ../node_modules/.bin/eslint
- Add root yarn lint and lint:fix scripts
- Add frontend/ESLINT.md documentation

All lint commands verified working:
- make frontend-lint ✅
- Individual package yarn lint ✅
- make check ✅
- Frontend tests (5782) ✅
- Frontend types ✅

Co-Authored-By: Claude (claude-haiku-4-5) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 1, 2026 17:17
@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-13776/streamlit-1.53.1-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-13776.streamlit.app (☁️ Deploy here if not accessible)

@snyk-io
Copy link
Contributor

snyk-io bot commented Feb 1, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Contributor

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 consolidates ESLint-related dependencies from individual frontend workspace packages to the root frontend/package.json, making the dependency tree explicit and reducing redundancy. Previously, ESLint and its plugins were declared in multiple packages (primarily app) but relied on Yarn workspace hoisting, which was fragile and confusing. Now all ESLint dependencies are centralized in one location.

Changes:

  • Moved 20+ ESLint packages (eslint core, plugins, TypeScript ESLint, globals, prettier) from frontend/app/package.json to frontend/package.json as devDependencies
  • Removed ESLint-related dependencies from app, lib, connection, utils, and component-v2-lib package.json files
  • Updated lint scripts in individual packages to reference ../node_modules/.bin/eslint explicitly
  • Added root-level yarn lint and yarn lint:fix commands that delegate to workspace packages
  • Added comprehensive frontend/ESLINT.md documentation explaining the problem analysis and solution

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/package.json Added all ESLint dependencies to root devDependencies; added root lint and lint:fix scripts
frontend/app/package.json Removed ESLint dependencies; updated lint scripts to use relative path to eslint binary
frontend/lib/package.json Removed ESLint dependencies; updated lint scripts to use relative path to eslint binary
frontend/connection/package.json Removed ESLint dependencies; updated lint scripts to use relative path to eslint binary
frontend/utils/package.json Removed ESLint dependencies; updated lint scripts to use relative path to eslint binary
frontend/component-v2-lib/package.json Removed ESLint dependencies; updated lint script to use relative path to eslint binary
frontend/yarn.lock Reflects dependency consolidation from individual packages to root
frontend/ESLINT.md New documentation file describing the problem analysis and consolidation approach

Comment on lines 32 to 33
"typecheck": "yarn run typecheck:all",
"format": "prettier --write --config ../.prettierrc --ignore-path ../.prettierignore './src/**/*.{js,ts,jsx,tsx}'",
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

Missing lint:fix script. The root package.json now has a lint:fix script that runs yarn workspaces foreach --all --parallel run lint:fix, but this package doesn't have a corresponding lint:fix script. This will cause the root-level command to fail.

Add a lint:fix script similar to other packages (e.g., app, lib, connection, utils), which should be:
"lint:fix": "../node_modules/.bin/eslint --cache --max-warnings 0 --fix src"

Suggested change
"typecheck": "yarn run typecheck:all",
"format": "prettier --write --config ../.prettierrc --ignore-path ../.prettierignore './src/**/*.{js,ts,jsx,tsx}'",
"lint:fix": "../node_modules/.bin/eslint --cache --max-warnings 0 --fix src",
"typecheck": "yarn run typecheck:all",
"format": "prettier --write --config ../.prettierrc --ignore-path ../.prettierrc --ignore-path ../.prettierignore './src/**/*.{js,ts,jsx,tsx}'",

Copilot uses AI. Check for mistakes.
@sfc-gh-lmasuch sfc-gh-lmasuch marked this pull request as draft February 1, 2026 17:22
@sfc-gh-lmasuch sfc-gh-lmasuch changed the title Consolidate ESLint dependencies to root frontend [WIP] Consolidate ESLint dependencies to root frontend Feb 1, 2026
Co-Authored-By: Claude (claude-opus-4-5) <noreply@anthropic.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.

1 participant