vscode报错Replace `␍⏎········的解决方案

本文介绍了解决从他人处克隆代码后遇到的格式化问题的方法。主要通过获取原始作者的VSCode配置文件来统一代码风格,避免因不同配置导致的格式差异。文中还分享了一个具体的VSCode配置示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这里写自定义目录标题


看到这个报错,懵逼了吧
百度了方法不管用对吧?

这个问题其实是我们在克隆别人的代码之后发生的问题 其实就是格式化的一个问题 原来代码上传者的格式化配置和我们的不一样 所以最好的解决犯法就是找原来写代码的要他
vscode的配置文件
具体是打开设置 搜索eslint 然后选择在setting中打开 最后把他的配置复制过来
在这里插入图片描述
如我的是这样的 如果找不到原开发者的也可以试一试我的


{
    "eslint.autoFixOnSave": true, // 每次保存的时候将代码按eslint格式进行修复
    // "prettier.eslintIntegration": true, //让prettier使用eslint的代码格式进行校验
    "workbench.editor.enablePreview": false, //打开文件不覆盖
    "files.associations": {
        "*.vue": "vue",
        "*.cjson": "jsonc",
        "*.wxss": "css",
        "*.wxs": "javascript"
    },
    "eslint.format.enable": true,
    "emmet.triggerExpansionOnTab": false,
    "eslint.options": {
        "extensions": [
            ".js",
            ".vue"
        ]
    },
    "search.exclude": {
        "**/bower_components": false,
        "**/node_modules": false
    },
    "emmet.syntaxProfiles": {
        "javascript": "jsx",
        "vue": "html",
        "vue-html": "html"
    },
    "git.confirmSync": false,
    "window.zoomLevel": 0,
    "editor.renderWhitespace": "boundary",
    "editor.cursorBlinking": "smooth",
    "editor.minimap.enabled": true,
    "editor.minimap.renderCharacters": false,
    "editor.fontFamily": "'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
    "window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",
    "editor.codeLens": true,
    "editor.snippetSuggestions": "top",
    "workbench.colorTheme": "Visual Studio Dark",
    "editor.fontSize": 20,
    "git.autofetch": true,
    "git.enableSmartCommit": true,
    "prettier.semi": false, //去掉代码结尾的分号
    "eslint.validate": [
        "javascript",
        "javascriptreact",
        {
            "language": "vue",
            "autoFix": true
        },
        "typescript",
        "typescriptreact"
    ],
    "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
    "javascript.updateImportsOnFileMove.enabled": "always",
    "emmet.includeLanguages": {
        "wxml": "html"
    },
    "minapp-vscode.disableAutoConfig": true,
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    "files.autoSave": "onFocusChange",
    "terminal.integrated.rendererType": "dom",
    "[vue]": {
        "editor.defaultFormatter": "octref.vetur"
    },
    "[javascript]": {
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "eslint.codeAction.showDocumentation": {
    
        "enable": true
    }
    
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值