Giter Site home page Giter Site logo

eslint-plugin-import-extended's Introduction

eslint-plugin-import-extended

Rules

no-internal-from-external-modules

This rule prevents external modules and files from accessing a module's internals, while allowing the module itself to reference its own internals. Modules can still accessed via their index files, establishing a pattern of public vs private interfaces.

Options

Option type description Ex
moduleRoot array of strings (path or glob pattern) Sets the top level folder where a module may be accessed. [**/packages/*] or [src/modules/myModule]

Examples

Given the following folder structure:

my-project
├── packages
│   └── package-one
│       └── index.ts
│       └── internal-file-one.ts
│   └── package-two
│       └── index.ts
│       └── internal-file-two.ts
└── entry.js

And the .eslintrc file:

{
  ...
  "rules": {
    "import-extended/no-internal-from-external-modules": [ "error", {
      "moduleRoot": ["**/packages/*"],
    } ]
  }
}

The following patterns are considered problems:

// in my-project/entry.ts
import {settings} from "my-project/packages/package-one/internal-file-one";
import reducer from "my-project/packages/package-two/internal-file-two";
export * from "/packages/package-two/internal-file-two";
// in my-project/packages/package-two/index.ts
import {settings} from "my-project/packages/package-one/internal-file-one";

The following patterns are NOT considered problems:

// in my-project/packages/package-two/index.ts
import reducer from "my-project/packages/package-two/internal-file-two";
// in my-project/packages/package-one/index.ts
import { settings } from "my-project/packages/package-two;
import { settings } from "my-project/packages/package-two/index.ts;
// in my-project/entry.ts
import * from "my-project/packages/package-one;

Contributing

This projects uses Yarn Modern and Corepack. To install the project for development, you must first make sure corepack is enabled, run:

corepack enable

You can then run yarn && yarn bootstrap. The bootstrap command will configure git hooks.

eslint-plugin-import-extended's People

Contributors

iamnatch avatar noahnu avatar renovate[bot] avatar

Watchers

 avatar

eslint-plugin-import-extended's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • fix(deps): update dependency minimatch to v5.1.6
  • chore(deps): update commitlint monorepo to v17.8.1 (@commitlint/cli, @commitlint/config-conventional)
  • chore(deps): update dependency @types/eslint to v8.56.11
  • chore(deps): update dependency eslint to v8.57.0
  • chore(deps): update dependency eslint-config-prettier to v8.10.0
  • chore(deps): update dependency eslint-plugin-import to v2.29.1
  • chore(deps): update dependency prettier to v2.8.8
  • chore(deps): update yarn to v3.8.4
  • fix(deps): update dependency eslint-module-utils to v2.8.1
  • fix(deps): update dependency is-core-module to v2.15.0 (is-core-module, @types/is-core-module)
  • fix(deps): update dependency reflect-metadata to v0.2.2
  • chore(deps): update actions/checkout action to v4
  • chore(deps): update actions/setup-node action to v4
  • chore(deps): update amannn/action-semantic-pull-request action to v5
  • chore(deps): update commitlint monorepo to v19 (major) (@commitlint/cli, @commitlint/config-conventional)
  • chore(deps): update dependency @types/eslint to v9
  • chore(deps): update dependency @types/minimatch to v5
  • chore(deps): update dependency @types/node to v20
  • chore(deps): update dependency eslint to v9
  • chore(deps): update dependency eslint-config-prettier to v9
  • chore(deps): update dependency eslint-plugin-jsdoc to v50
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency jest-junit to v16
  • chore(deps): update dependency lint-staged to v15
  • chore(deps): update dependency prettier to v3
  • chore(deps): update dependency semantic-release to v24
  • chore(deps): update dependency typescript to v5
  • chore(deps): update typescript-eslint monorepo to v8 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser, @typescript-eslint/scope-manager, @typescript-eslint/utils)
  • chore(deps): update yarn to v4
  • fix(deps): update dependency minimatch to v10
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/actions/prepare/action.yml
  • actions/setup-node v3.3.0
.github/workflows/buildPR.yaml
  • actions/checkout v3
.github/workflows/lintPrTitle.yaml
  • amannn/action-semantic-pull-request v3.7.0
.github/workflows/publishToNpm.yaml
  • actions/checkout v3
npm
package.json
  • @types/is-core-module ^2.2.0
  • @typescript-eslint/scope-manager 5.27.1
  • @typescript-eslint/utils 5.27.1
  • eslint-module-utils ^2.7.3
  • is-core-module ^2.9.0
  • minimatch ^5.1.0
  • reflect-metadata 0.1.13
  • @commitlint/cli 17.0.3
  • @commitlint/config-conventional 17.0.3
  • @semantic-release/changelog 6.0.1
  • @semantic-release/exec 6.0.3
  • @types/eslint 8.4.5
  • @types/jest 27.5.2
  • @types/minimatch 3.0.5
  • @types/node 17.0.34
  • @typescript-eslint/eslint-plugin 5.27.1
  • @typescript-eslint/parser 5.27.1
  • class-validator 0.13.2
  • eslint 8.21.0
  • eslint-config-prettier 8.5.0
  • eslint-plugin-import 2.26.0
  • eslint-plugin-jsdoc 39.3.3
  • eslint-plugin-prefer-arrow 1.2.3
  • husky 8.0.1
  • jest 28.1.2
  • jest-create-mock-instance 2.0.0
  • jest-junit 13.2.0
  • lint-staged 12.5.0
  • prettier 2.7.1
  • semantic-release 19.0.3
  • ts-jest 28.0.7
  • typescript 4.6.4
  • @typescript-eslint/parser ^5.0.0
  • class-validator *
  • eslint ^8.0.0
  • node >=14
  • yarn 3.2.1
nvm
.nvmrc

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.