es-tooling / eslint-plugin-depend

An ESLint plugin for suggesting optimisations in choice of dependency, native equivalents, etc.
MIT License
336 stars 4 forks source link

Error when using `allowed` #26

Closed todor-a closed 2 months ago

todor-a commented 2 months ago

I've copy-pasted the example from the docs for the allowed option, but get the following error:

Oops! Something went wrong! :(

ESLint: 8.57.0

Error: .eslintrc:
        Configuration for rule "depend/ban-dependencies" is invalid:
        Value {"allowed":["is-nan"]} should NOT have additional properties.

    at ConfigValidator.validateRuleOptions (myapp/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2048:23)
    at myapp/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2103:18
    at Array.forEach (<anonymous>)
    at ConfigValidator.validateRules (myapp/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2100:34)
    at ConfigValidator.validateConfigArray (myapp/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2226:18)
    at CascadingConfigArrayFactory._finalizeConfigArray (myapp/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3985:23)
    at CascadingConfigArrayFactory.getConfigArrayForFile (myapp/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3791:21)
    at FileEnumerator._iterateFilesRecursive (myapp/node_modules/eslint/lib/cli-engine/file-enumerator.js:450:49)
    at _iterateFilesRecursive.next (<anonymous>)
    at FileEnumerator.iterateFiles (myapp/node_modules/eslint/lib/cli-engine/file-enumerator.js:299:49)

.eslintrc:

{
  "extends": [
        "plugin:depend/recommended"
    ],
   "rules": {
        "depend/ban-dependencies": ["error", {
            "allowed": ["is-nan"]
          }],
    }
}
43081j commented 2 months ago

The version with this option in hasn't yet been released. I've been out travelling so struggling to find time to push one

I'll do what I can and get one released this week

todor-a commented 2 months ago

@43081j I've missed that. No worries, thank you.

43081j commented 2 months ago

should be released and working now 👍