Skip to content
This repository was archived by the owner on Oct 4, 2022. It is now read-only.
This repository was archived by the owner on Oct 4, 2022. It is now read-only.

Add eslint rule to avoid direct import from other packages. #268

Open
@abotteram

Description

@abotteram

Explanation

When importing a dependency we should not allow "direct" imports (from other packages) like this:

import transliterate from "yoastseo/src/stringProcessing/transliterate";
instead we should use this:

import { string } from "yoastseo";
const { transliterate } = string;

This is because direct imports cause problems in the plugin's webpack configuration.

To avoid problems in the future we should have an eslint rule that prohibits direct imports across packages.

Technical decisions

Feedback?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions