standard / ts-standard

Typescript style guide, linter, and formatter using StandardJS
https://www.npmjs.com/package/ts-standard
MIT License
464 stars 36 forks source link

Error: Configuration for rule "@typescript-eslint/no-unused-expressions" is invalid #162

Closed AnzenKodo closed 3 years ago

AnzenKodo commented 3 years ago

What version of this package are you using? ts-standard Version: 10.0.0

What operating system, Node.js, and npm version? OS: Ubuntu 20.04.3 LTS Node Version: 16.7.0 NPM Version: 7.21.0

What happened? Every time I open VSCode standard run once but after that, it will start to show this error. It will run through the command line but not through VSCode.

Error: --config » eslint-config-standard-with-typescript#overrides[0]:
    Configuration for rule "@typescript-eslint/no-unused-expressions" is invalid:
    Value {"allowShortCircuit":true,"allowTernary":true,"allowTaggedTemplates":true,"enforceForJSX":false} should NOT have additional properties.

    at ConfigValidator.validateRuleOptions (/home/amanv/Documents/react-app/node_modules/ts-standard/node_modules/@eslint/eslintrc/lib/shared/config-validator.js:144:23)
    at /home/amanv/Documents/react-app/node_modules/ts-standard/node_modules/@eslint/eslintrc/lib/shared/config-validator.js:199:18
    at Array.forEach (<anonymous>)
    at ConfigValidator.validateRules (/home/amanv/Documents/react-app/node_modules/ts-standard/node_modules/@eslint/eslintrc/lib/shared/config-validator.js:196:34)
    at ConfigValidator.validateConfigArray (/home/amanv/Documents/react-app/node_modules/ts-standard/node_modules/@eslint/eslintrc/lib/shared/config-validator.js:322:18)
    at CascadingConfigArrayFactory._finalizeConfigArray (/home/amanv/Documents/react-app/node_modules/ts-standard/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:493:23)
    at CascadingConfigArrayFactory.getConfigArrayForFile (/home/amanv/Documents/react-app/node_modules/ts-standard/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:299:21)
    at CLIEngine.isPathIgnored (/home/amanv/Documents/react-app/node_modules/ts-standard/node_modules/eslint/lib/cli-engine/cli-engine.js:973:18)
    at CLIEngine.executeOnText (/home/amanv/Documents/react-app/node_modules/ts-standard/node_modules/eslint/lib/cli-engine/cli-engine.js:884:38)
    at Linter.lintTextSync (/home/amanv/Documents/react-app/node_modules/standard-engine/index.js:78:55)

What did you expect to happen? It should fix or show the error after I save but it will run only at one time.

My config

  "standard.run": "onSave",
  "standard.autoFixOnSave": true,
  "standard.engine": "ts-standard",
  "editor.formatOnSave": true,
  "javascript.validate.enable": true,
  "standard.enable": true,

Are you willing to submit a pull request to fix this bug? Nope

theoludwig commented 3 years ago

Thanks for your report! @AmanKodo

If it runs, no problem with the CLI, it is most likely a problem with vscode-standard and not a problem with ts-standard. Please could you reopen your issue in the vscode-standard repo, so we can investigate? Thanks! :smile:

AnzenKodo commented 3 years ago

@Divlo the problem is gone after reinstalling both vscode-standard and ts-standard.