Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[infra] Configure eslint import/no-extraneous-dependencies rule (#3114)
Configures a new eslint rule which enforces that, when we import a module, that module is referenced in the "dependencies" of the immediate "package.json" file. Docs: https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md This is especially important now that we're using npm workspaces, because npm workspaces hoists as many dependencies as possible to the root `node_modules/` folder, which can make it easy to forget to include a dependency. Exceptions are made for internal files like tests, which are free to import dependencies that are only declared in the top-level "package.json". ### Violations - `@lit-labs/cli` was missing a dependency on `chalk`. Added the missing dependency. - `@lit-labs/cli` depended on `@lit-labs/analyzer` as `devDependency`. Switched to regular `dependency`. - `@lit-labs/react` imports `react`, which is in `devDependencies`. However, this is intentional, because it's a type-only import. Added a special-case to allow it to be imported from `devDependencies`. ### Also - Found a few more spots that were referencing `npm run bootstrap`.
- Loading branch information
Showing
7 changed files
with
88 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters