Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eslint with prettier: line break after "="

I have an issue with the eslint + prettier. For some reason I have some "line breaks" like this:

var err = "jqxhr: " + jqxhr + ". Status: " + textStatus + ", " + error;

Will be beautified by tool as:

var err =
    "jqxhr: " + jqxhr + ". Status: " + textStatus + ", " + error;

(https://gyazo.com/ef44b03a25292f5e6e156c3105ef7c3b)

How can I prevent such behavior? Thanks!

Config example:

{
    "root": true,
    "extends": [
        "prettier",
        "prettier/standard"
    ],
    "env": {
        "browser": true,
        "jquery": true
    },
    "plugins": [
        "prettier"
    ],
    "rules": {
        "prettier/prettier": [
            "error"
        ],
        "indent": [
            "error",
            4
        ],
        "linebreak-style": [
            "error",
            "unix"
        ],
        "max-len": [
            "error",
            {"code": 120, "ignoreUrls": true}
        ]
    }
}
like image 482
name Avatar asked Sep 18 '25 14:09

name


1 Answers

If you have similar problem check the line printWidth and operator-linebreak. My case was related with printWidth

like image 64
name Avatar answered Sep 21 '25 14:09

name