Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow regex and wildcards for allowModules and other issues #332

Open
4 tasks
its-dibo opened this issue Jun 2, 2022 · 1 comment
Open
4 tasks

allow regex and wildcards for allowModules and other issues #332

its-dibo opened this issue Jun 2, 2022 · 1 comment

Comments

@its-dibo
Copy link

its-dibo commented Jun 2, 2022

it seems that the option allowModules accepts the typical module names only. it should accept wildcards and regex

  • allow wildcards and regex
  • add .ts to the default tryExtensions array
  • tryExtensions also should accept wildcards and regex
  • respect tsconfig.compilerOptions.path by default
 "node/no-extraneous-import": [
      "error",
      {
        allowModules: [        
            "@jest/globals",
             "@jest/*",
            /^@jest/,
        ],
        tryExtensions: [".js", ".ts", ".json", ".node"],
      },
    ],
@voxpelli
Copy link

eslint-plugin-n is the maintained version of this module.

We switched to it in eg. eslint-config-standard / standard and it is maintained by me and other members of the official ESLint community organization.

Try that module out and if it isn't fixed there, then open a new issue in that project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants