Skip to content

No default export found in imported module "react-checkbox-tree" #440

@abrenneke

Description

@abrenneke

I'm getting No default export found in imported module "react-checkbox-tree" after upgrading to ESLint 9 and eslint-plugin-import-x.

Relevant eslint.config.mjs config matches the main readme example here:

import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
import { createNodeResolver, importX } from 'eslint-plugin-import-x';

...

[
  importX.flatConfigs.recommended,
  importX.flatConfigs.typescript,
  {
    settings: {
      'import-x/resolver-next': [
        createTypeScriptImportResolver({
          alwaysTryTypes: true,
          project: 'packages/*/tsconfig.json',
          noWarnOnMultipleProjects: true,
        }),
        createNodeResolver(),
      ],
    },
    ...etc
  }

The import looks like this:

import CheckboxTree from 'react-checkbox-tree';

The react-checkbox-tree's index.d.ts looks like this:

import * as React from 'react';

declare module "react-checkbox-tree" {
    ...etc

    interface CheckboxProps {
        ...etc
    }

    export default class CheckboxTree extends React.Component<CheckboxProps> {}
}

TypeScript's LSP is able to navigate to the default export from the package no problem.

Not sure if the problem is somewhere in my configuration, import-x, or the types for react-checkbox-tree. Perhaps it is because of the minified lib/index.js of react-checkbox-tree? Appears to be a UMD module at first glance.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions