standard / vscode-standard

VS Code extension for JavaScript Standard Style (`standard`) with automatic fixing
https://marketplace.visualstudio.com/items?itemName=standard.vscode-standard
MIT License
121 stars 24 forks source link

"operator-linebreak": ["error", "before"] not working when overriding the rule #533

Closed ckingchris closed 1 year ago

ckingchris commented 1 year ago

What version of this package are you using? v2.1.3

What operating system, Node.js, and npm version? MacOS 13.4.1

What happened? When attempting to overwrite the rule, "operator-linebreak": ["error", "before"], the error persists as the "after" rule. VSCode was restarted with every attempt to try the different suggested settings.

settings.json in VSCode

{
  "standard.validate": ["javascript"],
    "standard.engine": "semistandard",
    "standard.enableGlobally": true,
    "standard.usePackageJson": true,
    "standard.treatErrorsAsWarnings": true,
    "standard.options": {
      "rules": {
        "operator-linebreak": ["error", "before"]
      }
    },
}

package.json

"eslintConfig": {
  "extends": "semistandard",
    "rules": {
       "operator-linebreak": [
          "error",
          "before"
       ]
    }
}

What did you expect to happen? This error should not be shown if the linebreak is placed at the beginning of the line. '&&' should be placed at the end of the line. (operator-linebreak)semistandard(operator-linebreak)

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