Comments (3)
consistent-type-imports/ and consistent-type-exports/ rules do address this. Their usage is detailed on elsint blog.
Applying them on lodestar
code base produces the following result:
✖ 3176 problems (3114 errors, 62 warnings)
3104 errors and 0 warnings potentially fixable with the `--fix` option.
Most of those errors can be fixed by eslint
. Evenso the number of files impacted is huge, it might still be woth doing for the following reasons:
- do not depend on import side-effects for proper behavior
- allow tree-shaker to remove unneeded code (and reduce bundle sizes)
from lodestar.
I'm in favor of adding these linter rules 👍
- Also linking this other issue, #6011, since a nice endgame would be to have consistent rules across all our maintained repos.
from lodestar.
it might still be woth doing for the following reasons:
Looking at some examples in our code
It does not look like it make any difference as tsc is smart enough already to remove if from if only used as a type (I'd assume same applies for other bundlers)
Note that we already have import/no-extraneous-dependencies
which prevents you from using fastify as a value in the api package as it is only a dev dependency.
I am not fully convinced that type imports are that useful in most cases, do we have an example in Lodestar were this makes a difference? As far as I can see the change from normal to type imports in #6384 does not matter
Not against adding these rules but we should have at least one specific case were a lint rule would have saved us before adding it.
from lodestar.
Related Issues (20)
- Electra tracker
- Lazily load spec tests for beacon-node and validator
- Support all network configs
- named stack traces on ssz type errors
- Flaky tests HOT 5
- Error: Unable to fetch weak subjectivity state: This operation was aborted HOT 6
- Error setting agentVersion for the peer HOT 3
- Fail to load lodestar libs when using vite
- Add known issues page to docs HOT 2
- Do early notifyNewPayload call to execution engine HOT 2
- Too many unknown peers in test mainnet nodes HOT 5
- Proposal for reorganizing shuffling code HOT 3
- Ignore known blocks submitted through API HOT 1
- Lodestar VC publishes validator registrations for withdrawn validators HOT 2
- BLOCK_ERROR_DATA_UNAVAILABLE errors if blobs are late HOT 3
- Improve type safety of CLI args
- Reduce code duplication in tests HOT 25
- Increased attester duties response times since Deneb HOT 1
- Vouch cannot attest via Lodestar HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lodestar.