web前端

vscode eslint 局部禁用

2019-12-12  本文已影响0人  园Smile

const { projectId, buildId, cityId, cityName } = this.props // eslint-disable-line // 直接在本行禁用eslint


// eslint-disable-next-line  //  // 在下一行禁用eslint,类似上一种方法,只是写的位置不同罢了
function BreadcrumbNav({ pathname }) {

  const pathSnippets = pathname.split('/').filter(i => i)

  const allBreadcrumbMap = Object.assign({}, breadcrumbMap, extraBreadMap)

  return (

    <Breadcrumb>

      {pathSnippets.map((_, index) => {

        const url = `/${pathSnippets.slice(0, index + 1).join('/')}`

        return (

          <Breadcrumb.Item key={url}>{allBreadcrumbMap[url]}</Breadcrumb.Item>

        )

      })}

    </Breadcrumb>

  )

}


下面就是一波配置了:

{

  // 关闭更新

  "extensions.autoUpdate": false,

  "update.channel": "none",

  // 重新设定tabsize

  "editor.tabSize": 2,

  "editor.fontSize": 16,

  "editor.detectIndentation": false,

  //保存自动格式化

  "editor.formatOnSave": true,

  "editor.renderWhitespace": "all",

  //使用单引号

  "prettier.singleQuote": true,

  //结尾不加分号

  "prettier.semi": false,

  //开启 eslint 支持

  "prettier.eslintIntegration": false,

  //保存时eslint自动修复错误

  "eslint.autoFixOnSave": true,

  //格式LF

  "files.eol": "\n",

  "update.enableWindowsBackgroundUpdates": false,

  "editor.renderIndentGuides": false,

  "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",

  "workbench.iconTheme": null,

  "vetur.format.defaultFormatter.js": "vscode-typescript",

  //配置 ESLint 检查的文件类型

  "eslint.validate": [

    "javascript",

    "javascriptreact",

    {

      "language": "html",

      "autoFix": true

    },

    {

      "language": "vue",

      "autoFix": true

    }

  ],

  "git.enableSmartCommit": true,

  "workbench.startupEditor": "newUntitledFile",

  "git.autofetch": true,

  "emmet.excludeLanguages": [

    "markdown",

    {

      "javascript": "javascriptreact"

    }

  ],

  "javascript.updateImportsOnFileMove.enabled": "always",

  "window.zoomLevel": 0,

  "open-in-browser.default": "chrome",

  "zenMode.restore": true,

  "view-in-browser.customBrowser": "chrome"

}

上一篇下一篇

猜你喜欢

热点阅读