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

'Failed to load plugin 'self' declared in '--config': enabledPluginName.replace is not a function' with v9 compatible add-on #8

Open
Standard8 opened this issue Dec 31, 2023 · 0 comments

Comments

@Standard8
Copy link

Standard8 commented Dec 31, 2023

When attempting to use this plugin with a v9 compatible add-on, a message such as this is produced:

TypeError: Failed to load plugin 'self' declared in '--config': enabledPluginName.replace is not a function
    at /Users/mark/dev/eslint-plugin-json/node_modules/eslint-plugin-self/index.js:38:53
    at Array.map (<anonymous>)
    at /Users/mark/dev/eslint-plugin-json/node_modules/eslint-plugin-self/index.js:38:10
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/mark/dev/eslint-plugin-json/node_modules/eslint-plugin-self/index.js:29:31)
    at Module._compile (/Users/mark/dev/eslint-plugin-json/test/packages/eslint-v7/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19)

The new configuration format allows for a combination of:

{
  "configs": {
    "recommended-legacy": {
      "plugins": ["json"],
      "rules": {
        "json/*": "error",
      },
    },
    "recommended": {
      "plugins": { // object that refers to the plugin itself }
      "rules": {
        "json/*": "error",
      },
    }
  }

so this needs to be handled in some manner.

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

1 participant