Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Hard time to get it to work with a project that has .mjs files #615

@Milad

Description

@Milad

Bug Description

I have a project that has mjs files. Depcheck doesn't check them out of the box.

Code snippets

Where the dependency is used:

index.mjs:

import axios from 'axios';

Where the dependency is listed in package.json:

{
  "name": "my-depcheck",
  "version": "1.0.0",
  "description": "",
  "main": "index.mjs",
  "scripts": {
    "depcheck": "depcheck",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "depcheck": "^1.3.1"
  },
  "dependencies": {
    "axios": "^0.21.0"
  }
}

Versions

  • node -v: v14.15.1
  • npm -v: 6.14.9
  • depcheck --version: 1.3.1

Extra info

I tried to create a file .depcheckrc but it didn't help!

parsers:
  '*.mjs':
    - 'es6'

JSON output:

{
  "dependencies": [
    "axios"
  ],
  "devDependencies": [],
  "missing": {},
  "using": {
    "depcheck": [
      "~/Projects/my-depcheck/package.json"
    ]
  },
  "invalidFiles": {},
  "invalidDirs": {}
}

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