<?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: Ricardo Sanchez</title>
    <description>The latest articles on DEV Community by Ricardo Sanchez (@nardove).</description>
    <link>https://dev.to/nardove</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%2F427577%2Fb9928aed-99ab-434f-a645-508c584737e5.jpeg</url>
      <title>DEV Community: Ricardo Sanchez</title>
      <link>https://dev.to/nardove</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nardove"/>
    <language>en</language>
    <item>
      <title>VSCode Project Based Persistent File Associations</title>
      <dc:creator>Ricardo Sanchez</dc:creator>
      <pubDate>Thu, 29 Apr 2021 21:03:00 +0000</pubDate>
      <link>https://dev.to/nardove/vscode-project-based-persistent-file-associations-20ie</link>
      <guid>https://dev.to/nardove/vscode-project-based-persistent-file-associations-20ie</guid>
      <description>&lt;p&gt;Personally, it use to be the case that while working on a JavaScript document, on a React project in VSCode, I get all the goodies from intellisense and emmet for JSX code, today that was not the case. So I decided to change the &lt;strong&gt;Language Mode&lt;/strong&gt; from standard &lt;strong&gt;Javascript&lt;/strong&gt; to &lt;strong&gt;&lt;em&gt;Javascript React&lt;/em&gt;&lt;/strong&gt;, and everything worked as expected.&lt;/p&gt;

&lt;p&gt;Until I closed the file, VSCode change the file association back to standard &lt;strong&gt;JavaScript&lt;/strong&gt; after I reopen it, fair enough.&lt;/p&gt;

&lt;p&gt;But that meant that every time I close and open any JS document again I had to change the &lt;strong&gt;Language Mode&lt;/strong&gt; back to &lt;strong&gt;JavaScript React&lt;/strong&gt;, every single time. Not good.&lt;/p&gt;

&lt;p&gt;Well there is a way to &lt;strong&gt;make all JS documents&lt;/strong&gt; inside your project a &lt;strong&gt;JavaScript React&lt;/strong&gt; document, no need to change the &lt;strong&gt;Language Mode&lt;/strong&gt; ever again. My intent is not to make this the default VSCode global behaviour I just want this to happen for my React projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do we instruct VSCode to have a predefined Language Mode for our particular projects?
&lt;/h2&gt;

&lt;p&gt;Well the answer is by adding a setting in your workspace file.&lt;/p&gt;

&lt;p&gt;If you already have a &lt;code&gt;.code-workspace&lt;/code&gt; document in your project, simply add the following to your settings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"settings"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"files.associations"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"*.js"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"javascriptreact"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you &lt;strong&gt;do not have a workspace&lt;/strong&gt; setup in your project folder, the process is simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;File -&amp;gt; Save Workspace As ...&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Name the file and save it in the root folder of your project&lt;/li&gt;
&lt;li&gt;Add the code snippet above&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now all your JS files will be treated as JavaScript React files&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57kipjwccvki33fmx32h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57kipjwccvki33fmx32h.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy days!&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>file</category>
      <category>association</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Need help setting up a basic CSS &amp; JS build using NPM scripts</title>
      <dc:creator>Ricardo Sanchez</dc:creator>
      <pubDate>Thu, 03 Sep 2020 18:00:34 +0000</pubDate>
      <link>https://dev.to/nardove/need-help-setting-up-a-basic-css-js-build-using-npm-2691</link>
      <guid>https://dev.to/nardove/need-help-setting-up-a-basic-css-js-build-using-npm-2691</guid>
      <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I need your help, I want to setup a very basic npm set of scripts to compile and minify Sass and JS ES6+ for personal projects.&lt;/p&gt;

&lt;p&gt;So far my Google search only gives me old posts and convoluted builds that, at least for me, are hard to follow and refactor for my basic needs. For example most of the posts or video tutorials use uglify which is deprecated and don't work with modules, so I'm using Terser instead.&lt;/p&gt;

&lt;p&gt;This is what I have so far:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"devserver"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"live-server --open=/dist/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"sass"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"node-sass scss/ -o dist/css/ -w"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"terser"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"terser js/index.js -c -m -o dist/js/index.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"watch:sass"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"onchange scss/*.scss -- npm run sass"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"watch:js"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"onchange js/*.js -- npm run terser"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npm-run-all --parallel devserver watch:*"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"devDependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"node-sass"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^4.14.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"npm-run-all"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^4.1.5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"terser"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^5.1.0"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Any help, pointers and suggestions will be much appreciated.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to change html &amp;ldquo; entity colour in VSCode?</title>
      <dc:creator>Ricardo Sanchez</dc:creator>
      <pubDate>Thu, 06 Aug 2020 21:05:02 +0000</pubDate>
      <link>https://dev.to/nardove/how-to-change-html-ldquo-entity-colour-in-vscode-1l70</link>
      <guid>https://dev.to/nardove/how-to-change-html-ldquo-entity-colour-in-vscode-1l70</guid>
      <description>&lt;p&gt;The cover image shows how the Github colour-theme tint the html quotes entities like &amp;amp;ldquo and &amp;amp;amp and so on, but my favourite colour-theme Nostromo shown in the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vbAf_bDI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tewvxd9subn9mbry39it.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vbAf_bDI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tewvxd9subn9mbry39it.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Does not apply any colour to those entities, I have looked at the entire colour-theme .json file to no avail. I would like to know what settings I need to change to apply those changes to my custom "workbench.colorCustomizations" settings. Hope that makes sense.&lt;/p&gt;

&lt;p&gt;Any help will be much appreciated!&lt;/p&gt;

&lt;p&gt;// END OF LINE&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>color</category>
      <category>theme</category>
      <category>custom</category>
    </item>
  </channel>
</rss>
