eslint-plugin-node icon indicating copy to clipboard operation
eslint-plugin-node copied to clipboard

allow regex and wildcards for `allowModules` and other issues

Open its-dibo opened this issue 3 years ago • 1 comments

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"],
      },
    ],

its-dibo avatar Jun 02 '22 13:06 its-dibo

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.

voxpelli avatar Aug 13 '23 12:08 voxpelli