Skip to content

bug report: eslint-plugin-no-autofix does not support flat config & has no typescript declaration file #92

Open
@Zamiell

Description

@Zamiell

I am importing the plugin like this:

import ESLintPluginNoAutoFix from "eslint-plugin-no-autofix";

However, it doesn't work, giving the following error:

Error [ERR_REQUIRE_ESM]: require() of ES Module D:\Repositories\isaacscript\node_modules\eslint-plugin-isaacscript\dist\index.js from D:\Repositories\isaacscript\node_modules\eslint-plugin-no-autofix\lib\rules.js not supported.
Instead change the require of index.js in D:\Repositories\isaacscript\node_modules\eslint-plugin-no-autofix\lib\rules.js to a dynamic import() which is available in all CommonJS modules.
    at D:\Repositories\isaacscript\node_modules\eslint-plugin-no-autofix\lib\rules.js:72:20
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (D:\Repositories\isaacscript\node_modules\eslint-plugin-no-autofix\lib\rules.js:71:9)

Thus, it seems that this plugin does not support the flat config.

Additionally, importing this plugin gives a TypeScript error:

Could not find a declaration file for module 'eslint-plugin-no-autofix'. 'd:/Repositories/isaacscript/node_modules/eslint-plugin-no-autofix/lib/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/eslint-plugin-no-autofix` if it exists or add a new declaration (.d.ts) file containing `declare module 'eslint-plugin-no-autofix';`ts(7016)

Please consider adding a declaration file for this plugin, as it avoids the end-user having to do a @ts-ignore and so on.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions