backstage-cli: lint command should lint a package/plugin's dependencies with custom rules
See original GitHub issueFeature Suggestion
When backstage-cli lint is run in a package or plugin, it should take a look at the dependencies and throw warnings/errors based on some rules.
- If you are importing packages which should not be imported, the backstage instance should log a warning. (e.g. @backstage/core should also not be imported docs).
- Frontend packages should not be imported in backend packages/plugins and vice versa. (e.g. there are two separate Discovery APIs in separate packages for frontend/backend)
(Future scope)
3. (?) Suggestions on some packages and their dependencies based on ADRs. For example, using luxon over any other date time library. https://github.com/backstage/backstage/issues/3401
Possible Implementation
Challenging but depends on each rule. Having a “Disallowed list” of dependencies is one way to do (1).
Context
Discussion https://github.com/backstage/backstage/pull/4069#issuecomment-760038965
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Commands · Backstage Software Catalog and Developer ...
This page lists all commands provided by the Backstage CLI, what they're for, and where to use them. help. This command displays a...
Read more >@backstage/cli - npm
This package provides a CLI for developing Backstage plugins and apps. Installation. Install the package via Yarn: yarn add @backstage/cli ...
Read more >Changelog | skuba - GitHub Pages
Alternatively, you can configure the Datadog Serverless plugin to bundle ... This should not compromise the type safety of your project as skuba...
Read more >Plugins - Cypress Documentation
This GitHub Action for npm enables arbitrary actions with the npm command-line client, including testing with cypress.io and publishing to a registry.
Read more >Dependencies | @backstage/cli | npm - Open Source Insights
arrow_right @babel/core. 7.20.5 Notes
Version 7.20.5 Published November 28...
arrow_right @babel/plugin‑transform‑modules‑commonjs. 7.19.6 Notes
Version 7.19.6 Published October 20, 20...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@TejasQ There’s nothing that definitely tells you if it’s a frontend or backend package. As mentioned on slack it’s possible to check the extension of the
publishConfig.mainandpublishConfig.modulefield inpackage.json, but that’s not a completely reliable check either as it may change with custom build setups etc. It’s probably best check we have for now though, and since the lint rule is easy to disable for cases where it doesn’t fit I’m thinking it would be a good addition.I shall create an ESLint plugin for backstage since we’ll have more needs arise eventually. Already started. Here’s what I have so far: