10000 TSLint: no-implicit-dependencies should be enabled · Issue #25 · ethereumjs/ethereumjs-config · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.
This repository was archived by the owner on Oct 30, 2024. It is now read-only.
TSLint: no-implicit-dependencies should be enabled #25
@alcuadrado

Description

@alcuadrado

Some context: Yesterday Web3.js released a broken package. The problem was that one of its modules was doing a require of a dependency of a devDependency. I took some time to see if this could accidentally happen in EthereumJS and couldn't find anything preventing it.

I think we should enable tslint's no-implicit-dependencies rule, that prevents this from happening.

It has a small annoyance though. For it to actually work, it should only consider dependencies and peerDependencies as valid, so anything installed in devDependencies that is used in a test will be flagged as an error if we use the same tslint config for tests.

There are two ways to solve that:

  1. Instructing tslint to also consider devDependencies as installed. This is pretty dangerous.
  2. Whitelisting some dependencies. Also kinda dangerous, depending on how many they are. For example, if it's only something like chai, it may be ok, as nobody would use chai outside of a test.
  3. Adding // ts-lint-disable-next-line no-implicit-dependencies before any conflicting require in the test files.

This is a great first issue, as the change is very small, but it exposes you to the release process of this library. We need to merge it here, release a new ethereumjs-config version, and update it in the other projects.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0