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

Configuration for rule "unicorn/explicit-length-check" is invalid #486

Open
stheine opened this issue Jul 18, 2022 · 0 comments
Open

Configuration for rule "unicorn/explicit-length-check" is invalid #486

stheine opened this issue Jul 18, 2022 · 0 comments

Comments

@stheine
Copy link

stheine commented Jul 18, 2022

Error: .eslintrc.cjs » eslint-config-es/node:
Configuration for rule "unicorn/explicit-length-check" is invalid:
Value {"nonZero":"greaterThan","non-zero":"greater-than"} should NOT have additional properties.

is showing with eslint-plugin-unicorn@39.0.0 and later (current is 42.0.0).

package.json:

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "type": "module",
  "main": "test.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "eslint": "8.18.0",
    "eslint-config-es": "4.2.0",
    "eslint-plugin-eslint-comments": "3.2.0",
    "eslint-plugin-extended": "0.2.0",
    "eslint-plugin-import": "2.26.0",
    "eslint-plugin-mocha": "10.0.5",
    "eslint-plugin-unicorn": "42.0.0"
  }
}

.eslintrc.cjs:

module.exports = {
  extends: [
    'es/node'
  ],
  parserOptions: {
    sourceType: 'module'
  },
  rules: {
  }
}

eslint test.js

results in the error

Error: .eslintrc.cjs » eslint-config-es/node:
        Configuration for rule "unicorn/explicit-length-check" is invalid:
        Value {"nonZero":"greaterThan","non-zero":"greater-than"} should NOT have additional properties.

and it's not possible to even disable that rule by:

  rules: {
    'unicorn/explicit-length-check': 0
  }

I guess you need to update this rule in eslint-config-es

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