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] Configuration for rule "dot-notation" is invalid #303

Closed
mubaidr opened this issue May 16, 2020 · 15 comments · Fixed by #316
Closed

[Bug] Configuration for rule "dot-notation" is invalid #303

mubaidr opened this issue May 16, 2020 · 15 comments · Fixed by #316

Comments

@mubaidr
Copy link

mubaidr commented May 16, 2020

What version of this package are you using?

    "eslint": "^7.0.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-config-standard": "^14.1.1",
    "eslint-config-standard-with-typescript": "^17.0.0",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-jest": "^23.13.0",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-prettier": "^3.1.3",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-standard": "^4.0.1",

What operating system, Node.js, and npm version?
Windows: 10, Node.js: 12.16.0, mpn: 6.14.4

What happened?
version 16 for eslint-config-standard-with-typescript works fine but version 17 throws error:

Oops! Something went wrong! :(

ESLint: 7.0.0

Error: .eslintrc.json » eslint-config-standard-with-typescript » eslint-config-standard:
        Configuration for rule "dot-notation" is invalid:
        Value {"allowKeywords":true,"allowPattern":"","allowPrivateClassPropertyAccess":false} should NOT have additional properties.

    at validateRuleOptions (D:\current\brain.js\node_modules\eslint\lib\shared\config-validator.js:132:19)
    at D:\current\brain.js\node_modules\eslint\lib\shared\config-validator.js:187:9
    at Array.forEach (<anonymous>)
    at validateRules (D:\current\brain.js\node_modules\eslint\lib\shared\config-validator.js:184:30)
    at validateConfigArray (D:\current\brain.js\node_modules\eslint\lib\shared\config-validator.js:312:9)
    at CascadingConfigArrayFactory._finalizeConfigArray (D:\current\brain.js\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js:464:13)
    at CascadingConfigArrayFactory.getConfigArrayForFile (D:\current\brain.js\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js:275:21)
    at FileEnumerator._iterateFilesRecursive (D:\current\brain.js\node_modules\eslint\lib\cli-engine\file-enumerator.js:467:49)
    at _iterateFilesRecursive.next (<anonymous>)
    at FileEnumerator.iterateFiles (D:\current\brain.js\node_modules\eslint\lib\cli-engine\file-enumerator.js:287:49)

What did you expect to happen?
Lint the code normally.

Are you willing to submit a pull request to fix this bug?
I wish I could!

@mightyiam
Copy link
Owner

mightyiam commented May 16, 2020 via email

@mightyiam
Copy link
Owner

Could you please attach the output of $ npx eslint --print-config $PATH_TO_CONFIG?

@luizhp
Copy link

luizhp commented May 16, 2020

Same problem

What version of this package are you using?

"eslint": "^7.0.0",
"eslint-config-standard-with-typescript": "^17.0.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",

What operating system, Node.js, and npm version?
Ubuntu 20.04 LTS, Node.js: 12.16.3, npm: 6.14.5

What happened?
version 16 for eslint-config-standard-with-typescript works fine but version 17 throws error:

[Info  - 13:39:47] ESLint server stopped.
[Info  - 13:39:48] ESLint server running in node v12.8.1
[Info  - 13:39:48] ESLint server is running.
[Info  - 13:39:48] ESLint library loaded from: /mnt/work/developer/cursos/typescript/clean-ts-api/node_modules/eslint/lib/api.js
(node:318376) UnhandledPromiseRejectionWarning: Error: .eslintrc.json » eslint-config-standard-with-typescript » eslint-config-standard:
	Configuration for rule "dot-notation" is invalid:
	Value {"allowKeywords":true,"allowPattern":"","allowPrivateClassPropertyAccess":false} should NOT have additional properties.

    at validateRuleOptions (/mnt/work/developer/cursos/typescript/clean-ts-api/node_modules/eslint/lib/shared/config-validator.js:132:19)
    at /mnt/work/developer/cursos/typescript/clean-ts-api/node_modules/eslint/lib/shared/config-validator.js:187:9
    at Array.forEach (<anonymous>)
    at validateRules (/mnt/work/developer/cursos/typescript/clean-ts-api/node_modules/eslint/lib/shared/config-validator.js:184:30)
    at validateConfigArray (/mnt/work/developer/cursos/typescript/clean-ts-api/node_modules/eslint/lib/shared/config-validator.js:312:9)
    at CascadingConfigArrayFactory._finalizeConfigArray (/mnt/work/developer/cursos/typescript/clean-ts-api/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:464:13)
    at CascadingConfigArrayFactory.getConfigArrayForFile (/mnt/work/developer/cursos/typescript/clean-ts-api/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:275:21)
    at CLIEngine.isPathIgnored (/mnt/work/developer/cursos/typescript/clean-ts-api/node_modules/eslint/lib/cli-engine/cli-engine.js:953:18)
    at /home/luizhp/.vscode/extensions/dbaeumer.vscode-eslint-2.1.5/server/out/eslintServer.js:1:42091
    at ce (/home/luizhp/.vscode/extensions/dbaeumer.vscode-eslint-2.1.5/server/out/eslintServer.js:1:46186)

Output of $ npx eslint --print-config $PATH_TO_CONFIG

{
  "env": {
    "es6": true,
    "node": true
  },
  "globals": {
    "document": "readonly",
    "navigator": "readonly",
    "window": "readonly"
  },
  "parser": null,
  "parserOptions": {
    "project": "./tsconfig.json",
    "ecmaVersion": 2020,
    "ecmaFeatures": {
      "jsx": true
    },
    "sourceType": "module"
  },
  "plugins": [
    "standard",
    "promise",
    "node",
    "import",
    "@typescript-eslint"
  ],
  "rules": {
    "@typescript-eslint/strict-boolean-expressions": [
      "off"
    ],
    "@typescript-eslint/consistent-type-definitions": [
      "off"
    ],
    "accessor-pairs": [
      "error"
    ],
    "array-bracket-spacing": [
      "error",
      "never"
    ],
    "arrow-spacing": [
      "error",
      {
        "before": true,
        "after": true
      }
    ],
    "block-spacing": [
      "error",
      "always"
    ],
    "brace-style": [
      "error",
      "1tbs",
      {
        "allowSingleLine": true
      }
    ],
    "camelcase": [
      "error",
      {
        "properties": "never",
        "ignoreDestructuring": false,
        "ignoreImports": false
      }
    ],
    "comma-dangle": [
      "error",
      {
        "arrays": "never",
        "objects": "never",
        "imports": "never",
        "exports": "never",
        "functions": "never"
      }
    ],
    "comma-spacing": [
      "error",
      {
        "before": false,
        "after": true
      }
    ],
    "comma-style": [
      "error",
      "last"
    ],
    "computed-property-spacing": [
      "error",
      "never"
    ],
    "constructor-super": [
      "error"
    ],
    "curly": [
      "error",
      "multi-line"
    ],
    "dot-location": [
      "error",
      "property"
    ],
    "dot-notation": [
      "error",
      {
        "allowKeywords": true,
        "allowPattern": ""
      }
    ],
    "eol-last": [
      "error"
    ],
    "eqeqeq": [
      "error",
      "always",
      {
        "null": "ignore"
      }
    ],
    "func-call-spacing": [
      "error",
      "never"
    ],
    "generator-star-spacing": [
      "error",
      {
        "before": true,
        "after": true
      }
    ],
    "handle-callback-err": [
      "error",
      "^(err|error)$"
    ],
    "indent": [
      "error",
      2,
      {
        "SwitchCase": 1,
        "VariableDeclarator": 1,
        "outerIIFEBody": 1,
        "MemberExpression": 1,
        "FunctionDeclaration": {
          "parameters": 1,
          "body": 1
        },
        "FunctionExpression": {
          "parameters": 1,
          "body": 1
        },
        "CallExpression": {
          "arguments": 1
        },
        "ArrayExpression": 1,
        "ObjectExpression": 1,
        "ImportDeclaration": 1,
        "flatTernaryExpressions": false,
        "ignoreComments": false,
        "ignoredNodes": [
          "TemplateLiteral *"
        ]
      }
    ],
    "key-spacing": [
      "error",
      {
        "beforeColon": false,
        "afterColon": true
      }
    ],
    "keyword-spacing": [
      "error",
      {
        "before": true,
        "after": true
      }
    ],
    "lines-between-class-members": [
      "error",
      "always",
      {
        "exceptAfterSingleLine": true
      }
    ],
    "new-cap": [
      "error",
      {
        "newIsCap": true,
        "capIsNew": false,
        "properties": true
      }
    ],
    "new-parens": [
      "error"
    ],
    "no-array-constructor": [
      "error"
    ],
    "no-async-promise-executor": [
      "error"
    ],
    "no-caller": [
      "error"
    ],
    "no-case-declarations": [
      "error"
    ],
    "no-class-assign": [
      "error"
    ],
    "no-compare-neg-zero": [
      "error"
    ],
    "no-cond-assign": [
      "error"
    ],
    "no-const-assign": [
      "error"
    ],
    "no-constant-condition": [
      "error",
      {
        "checkLoops": false
      }
    ],
    "no-control-regex": [
      "error"
    ],
    "no-debugger": [
      "error"
    ],
    "no-delete-var": [
      "error"
    ],
    "no-dupe-args": [
      "error"
    ],
    "no-dupe-class-members": [
      "error"
    ],
    "no-dupe-keys": [
      "error"
    ],
    "no-duplicate-case": [
      "error"
    ],
    "no-empty-character-class": [
      "error"
    ],
    "no-empty-pattern": [
      "error"
    ],
    "no-eval": [
      "error"
    ],
    "no-ex-assign": [
      "error"
    ],
    "no-extend-native": [
      "error"
    ],
    "no-extra-bind": [
      "error"
    ],
    "no-extra-boolean-cast": [
      "error"
    ],
    "no-extra-parens": [
      "error",
      "functions"
    ],
    "no-fallthrough": [
      "error"
    ],
    "no-floating-decimal": [
      "error"
    ],
    "no-func-assign": [
      "error"
    ],
    "no-global-assign": [
      "error"
    ],
    "no-implied-eval": [
      "error"
    ],
    "no-inner-declarations": [
      "error",
      "functions"
    ],
    "no-invalid-regexp": [
      "error"
    ],
    "no-irregular-whitespace": [
      "error"
    ],
    "no-iterator": [
      "error"
    ],
    "no-labels": [
      "error",
      {
        "allowLoop": false,
        "allowSwitch": false
      }
    ],
    "no-lone-blocks": [
      "error"
    ],
    "no-misleading-character-class": [
      "error"
    ],
    "no-prototype-builtins": [
      "error"
    ],
    "no-useless-catch": [
      "error"
    ],
    "no-mixed-operators": [
      "error",
      {
        "groups": [
          [
            "==",
            "!=",
            "===",
            "!==",
            ">",
            ">=",
            "<",
            "<="
          ],
          [
            "&&",
            "||"
          ],
          [
            "in",
            "instanceof"
          ]
        ],
        "allowSamePrecedence": true
      }
    ],
    "no-mixed-spaces-and-tabs": [
      "error"
    ],
    "no-multi-spaces": [
      "error"
    ],
    "no-multi-str": [
      "error"
    ],
    "no-multiple-empty-lines": [
      "error",
      {
        "max": 1,
        "maxEOF": 0
      }
    ],
    "no-negated-in-lhs": [
      "error"
    ],
    "no-new": [
      "error"
    ],
    "no-new-func": [
      "error"
    ],
    "no-new-object": [
      "error"
    ],
    "no-new-require": [
      "error"
    ],
    "no-new-symbol": [
      "error"
    ],
    "no-new-wrappers": [
      "error"
    ],
    "no-obj-calls": [
      "error"
    ],
    "no-octal": [
      "error"
    ],
    "no-octal-escape": [
      "error"
    ],
    "no-path-concat": [
      "error"
    ],
    "no-proto": [
      "error"
    ],
    "no-redeclare": [
      "error",
      {
        "builtinGlobals": false
      }
    ],
    "no-regex-spaces": [
      "error"
    ],
    "no-return-assign": [
      "error",
      "except-parens"
    ],
    "no-self-assign": [
      "error",
      {
        "props": true
      }
    ],
    "no-self-compare": [
      "error"
    ],
    "no-sequences": [
      "error"
    ],
    "no-shadow-restricted-names": [
      "error"
    ],
    "no-sparse-arrays": [
      "error"
    ],
    "no-tabs": [
      "error"
    ],
    "no-template-curly-in-string": [
      "error"
    ],
    "no-this-before-super": [
      "error"
    ],
    "no-throw-literal": [
      "error"
    ],
    "no-trailing-spaces": [
      "error"
    ],
    "no-undef": [
      "error"
    ],
    "no-undef-init": [
      "error"
    ],
    "no-unexpected-multiline": [
      "error"
    ],
    "no-unmodified-loop-condition": [
      "error"
    ],
    "no-unneeded-ternary": [
      "error",
      {
        "defaultAssignment": false
      }
    ],
    "no-unreachable": [
      "error"
    ],
    "no-unsafe-finally": [
      "error"
    ],
    "no-unsafe-negation": [
      "error"
    ],
    "no-unused-expressions": [
      "error",
      {
        "allowShortCircuit": true,
        "allowTernary": true,
        "allowTaggedTemplates": true
      }
    ],
    "no-unused-vars": [
      "error",
      {
        "vars": "all",
        "args": "none",
        "ignoreRestSiblings": true
      }
    ],
    "no-use-before-define": [
      "error",
      {
        "functions": false,
        "classes": false,
        "variables": false
      }
    ],
    "no-useless-call": [
      "error"
    ],
    "no-useless-computed-key": [
      "error"
    ],
    "no-useless-constructor": [
      "error"
    ],
    "no-useless-escape": [
      "error"
    ],
    "no-useless-rename": [
      "error"
    ],
    "no-useless-return": [
      "error"
    ],
    "no-void": [
      "error"
    ],
    "no-whitespace-before-property": [
      "error"
    ],
    "no-with": [
      "error"
    ],
    "object-curly-newline": [
      "error",
      {
        "multiline": true,
        "consistent": true
      }
    ],
    "object-curly-spacing": [
      "error",
      "always"
    ],
    "object-property-newline": [
      "error",
      {
        "allowMultiplePropertiesPerLine": true,
        "allowAllPropertiesOnSameLine": false
      }
    ],
    "one-var": [
      "error",
      {
        "initialized": "never"
      }
    ],
    "operator-linebreak": [
      "error",
      "after",
      {
        "overrides": {
          "?": "before",
          ":": "before",
          "|>": "before"
        }
      }
    ],
    "padded-blocks": [
      "error",
      {
        "blocks": "never",
        "switches": "never",
        "classes": "never"
      }
    ],
    "prefer-const": [
      "error",
      {
        "destructuring": "all",
        "ignoreReadBeforeAssign": false
      }
    ],
    "prefer-promise-reject-errors": [
      "error"
    ],
    "quote-props": [
      "error",
      "as-needed"
    ],
    "quotes": [
      "error",
      "single",
      {
        "avoidEscape": true,
        "allowTemplateLiterals": false
      }
    ],
    "rest-spread-spacing": [
      "error",
      "never"
    ],
    "semi": [
      "error",
      "never"
    ],
    "semi-spacing": [
      "error",
      {
        "before": false,
        "after": true
      }
    ],
    "space-before-blocks": [
      "error",
      "always"
    ],
    "space-before-function-paren": [
      "error",
      "always"
    ],
    "space-in-parens": [
      "error",
      "never"
    ],
    "space-infix-ops": [
      "error"
    ],
    "space-unary-ops": [
      "error",
      {
        "words": true,
        "nonwords": false
      }
    ],
    "spaced-comment": [
      "error",
      "always",
      {
        "line": {
          "markers": [
            "*package",
            "!",
            "/",
            ",",
            "="
          ]
        },
        "block": {
          "balanced": true,
          "markers": [
            "*package",
            "!",
            ",",
            ":",
            "::",
            "flow-include"
          ],
          "exceptions": [
            "*"
          ]
        }
      }
    ],
    "symbol-description": [
      "error"
    ],
    "template-curly-spacing": [
      "error",
      "never"
    ],
    "template-tag-spacing": [
      "error",
      "never"
    ],
    "unicode-bom": [
      "error",
      "never"
    ],
    "use-isnan": [
      "error"
    ],
    "valid-typeof": [
      "error",
      {
        "requireStringLiterals": true
      }
    ],
    "wrap-iife": [
      "error",
      "any",
      {
        "functionPrototypeMethods": true
      }
    ],
    "yield-star-spacing": [
      "error",
      "both"
    ],
    "yoda": [
      "error",
      "never"
    ],
    "import/export": [
      "error"
    ],
    "import/first": [
      "error"
    ],
    "import/no-absolute-path": [
      "error",
      {
        "esmodule": true,
        "commonjs": true,
        "amd": false
      }
    ],
    "import/no-duplicates": [
      "error"
    ],
    "import/no-named-default": [
      "error"
    ],
    "import/no-webpack-loader-syntax": [
      "error"
    ],
    "node/no-deprecated-api": [
      "error"
    ],
    "node/process-exit-as-throw": [
      "error"
    ],
    "promise/param-names": [
      "error"
    ],
    "standard/no-callback-literal": [
      "error"
    ]
  },
  "settings": {},
  "ignorePatterns": [
    "./docs",
    "node_modules",
    "dist",
    "coverage",
    "./data",
    "requirements",
    ".vscode"
  ]
}

What did you expect to happen?
Lint the code normally.

Are you willing to submit a pull request to fix this bug?
No, just report

Thanks

@mightyiam
Copy link
Owner

I would like to examine this hands on. Could anyone please provide a minimal reproduction repository?

@mubaidr
Copy link
Author

mubaidr commented May 17, 2020

@mightyiam Just update the version and try: https://github.com/BrainJS/brain.js/tree/git-hooks

@gabrielrtomio
Copy link

gabrielrtomio commented May 18, 2020

I have same problem

"@typescript-eslint/eslint-plugin": "^2.34.0",
"eslint": "^7.0.0",
"eslint-config-standard-with-typescript": "^17.0.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1"

I changed eslint-config-standard-with-typescript to 16.0.0 to fix now.

@leandroCodeDev
Copy link

Same problem

What version of this package are you using?

    "@typescript-eslint/eslint-plugin": "^2.34.0",
    "eslint": "^7.0.0",
    "eslint-config-standard-with-typescript": "^17.0.0",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-standard": "^4.0.1",

What operating system, Node.js, and npm version?
Ubuntu 18.04 LTS, Node.js: 12.16.3, npm: 6.14.4.

this repository has minimal configuration: error-standard-with-typescript

@mightyiam
Copy link
Owner

Thank you for the reproductions. Have not gotten to the bottom of this yet.

@mightyiam mightyiam pinned this issue May 19, 2020
@andrefilimono
Copy link

andrefilimono commented May 19, 2020

It looks like a bug in typescript-eslint plugin.
It passes the new parameter "allowPrivateClassPropertyAccess" to eslint although eslint:dot-notation rule forbids using additional properties.

@mubaidr
Copy link
Author

mubaidr commented May 19, 2020

Strange but why does this only happens when using: v"eslint-config-standard-with-typescript": "^17.0.0"?

@andrefilimono
Copy link

@mubaidr because support of the new rule dot-notation has been added in that release.

@mubaidr
Copy link
Author

mubaidr commented May 19, 2020

Created new issue in typescript-eslint, link for follow-up: typescript-eslint/typescript-eslint#2047

@andrefilimono
Copy link

This PR should fix the issue #314

@mightyiam
Copy link
Owner

This seems to be our own issue.

Does anyone know how to write a test that would trigger this issue and fail for it, please? Or at least provide some hint for that?

@mightyiam mightyiam reopened this May 21, 2020
mightyiam pushed a commit that referenced this issue May 25, 2020
This fixes #303 invalid configuration for dot-notation
@mightyiam mightyiam unpinned this issue Jul 16, 2020
@luisalcarasr
Copy link

This may help anyone looking for a solution.

{
    "parserOptions": {
        "project": ["path/to/your/tsconfig/file"]
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants