-
Notifications
You must be signed in to change notification settings - Fork 559
Reduce dependencies of linting #25895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
853320d
b632d52
fc14568
55f7390
410368b
f83cf85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,7 @@ module.exports = { | |
| "build:test": ["typetests:gen", "tsc"], | ||
| "build:test:cjs": ["typetests:gen", "tsc"], | ||
| "build:test:esm": ["typetests:gen", "build:esnext"], | ||
| // Everything needed for the API of the package to be consumable by its dependencies. | ||
| "api": { | ||
| dependsOn: ["api-extractor:commonjs", "api-extractor:esnext"], | ||
| script: false, | ||
|
|
@@ -129,9 +130,10 @@ module.exports = { | |
| }, | ||
| "check:biome": [], | ||
| "check:prettier": [], | ||
| // ADO #7297: Review why the direct dependency on 'build:esm:test' is necessary. | ||
| // Should 'compile' be enough? compile -> build:test -> build:test:esm | ||
| "eslint": ["compile", "build:test:esm"], | ||
| // Linting can require resolving imports into dependencies, and thus "^api". | ||
| // The lint task does not seem to invalidate properly, so we take a dependency on "build:test:esm" as well so lint will rerun when the code changes. | ||
| // This may be related to AB#7297. | ||
| "eslint": ["^api", "build:test:esm"], | ||
|
||
| "good-fences": [], | ||
| "format:biome": [], | ||
| "format:prettier": [], | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -231,6 +231,10 @@ | |
| "...", | ||
| "@fluidframework/id-compressor#build:test:esm" | ||
| ], | ||
| "eslint": [ | ||
| "...", | ||
| "@fluidframework/id-compressor#build:test:esm" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not currently required, but does not harm and would be required if we removed the workaround where we build esm:tests
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does tree require its tests to be built before linting? I would expect everything leading up to building of tests would be required, but not that the tests themselves are built. |
||
| ], | ||
| "ci:build:docs": [ | ||
| "build:esnext" | ||
| ] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a package does not have
build:test:esm, might it fail to ensure prereqs are handled?I agree that compile was too aggressive. Really want everything leading up to compile without actual compile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"build:test:esm" is not about prerequisites. It is actually fully unnecessary when linting from a clean state and removing it would greatly improve tree's build times (12 seconds for just that package). It is only there to work around an incremental build bug where lint won't run when you modify source code unless we include this.
So packages without that target might fail to lint incrementally. That's not a huge risk, as CI will catch violations with its clean build.
What we really should do is fix linting so that it actually gets invalidated correctly without this workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand. While
build:test:esmmay be proxy for when to build, it also ensures that all of its pre-reqs are built which may be pre-reqs for linting.