<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lindsey Bradford</title>
    <description>The latest articles on DEV Community by Lindsey Bradford (@lindseybradford).</description>
    <link>https://dev.to/lindseybradford</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F286080%2F6e4ee292-934d-4b99-83be-b98e0fc09529.jpg</url>
      <title>DEV Community: Lindsey Bradford</title>
      <link>https://dev.to/lindseybradford</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lindseybradford"/>
    <language>en</language>
    <item>
      <title>ES Lint, Prettier, Vetur, VSCode: Ironing out the conflicts</title>
      <dc:creator>Lindsey Bradford</dc:creator>
      <pubDate>Sat, 11 Apr 2020 13:21:13 +0000</pubDate>
      <link>https://dev.to/lindseybradford/es-lint-prettier-vetur-vscode-ironing-out-the-conflicts-12j6</link>
      <guid>https://dev.to/lindseybradford/es-lint-prettier-vetur-vscode-ironing-out-the-conflicts-12j6</guid>
      <description>&lt;p&gt;I recently discovered something more was needed than the out of the box Vue CLI ESLint setup to settle the disputes between prettier, eslint, VSCode's default formatter, and which one fired when on-save vs. on keyboard shortcuts.&lt;/p&gt;

&lt;p&gt;This is a quick summary of my workspace configs, but for more of a deep dive, check out &lt;a href="https://medium.com/@gogl.alex/how-to-properly-set-up-eslint-with-prettier-for-vue-or-nuxt-in-vscode-e42532099a9c" rel="noopener noreferrer"&gt;this article&lt;/a&gt;.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Packages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;prettier&lt;/li&gt;
&lt;li&gt;eslint-config-prettier&lt;/li&gt;
&lt;li&gt;eslint-plugin-prettier&lt;/li&gt;
&lt;li&gt;
&lt;a class="mentioned-user" href="https://dev.to/vue"&gt;@vue&lt;/a&gt;/eslint-config-standard&lt;/li&gt;
&lt;li&gt;babel-eslint&lt;/li&gt;
&lt;li&gt;eslint&lt;/li&gt;
&lt;li&gt;eslint-plugin-import&lt;/li&gt;
&lt;li&gt;eslint-plugin-node&lt;/li&gt;
&lt;li&gt;eslint-plugin-promise&lt;/li&gt;
&lt;li&gt;eslint-plugin-standard&lt;/li&gt;
&lt;li&gt;eslint-plugin-vue&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Keybindings
&lt;/h3&gt;

&lt;p&gt;Remove any existing formatting commands attached to the &lt;code&gt;ctrl+shift+i&lt;/code&gt; shortcut and bind this instead to &lt;em&gt;EsLint Fix All Auto-Fixable Problems&lt;/em&gt; (tip: you can search by both command and keybinding in Keyboard Shortcuts).&lt;/p&gt;

&lt;h3&gt;
  
  
  Workspace Settings.json
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "vetur.validation.template": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  .eslintrc.js
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: [
    'plugin:vue/recommended',
    'eslint:recommended',
    'prettier/vue',
    'plugin:prettier/recommended'
  ],
  parserOptions: {
    parser: 'babel-eslint'
  },
  plugins: ['prettier'],
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'vue/component-name-in-template-casing': ['error', 'PascalCase']
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  .prettierrc
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "trailingComma": "none",
  "tabWidth": 2,
  "semi": false,
  "singleQuote": true
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'll continue to dial these settings in, and plan to expound more here on exactly why these configs work, but this got me up and running past those pesky formatting/linting conflicts in a pinch.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;More Reading&lt;/em&gt;&lt;br&gt;
&lt;a href="https://prettier.io/docs/en/integrating-with-linters.html" rel="noopener noreferrer"&gt;https://prettier.io/docs/en/integrating-with-linters.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/vuejs/vetur/issues/1094" rel="noopener noreferrer"&gt;https://github.com/vuejs/vetur/issues/1094&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
