Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ERR_IMPORT_ASSERTION_TYPE_MISSING with json config package #3970

@stefanprobst

Description

@stefanprobst

Steps to Reproduce

  1. clone repro in https://github.com/stefanprobst/issue-commitlint-json
  2. install deps with pnpm install and run pnpm run lint
  3. see error message:
TypeError [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "file:///data/Development/playground/com/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@acdh-oeaw/commitlint-config/commitlintrc.json" needs an import attribute of type "json"
    at validateAttributes (node:internal/modules/esm/assert:89:15)
    at defaultLoad (node:internal/modules/esm/load:153:3)
    at async ModuleLoader.load (node:internal/modules/esm/loader:409:7)
    at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:45)
    at async link (node:internal/modules/esm/module_job:76:21) {
  code: 'ERR_IMPORT_ASSERTION_TYPE_MISSING'

Current Behavior

extending a package with provides a .json commitlint config currently fails with "ERR_IMPORT_ASSERTION_TYPE_MISSING" error.

Expected Behavior

should work like it did with version 18.

see the v18 branch in the issue reproduction repo, which works.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

No response

Context

No response

commitlint --version

@commitlint/[email protected]

git --version

git version 2.43.2

node --version

v20.11.1

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