Skip to content

[eslint-plugin-azure-sdk] Relax package.json module field rule #15873

@witemple-msft

Description

@witemple-msft

Currently there's a linter rule that requires that we put a specific path in our module field in our package.json (e.g. "module": "./dist-esm/src/index.js"), but this rule doesn't work for packages that have source-level shared code imports (such as keyvault, identity-cache-persistence, and identity-vscode).

For those packages, a deeper module entry is required: "module": "dist-esm/identity-vscode/src/index.js". This is required because the TypeScript compiler will deepen the output directory to make it a mirror of the input file root, which is increased by a directory level when we import from shared code folders.

Better logic for this rule is probably just to:

  1. Check if the path starts with dist-esm/
  2. Check if the next components of the path are ancestors of the package folder
  3. Check if the path ends with ${packageName}/src/index.js

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions