vscode配置文件-vutur自动格式化-eslint校验-属性换行

这篇具有很好参考价值的文章主要介绍了vscode配置文件-vutur自动格式化-eslint校验-属性换行。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

vscode配置文件-vutur自动格式化-eslint校验-属性换行

{
    // eslint 配置
    "eslint.enable": true,
    "eslint.run": "onType",
    "eslint.options": {
        "extensions": [
            ".js",
            ".vue",
            ".jsx",
            ".tsx"
        ]
    },
    // 自动格式化代码设置
    "editor.codeActionsOnSave": {
         "source.fixAll": true,
        // "source.fixAll.eslint": true,
        // 保存时格式化
        "editor.formatOnSave": true,
    },
    "vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            // "wrap_line_length": 250, // 换行字符串阈值
            "tabWidth": 20, // tab缩进大小,默认为2
            "semi": false, // 去掉末尾分号
            // "htmlWhitespaceSensitivity": "strict", // html空格敏感度,可选值:'css'(样式表)|'strict'(严格)|'ignore'(忽略)
            // "vueIndentScriptAndStyle": true, // vue文件中的script及style标签缩进
            // "endOfLine": "auto", // 结尾是 \n \r \n\r auto
            // auto 不进行格式化
            // force 首个属性与开始标签共一行,最后的属性与开始标签结束的 > 符号共一行,其他属性单独一行。
            // force-aligned 所有属性强制对齐,若组件名较长太不美观,不建议使用。
            // force-expand-multiline 所有属性单独占据一行且对齐。开始标签和开始标签结束的 > 符号同样单独占据一行。
            "wrap_attributes": "force-aligned", //属性换行
            // "end_with_newline": false,
        },
        "prettyhtml": {
            // "printWidth": 100,
            "singleQuote": false, // //去掉末尾分号
            // "wrapAttributes": false,
            "sortAttributes": false
        },
        "prettier": {
            // "semi": true, //去掉末尾分号
            "trailingComma": true, // 这个就是设置是否末尾添加逗号的字段
            "singleQuote": true //将所有双引号改为单引号
        }
    },
    // #让vue中的js按"prettier"格式进行格式化
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "vetur.format.defaultFormatter.js": "prettier",
    "path-autocomplete.extensionOnImport": true,
    "path-autocomplete.pathMappings": {
        "@": "${folder}/src"
    },
    "security.workspace.trust.untrustedFiles": "open",
    "editor.fontSize": 15,
    "liveServer.settings.donotShowInfoMsg": true,
    "less.compile": {
        "out": "../css/"
    },
    "editor.tabSize": 2,
    "[javascript]": {
        "editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
    },
    "[vue]": {
        "editor.defaultFormatter": "octref.vetur"
    },
    "workbench.startupEditor": "none",
    "explorer.confirmDelete": false,
    "[html]": {
        "editor.defaultFormatter": "vscode.html-language-features"
    },
    "cssrem.rootFontSize": 80,
    "cssrem.vwDesign": 1920,
    "[typescript]": {
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "liveServer.settings.port": 0,
    "vetur.validation.interpolation": false,
    "vetur.validation.script": false,
    "git.confirmSync": false,
    "git.enableSmartCommit": true,
    "editor.inlineSuggest.enabled": true,
    "eslint.trace.server": "off",
    "eslint.alwaysShowStatus": true,
    "github.copilot.enable": {
        "*": true,
        "yaml": false,
        "plaintext": false,
        "markdown": false
    },
    "git.openRepositoryInParentFolders": "always",
    "terminal.integrated.enableMultiLinePasteWarning": false,
    "eslint.nodeEnv": "",
    "editor.semanticTokenColorCustomizations": {},
    "editor.tokenColorCustomizations": {},
    "editor.bracketPairColorization.independentColorPoolPerBracketType": true,
    "editor.formatOnSave": true,
    "window.openFoldersInNewWindow": "on",
    "window.openFilesInNewWindow": "on",
    "editor.formatOnPaste": true,
    "backgroundCover.imagePath": "c:\\Users\\85839\\Pictures\\壁纸\\QQ截图20230412214624.png",
    "backgroundCover.opacity": 0.3,
    "backgroundCover.randomImageFolder": "c:\\Users\\85839\\Pictures\\壁纸",
    "backgroundCover.autoStatus": true,
    "workbench.colorTheme": "Default Dark+ Experimental",
    "[jsonc]": {
        "editor.defaultFormatter": "vscode.json-language-features"
    },
    "javascript.updateImportsOnFileMove.enabled": "always",
    "diffEditor.ignoreTrimWhitespace": false
}

效果
vetur配置换行,vscode,javascript,前端文章来源地址https://www.toymoban.com/news/detail-768707.html

到了这里,关于vscode配置文件-vutur自动格式化-eslint校验-属性换行的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • ESLint自动格式化代码

    ESLint是干什么的 ESLint 是在 ECMAScript/JavaScript 代码中识别和报告模式匹配的工具,它的目标是保证代码的一致性和避免错误。在许多方面,它和 JSLint、JSHint 相似。 ESLint 是完全插件化的。每一个规则都是一个插件并且你可以在运行时添加更多的规则。 而ESlint重点并不在于对代

    2024年03月14日
    浏览(53)
  • vscode自动格式化插件配置说明(Prettier - Code formatter)

    1、在应用商店搜索Prettier并下载 2、下载完成之后点击扩展设置  3、点击右上角json配置文件  4、在文件中添加如下代码 5、如果需要格式化vue文件,建议配合ESLint、Vetur两个插件一起使用  一款好用的eslint自动修复插件:eslint-config

    2024年02月12日
    浏览(49)
  • VScode自动格式化代码(tab缩进、符号空格)配置beautify插件使用

    安装插件 在插件库搜索beautify,会弹出很多插件 你需要根据你自己的语言选择对应的插件安装,尽量选择在维护中的插件 我是做前端的,所以选择的是beautify blade,格式化语言:javascript, JSON, CSS, Sass, and HTML ![在这里插入图片描述](https://img-blog.csdnimg.cn/cc42b7d4f0b549a78d16c69e7d33

    2024年02月12日
    浏览(47)
  • webstorm配置eslint一键格式化代码

    安装eslint插件:npm install --save-dev eslint-config-vue eslint-plugin-vue 创建eslintrc.js文件,添加相关代码规范(根据自己喜好进行调整) webstorm进行快捷键设置 这样在页面使用Alt + S,即可一键格式化代码了

    2024年02月01日
    浏览(49)
  • VScode保存自动格式化

    要在Visual Studio Code(VS Code)中关闭保存自动格式化功能,您可以按照以下步骤操作: 这样,您就成功取消了在VS Code中保存时自动格式化的功能。这个设置可以帮助您在编写代码时更加自由地控制代码格式,适应个人的编码习惯。如果您需要重新启用自动格式化功能,只

    2024年03月26日
    浏览(47)
  • vscode保存时自动格式化设置

    最后更新日期:2022-10-29 操作系统:Windows 11 专业版 vscode版本:1.72.2 打开vscode设置面板,在设置中搜索 format ,选择 Editor: Format On Save ,此后每当 ctrl + s 保存时,则自动格式化。 以上。

    2024年02月09日
    浏览(50)
  • VSCode 取消保存时自动格式化

    目前收集了三个方法: 1、如果添加  JS-CS-HTML Formatter 这个扩展,可以将其禁用 2、设置code action on save  修改setting.json文件,在此文件中添加一行 3、关闭设置中的 Editor:Format On Save 打开设置,搜索 format

    2024年02月14日
    浏览(38)
  • vscode格式化代码禁止自动换行

    问题产生 代码格式化的功能由插件提供,比如veture,默认的配置超过很短的长度就回换行。 所以需要修改配置。 打开 文件 - 首选项 - 设置,然后点击右上角的图标。进入settings.json文件。 搜狗截图20220421170631.png 在这里面写配置。 问题解决 1.使用Prettier - Code formatter来格式化

    2024年02月06日
    浏览(45)
  • vscode中如何实现保存自动格式化代码

    两种方法: 1.配置settings.json 文件 第一步,点击 文件 首选项 设置   进入setting.json编辑页面,将下方设置项粘贴到大括号中: \\\"editor.formatOnType\\\": true, \\\"editor.formatOnSave\\\": true, 一定记得前边加个逗号  2.直接在设置中配置一个选项即可      

    2024年02月07日
    浏览(52)
  • VsCode设置保存自动格式化(一步就够)

    在  VsCode  中我们可以通过设置来实现保存文件时自动格式化代码,具体步骤如下: 1.点击 设置 ,输入 格式化 ,如下图 2.将 Editor:Format On Save 选项勾选上即可 3.关闭 设置 页面,此时保存文件同时代码会自动格式化 希望本文能够对您有所帮助!如果您有任何问题或建议,请

    2024年01月17日
    浏览(45)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包