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

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

Open
Zamiell opened this issue May 29, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Zamiell
Copy link

Zamiell commented May 29, 2024

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.

@Zamiell Zamiell added the bug Something isn't working label May 29, 2024
@Zamiell Zamiell changed the title bug report: eslint-plugin-no-autofix has no typescript declaration file bug report: eslint-plugin-no-autofix does not support flat config & has no typescript declaration file May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants