<?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: Pavel Susicky</title>
    <description>The latest articles on DEV Community by Pavel Susicky (@susickypavel).</description>
    <link>https://dev.to/susickypavel</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%2F77394%2F8d32ec76-6dc5-46c1-b215-f343a41013d0.jpeg</url>
      <title>DEV Community: Pavel Susicky</title>
      <link>https://dev.to/susickypavel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/susickypavel"/>
    <language>en</language>
    <item>
      <title>How to make scrollbar with changing gradient on scroll using 10 lines of CSS 🚀</title>
      <dc:creator>Pavel Susicky</dc:creator>
      <pubDate>Sat, 04 Jan 2020 11:05:35 +0000</pubDate>
      <link>https://dev.to/susickypavel/how-to-make-scrollbar-with-changing-gradient-on-scroll-using-10-lines-of-css-42o2</link>
      <guid>https://dev.to/susickypavel/how-to-make-scrollbar-with-changing-gradient-on-scroll-using-10-lines-of-css-42o2</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;You may know we can use a set of CSS pseudo-elements to customize scrollbar on our website, but did you know we can use a special trick to make a gradient scrollbar that changes on scroll only with CSS?&lt;/p&gt;

&lt;p&gt;Our final result should look like codepen below. The CSS behind it isn't complicated and it consists only of &lt;strong&gt;10&lt;/strong&gt; (+ 2 empty) lines of code. If you want to discover the magic on your own, see the codepen. Otherwise, keep reading to see what trick did we do to make this work. 😎&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; if you see the default scrollbar make sure, you are using a browser which supports scrollbar pseudo-elements (any Webkit based browser is fine)&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/thesoreon/embed/mdyqQgO?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;We will make use of these pseudo-elements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;::-webkit-scrollbar&lt;/li&gt;
&lt;li&gt;::-webkit-scrollbar-track&lt;/li&gt;
&lt;li&gt;::-webkit-scrollbar-thumb&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, there are a few more available if you want to see a full list of scrollbar's pseudo-elements visit &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/::-webkit-scrollbar" rel="noopener noreferrer"&gt;MDN&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The code
&lt;/h2&gt;

&lt;p&gt;Let's start with the first pseudo-element &lt;code&gt;::-webkit-scrollbar&lt;/code&gt; to set a width of our scroll. So in CSS, it looks like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="nd"&gt;::-webkit-scrollbar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


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

&lt;/div&gt;
&lt;p&gt;Next, we're gonna add our desired gradient (you can create one with this handy tool &lt;a href="https://cssgradient.io/" rel="noopener noreferrer"&gt;https://cssgradient.io/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Do you have your gradient ready? So add it to &lt;code&gt;::-webkit-scrollbar-track&lt;/code&gt; pseudo-element as background property. This will make our scrollbar to be covered by the gradient.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="nd"&gt;::-webkit-scrollbar-track&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;linear-gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0deg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="m"&gt;0%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;211&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


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

&lt;/div&gt;
&lt;h2&gt;
  
  
  The trick
&lt;/h2&gt;

&lt;p&gt;Now the most important step, we're gonna customize the scroll handle (called thumb pseudo-element). Firstly, try to add a solid background colour to the thumb.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="nd"&gt;::-webkit-scrollbar-thumb&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;lime&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


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

&lt;/div&gt;
&lt;p&gt;You will see the typical scrollbar handle with green colour. Perfect. Now let's make it transparent. So use &lt;code&gt;background: transparent;&lt;/code&gt; or &lt;code&gt;opacity: 0;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We are not able to see it now, but we know that it is there and we can see the gradient through it, nice! So all we need to do is to render all external space with solid colour. How do we do that?&lt;/p&gt;

&lt;p&gt;With the use of a &lt;code&gt;box-shadow&lt;/code&gt; property! Let's refresh what does box-shadow property consists of:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="nc"&gt;.box&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt; &lt;span class="err"&gt;???&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


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

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;0px:&lt;/strong&gt; horitontal (x-axis) offset&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;0px:&lt;/strong&gt; vertical (y-axis) offset&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;4px:&lt;/strong&gt; blur&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;???:&lt;/strong&gt; the secret property we will make use of&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;black:&lt;/strong&gt; color of the box-shadow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fourth hidden property is called &lt;strong&gt;spread&lt;/strong&gt; and it increases/decreases the size of the box-shadow and that's perfect! If we set it to an enormous value with zero blur, it will cover all space around the scrollbar handle. That's exactly what we want! Let's try it in the code!&lt;/p&gt;

&lt;p&gt;Make sure you gave it a big value, so it covers the whole scrollbar.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="nd"&gt;::-webkit-scrollbar-thumb&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;100000vh&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


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

&lt;/div&gt;
&lt;p&gt;And we are finished, and we can see how our scrollbar gradient is changing on scroll. The whole principle works on the idea of seeing through the handle the gradient background of the scrollbar. And cover all outside space with a solid colour, so cool 😎&lt;/p&gt;

&lt;p&gt;Composed together the code looks like this:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="nd"&gt;::-webkit-scrollbar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nd"&gt;::-webkit-scrollbar-track&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;linear-gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0deg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="m"&gt;0%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;211&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nd"&gt;::-webkit-scrollbar-thumb&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;100000vh&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


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

&lt;/div&gt;
&lt;h2&gt;
  
  
  BIG Credits 👏
&lt;/h2&gt;

&lt;p&gt;I didn't come up with this neat trick using box-shadow, all the credits should go to &lt;strong&gt;James Warner&lt;/strong&gt;, who is an amazing web developer streaming on &lt;a href="https://www.twitch.tv/jmswrnr" rel="noopener noreferrer"&gt;Twitch&lt;/a&gt;.&lt;/p&gt;


&lt;div class="ltag__user ltag__user__id__299210"&gt;
    &lt;a href="/jmswrnr" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&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%2Fuser%2Fprofile_image%2F299210%2Ff56956f4-58ca-49d9-a544-06c1b064b468.png" alt="jmswrnr image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/jmswrnr"&gt;JAMES WARNER&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/jmswrnr"&gt;&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Surely go check him out! He is currently developing an astonishing personal website using WebGL, React, Next.js and Sanity.io! Just see a snippet of his progress below:&lt;/p&gt;

&lt;p&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%2Flk4kfiwlcpq18t17jspq.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%2Flk4kfiwlcpq18t17jspq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The screenshot itself looks cool, but see it in action &lt;a href="https://i.imgur.com/Tb9k11R.mp4" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>scrollbar</category>
      <category>gradient</category>
    </item>
    <item>
      <title>Technology stack for your blog in 2019</title>
      <dc:creator>Pavel Susicky</dc:creator>
      <pubDate>Sat, 07 Dec 2019 15:33:05 +0000</pubDate>
      <link>https://dev.to/susickypavel/technology-stack-for-your-blog-in-2019-okl</link>
      <guid>https://dev.to/susickypavel/technology-stack-for-your-blog-in-2019-okl</guid>
      <description>&lt;p&gt;Personal blog is one of the most popular projects for every developer. It can be done in various ways from plain HTML, CSS and Javascript files to a big codebase with all the best practises you can imagine. &lt;/p&gt;

&lt;p&gt;I want to share with you the stack I've used to create my blog, so let's get right into it! 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick note:&lt;/strong&gt; this blog is created as JAMStack solution, so we don't need any kind of server to handle our blog posts creation and so on. So it is possible to host it on any static website hosting such as Netlify, Github pages and more!&lt;/p&gt;

&lt;h2&gt;
  
  
  React
&lt;/h2&gt;

&lt;p&gt;I guess many of you already know React. It is a Javascript library for creating user interfaces. Application is build using components, which can be composed together and reuse across the project, which makes it very powerful.&lt;/p&gt;

&lt;p&gt;It's a core of our application because other libraries listed below depend on React itself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Available&lt;/strong&gt; on &lt;a href="https://www.npmjs.com/package/react" rel="noopener noreferrer"&gt;npm&lt;/a&gt; registry&lt;br&gt;
&lt;strong&gt;Official docs:&lt;/strong&gt; &lt;a href="https://reactjs.org/docs/getting-started.html" rel="noopener noreferrer"&gt;https://reactjs.org/docs/getting-started&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Gatsby
&lt;/h2&gt;

&lt;p&gt;Gatsby is a Javascript framework (for React.js apps) which helps you to set up your application. It handles most of the boilerplate code you would otherwise handle by yourself (webpack config, "server-side" rendering, GraphQL, and so on..). Apps built with gatsby are really (really) fast. &lt;/p&gt;

&lt;p&gt;You can use Gatsby plugins in your application, which enhance your app by features, or you can create a custom plugin for others.&lt;/p&gt;

&lt;p&gt;By the way, Gatsby has one of the most "bulletproof" documentation you will find on the internet. If you stumble across some error, try to search the gatsby docs, there is a big chance that it is already covered there.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Available&lt;/strong&gt; on &lt;a href="https://www.npmjs.com/package/gatsby" rel="noopener noreferrer"&gt;npm&lt;/a&gt; registry&lt;br&gt;
&lt;strong&gt;Official docs:&lt;/strong&gt; &lt;a href="https://www.gatsbyjs.org/docs/" rel="noopener noreferrer"&gt;https://www.gatsbyjs.org/docs/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Typescript
&lt;/h2&gt;

&lt;p&gt;Known as superset of Javascript. It adds static type-checking on top of Javascript and provides clever IntelliSense in your favourite Text editor/IDE.&lt;/p&gt;

&lt;p&gt;Typescript is still evolving, and every new version brings new features, which saves hours and hours of developer's valuable time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Available&lt;/strong&gt; on &lt;a href="https://www.npmjs.com/package/typescript" rel="noopener noreferrer"&gt;npm&lt;/a&gt; registry&lt;br&gt;
&lt;strong&gt;Official docs:&lt;/strong&gt; &lt;a href="https://www.typescriptlang.org/docs/home.html" rel="noopener noreferrer"&gt;https://www.typescriptlang.org/docs/home&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Emotion
&lt;/h2&gt;

&lt;p&gt;Emotion is a CSS-in-JS library. It has been gaining popularity lately and there are many aspects why! It has built-in scoping for your styles. Working server-side rendering out of the box, or with a little and easy configuration. State-based styling and many more features!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Available&lt;/strong&gt; on npm registry:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/@emotion/core" rel="noopener noreferrer"&gt;@emotion/core&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/@emotion/styled" rel="noopener noreferrer"&gt;@emotion/styled&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Official docs:&lt;/strong&gt; &lt;a href="https://emotion.sh/docs/introduction" rel="noopener noreferrer"&gt;https://emotion.sh/docs/introduction&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Eslint
&lt;/h2&gt;

&lt;p&gt;ESLint is a tool for identifying and reporting on patterns found in JavaScript (also Typescript) code. It should be a must-have tool in your tech stack because it will force you to use best-practises across the project and if your blog is open-sourced you should definitely be thinking about adding it!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Available&lt;/strong&gt; on &lt;a href="https://www.npmjs.com/package/eslint" rel="noopener noreferrer"&gt;npm&lt;/a&gt; registry&lt;br&gt;
&lt;strong&gt;Official docs:&lt;/strong&gt; &lt;a href="https://eslint.org/docs/user-guide/getting-started" rel="noopener noreferrer"&gt;https://eslint.org/docs/user-guide/getting-started&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prettier
&lt;/h2&gt;

&lt;p&gt;Prettier is an opinionated code formatter, which supports most popular languages. It keeps consistency in your code formatting, which can be very valuable and also time-saving because you don't need to format code manually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Available&lt;/strong&gt; on &lt;a href="https://www.npmjs.com/package/prettier" rel="noopener noreferrer"&gt;npm&lt;/a&gt; registry&lt;br&gt;
&lt;strong&gt;Official docs:&lt;/strong&gt; &lt;a href="https://prettier.io/docs/en/index.html" rel="noopener noreferrer"&gt;https://prettier.io/docs&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Jest
&lt;/h2&gt;

&lt;p&gt;Is a very popular testing library. It integrates very well with react.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Available&lt;/strong&gt; on &lt;a href="https://www.npmjs.com/package/jest" rel="noopener noreferrer"&gt;npm&lt;/a&gt; registry&lt;br&gt;
&lt;strong&gt;Official docs:&lt;/strong&gt; &lt;a href="https://jestjs.io/docs/en/getting-started" rel="noopener noreferrer"&gt;https://jestjs.io/docs/en/getting-started&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  React Testing Library
&lt;/h2&gt;

&lt;p&gt;For testing react components you usually go for &lt;code&gt;enzyme&lt;/code&gt;, but you should be thinking about going for testing library because it makes your tests to be less dependent on the component's internal state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; if you switch from enzyme to testing library you will need to change (a little) your thinking about writing tests because it is different from enzyme.&lt;/p&gt;

&lt;p&gt;You should definitely take a look at &lt;a href="https://kentcdodds.com/blog" rel="noopener noreferrer"&gt;blog&lt;/a&gt; by Kent C. Dodds (author of testing library) if you want some in-depth knowledge about testing library!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Available&lt;/strong&gt; on &lt;a href="https://www.npmjs.com/package/@testing-library/react" rel="noopener noreferrer"&gt;npm&lt;/a&gt; registry&lt;br&gt;
&lt;strong&gt;Official docs:&lt;/strong&gt; &lt;a href="https://testing-library.com/docs/react-testing-library/intro" rel="noopener noreferrer"&gt;https://testing-library.com/docs/react-testing-library/intro&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Cypress
&lt;/h2&gt;

&lt;p&gt;Is an end to end testing framework, which enables you to write all kinds of tests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unit tests&lt;/li&gt;
&lt;li&gt;Integration tests&lt;/li&gt;
&lt;li&gt;e2e tests&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's a very nicely done framework with amazing documentation (with text and video versions!) and it's very easy to set up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Available&lt;/strong&gt; on &lt;a href="https://www.npmjs.com/package/cypress" rel="noopener noreferrer"&gt;npm&lt;/a&gt; registry&lt;br&gt;
&lt;strong&gt;Official docs:&lt;/strong&gt; &lt;a href="https://docs.cypress.io/" rel="noopener noreferrer"&gt;https://docs.cypress.io/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Share your tech stack
&lt;/h3&gt;

&lt;p&gt;What is your tech stack for this year? What technologies do you use in combination with Vue or Angular? Tell us in comments! 🧐&lt;/p&gt;

&lt;p&gt;This post is published on my blog, see it &lt;strong&gt;&lt;a href="https://thesoreon.com/blog/technology-stack-for-your-blog-in-2019" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/strong&gt;!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>blog</category>
    </item>
    <item>
      <title>Top 5 amazing tools for every web developer</title>
      <dc:creator>Pavel Susicky</dc:creator>
      <pubDate>Sat, 23 Nov 2019 15:03:37 +0000</pubDate>
      <link>https://dev.to/susickypavel/top-5-amazing-tools-for-every-web-developer-2mdn</link>
      <guid>https://dev.to/susickypavel/top-5-amazing-tools-for-every-web-developer-2mdn</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;We all want to be as effective as possible that's why we are developing things which boost our (and others) productivity, but we are also using tools from other developers, who made these tools with the same reason.&lt;/p&gt;

&lt;p&gt;So I want to introduce you to my top 5 tools (for web developers) I'm using on an everyday basis. The list is not sorted in any way, all of these tools are very amazing and make our life easier.&lt;/p&gt;

&lt;p&gt;You can leave a comment down below with your curated list of favourite tools for web developers!&lt;/p&gt;

&lt;p&gt;So let's get started 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  Lighthouse
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Lighthouse&lt;/strong&gt; is an amazing (open source) tool made by Google. It reports important aspects of our web pages, such as Seo, Performance, Accessibility, Best practises and more!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1x6mbhrf1dlj634pnzqg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1x6mbhrf1dlj634pnzqg.png" alt="Lighthouse preview" width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Amazing feature of Lighthouse is that it can be used in many ways, the most popular one is using official &lt;a href="https://chrome.google.com/webstore/detail/lighthouse/blipmdconlkpinefehnmjammfjpmpbjk" rel="noopener noreferrer"&gt;Google Chrome Extension&lt;/a&gt;, but you aren't bound to using only Chrome extension, other ways are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/lighthouse" rel="noopener noreferrer"&gt;Node CLI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/speed/pagespeed/insights/" rel="noopener noreferrer"&gt;Web UI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note that with Web UI you don't have to install anything, however, you are limited by the available options. When using the extension you can "emulate" CPU throttling and internet speed, so you can see how is your website doing on low-end hardware devices, isn't that awesome? &lt;/p&gt;

&lt;h2&gt;
  
  
  Chrome and Firefox devtools
&lt;/h2&gt;

&lt;p&gt;Personally, I don't use Firefox devtools that much, but I would say using both of them in parallel is great because each of them has amazing features the other one doesn't have. For example, Firefox has an amazing accessibility tool!&lt;/p&gt;

&lt;h3&gt;
  
  
  My Chrome devtools tip
&lt;/h3&gt;

&lt;p&gt;If you hit &lt;code&gt;Ctrl+Shift+P&lt;/code&gt; (while devtools are opened), you will be prompted with a search bar, where you can type command you want to execute. So for example, if you want to quickly disable Javascript without going to Chrome settings or searching the checkbox in devtools, you can type it!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7phoiq0edty6ptpta506.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7phoiq0edty6ptpta506.png" alt="How to disable Javascript using devtools quickly" width="800" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Can I use
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://caniuse.com/" rel="noopener noreferrer"&gt;caniuse&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I Use&lt;/strong&gt; is probably the most known website for all developers. It lets you quickly find how well is Javascript API or CSS property supported in most popular web browsers.&lt;/p&gt;

&lt;p&gt;Below we can see the default view of searched Javascript API. It shows us in which versions of browsers is the API available, but there two more very interesting views, let's try them!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzrsx8qaf6doj04p4q0o4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzrsx8qaf6doj04p4q0o4.png" alt="caniuse default view" width="800" height="181"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another view is &lt;code&gt;Usage relative&lt;/code&gt;, very handy view if you have gathered data about which browsers your audience uses and if you need to polyfill (or change) certain features in your app to work correctly for your audience.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2szddaihsv5wik4j6zz2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2szddaihsv5wik4j6zz2.PNG" alt="caniuse usage relative view" width="800" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last view is &lt;code&gt;Date relative&lt;/code&gt;, where you can clearly see in which version of the browser was a certain feature added.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd2jpi68x6xogovsvi0h5.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd2jpi68x6xogovsvi0h5.PNG" alt="caniuse date relative view" width="800" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Web Accessibility Evaluation Tool (WAVE)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://wave.webaim.org/extension/" rel="noopener noreferrer"&gt;WAVE&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WAVE&lt;/strong&gt; is an extension for Chrome and Firefox. When you click it in your extension list bar, it will wrap your current visited site with its UI interface, where you can see accessibility summary of the page. It shows things like Contrast errors,  accessibility errors, but also it shows features your site provides to improve accessibility.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgv6goq3syx1j8xojdu4y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgv6goq3syx1j8xojdu4y.png" alt="WAVE preview" width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Figma
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.figma.com/" rel="noopener noreferrer"&gt;Figma&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Figma&lt;/strong&gt; is one of the most amazing tools I have seen lately. It is a UI design and prototyping tool. Similar to tools like Adobe XD and Sketch, but Figma is web-based (but you can, of course, download desktop app), which is very powerful. It has many pros such as very good performance, real-time collaboration with your team members and FREE pricing plan, which offers all features of Figma (with unlimited export and much more) and if you are a student you can get Professional plan for &lt;strong&gt;free&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn65p6gnvqvwthrg5r2uk.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn65p6gnvqvwthrg5r2uk.PNG" alt="Figma preview" width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If I haven't convinced you to try Figma, try to read more information on official Figma site &lt;a href="https://www.figma.com/pricing" rel="noopener noreferrer"&gt;here&lt;/a&gt;. I believe you'll fall in love with it!&lt;/p&gt;

&lt;p&gt;This post was published on my blog, you can check it out &lt;a href="https://thesoreon.com/blog/top-5-amazing-tools-for-every-web-developer" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>devtools</category>
    </item>
    <item>
      <title>How to set up Eslint with Typescript in VSCode</title>
      <dc:creator>Pavel Susicky</dc:creator>
      <pubDate>Sat, 16 Nov 2019 17:35:36 +0000</pubDate>
      <link>https://dev.to/susickypavel/how-to-set-up-eslint-with-typescript-in-vs-code-2867</link>
      <guid>https://dev.to/susickypavel/how-to-set-up-eslint-with-typescript-in-vs-code-2867</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;If you have ever been part of a development team, you probably know that every single one of us has a different code formatting, semantics standards (and that's totally fine 😅). However, when you are all developing on one thing, it's very handy to follow one strict pattern so the codebase isn't a mixture of everything.&lt;/p&gt;

&lt;p&gt;However, it would be pretty hard and inefficient for all developers to get used to one pattern (because we have side-projects where we use different style-guide and so on).&lt;/p&gt;

&lt;h2&gt;
  
  
  Eslint to the rescue!
&lt;/h2&gt;

&lt;p&gt;Eslint is a tool, which forces the developer to format their code according to selected rules.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;E.g. rule: don't use semicolons in your code.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// The semicolon below would be underlined and showing error on hover&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I shouldn't be using semicolons there&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So this way, all developers would have errors in their IDE/Text editor if they had semicolons in their code, &lt;strong&gt;but&lt;/strong&gt; for some reason, they might ignore that errors/warnings and still commit changes. Fortunately, eslint can handle even that and automatically fix the errors on file save! &lt;/p&gt;

&lt;p&gt;Unfortunately, developers might not have prepared their IDE/Text editor to work with eslint and wouldn't see those errors, but we can still create an eslint script which will run on our CI. That way we can ensure only correctly formatted code will be merged. 🙌&lt;/p&gt;

&lt;h2&gt;
  
  
  Why typescript?
&lt;/h2&gt;

&lt;p&gt;You probably heard of typescript, it's basically javascript with types (but there is much more in it!). It adds another layer of certainty to your code. However, it is a little bit tricky to make it work with eslint so let's dive into it!&lt;/p&gt;

&lt;h2&gt;
  
  
  Visual Studio Code setup
&lt;/h2&gt;

&lt;p&gt;First of all, we need to "teach" our editor to understand eslint 😄&lt;br&gt;
So we'll install &lt;a href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint" rel="noopener noreferrer"&gt;this&lt;/a&gt; extension.&lt;/p&gt;

&lt;p&gt;After installation, we need to explicitly tell eslint extension to watch typescript files for linting errors (&lt;em&gt;by default it lints only javascript and JSX files&lt;/em&gt;). Follow these instructions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inside VS Code use: &lt;code&gt;Ctrl+Shift+P&lt;/code&gt; or &lt;code&gt;Shift+Cmd+P&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Type: &lt;code&gt;Preferences: Open Settings (JSON)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Select the option&lt;/li&gt;
&lt;li&gt;Paste this code inside the opened JSON file
&lt;/li&gt;
&lt;/ul&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="nl"&gt;"eslint.validate"&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="s2"&gt;"typescript"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"typescriptreact"&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;Note that if you hit &lt;code&gt;Ctrl+Shift+P&lt;/code&gt; or &lt;code&gt;Shift+Cmd+P&lt;/code&gt; in VS Code and type eslint it will show you all commands available for this extensions! However, the commands won't work because we haven't installed eslint dependency, let's do it now!&lt;/p&gt;
&lt;h2&gt;
  
  
  Install eslint to your project or globally on your machine
&lt;/h2&gt;

&lt;p&gt;We have two options now:&lt;/p&gt;

&lt;p&gt;1) We will install eslint dependency globally (means it will be available for all projects on your machine, cool!)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# using npm&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; eslint
&lt;span class="c"&gt;# using yarn&lt;/span&gt;
yarn global add eslint
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2) We will install dependencies per-project, which can be useful to explicitly tell a developer to use these.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Go to the root of the project (where package.json lives)&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;my-project
&lt;span class="c"&gt;# using npm&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; eslint
&lt;span class="c"&gt;# using yarn&lt;/span&gt;
yarn add &lt;span class="nt"&gt;-D&lt;/span&gt; eslint
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;It's your choice which one of these you want to use&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Teach Eslint to work with Typescript
&lt;/h2&gt;

&lt;p&gt;Eslint by default doesn't understand Typescript syntax. That's why you might hear of &lt;code&gt;tslint&lt;/code&gt;, which is (was) used instead of eslint for Typescript project, but the backers of this package announced earlier this year deprecation of &lt;code&gt;tslint&lt;/code&gt; in favour of &lt;code&gt;typescript-eslint&lt;/code&gt; project (which is monorepo, so we are gonna install few packages from it).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# using npm&lt;/span&gt;
npm i &lt;span class="nt"&gt;-D&lt;/span&gt; typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin
&lt;span class="c"&gt;# using yarn&lt;/span&gt;
yarn add &lt;span class="nt"&gt;-D&lt;/span&gt; typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We'll make configuration file for eslint. It can be of three different types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Javascript file&lt;/li&gt;
&lt;li&gt;JSON file - &lt;em&gt;&lt;strong&gt;we'll take this one&lt;/strong&gt;&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;YAML file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;eslintConfig&lt;/code&gt; field in &lt;code&gt;package.json&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create &lt;code&gt;.eslintrc&lt;/code&gt; file in the root of your project and paste this code inside:&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="nl"&gt;"parser"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@typescript-eslint/parser"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"plugins"&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="s2"&gt;"@typescript-eslint"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"rules"&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;"semi"&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="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"never"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"quotes"&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"single"&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;We are adding the &lt;code&gt;@typescript-eslint/parser&lt;/code&gt; (which will parse typescript files, so eslint understands them correctly). Then under &lt;code&gt;plugins&lt;/code&gt;, we add &lt;code&gt;@typescript-eslint&lt;/code&gt; plugin which gives us the possibility to add rules specific to typescript code. Under &lt;code&gt;rules&lt;/code&gt; we added some sample rules (no semicolons allowed, and use single quotes instead of double)&lt;/p&gt;

&lt;p&gt;With this, if you create anywhere file with &lt;code&gt;.ts or .tsx&lt;/code&gt; extension and write code like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This shows errors&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the string being underlined and the semicolon too. Showing you what rules this code violates.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding automatic lint errors fixing!
&lt;/h2&gt;

&lt;p&gt;Cool, now editor shows error when we type something that violates our eslint rules and we can manually fix them, but that's time-consuming, we can do better with automatic fixing!&lt;/p&gt;

&lt;p&gt;All we need to do is to tell our VS Code eslint extension to run &lt;code&gt;eslint --fix&lt;/code&gt; command on file save.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inside VS Code use: &lt;code&gt;Ctrl+Shift+P&lt;/code&gt; or &lt;code&gt;Shift+Cmd+P&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Type: &lt;code&gt;Preferences: Open Settings (JSON)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Select the option&lt;/li&gt;
&lt;li&gt;Update eslint-related code inside the opened JSON file
&lt;/li&gt;
&lt;/ul&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="nl"&gt;"eslint.validate"&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="nl"&gt;"language"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"typescript"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"autoFix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&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="nl"&gt;"language"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"typescriptreact"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"autoFix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&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="nl"&gt;"eslint.autoFixOnSave"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&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;Now whenever you save typescript file with eslint errors, it will be automatically fixed. Awesome!&lt;/p&gt;

&lt;h2&gt;
  
  
  Executing eslint on command line!
&lt;/h2&gt;

&lt;p&gt;We are almost finished, the last piece of work we need to do is to set up a script that will run eslint check.&lt;/p&gt;

&lt;p&gt;The script might be executed on your CI to ensure that pushed code is correctly formatted.&lt;/p&gt;

&lt;p&gt;To check code on your command line is very easy with eslint, look at this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Scans from the root of the project&lt;/span&gt;
eslint &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="c"&gt;# Scans only src directory of the project&lt;/span&gt;
eslint src/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, there is a little &lt;strong&gt;gotcha&lt;/strong&gt; in these commands. Do you know why? 🤔&lt;/p&gt;

&lt;p&gt;It scans only javascript files by default, so typescript files will be ignored. So if you didn't have any javascript file in your project and only typescript files, you would see something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Oops! Something went wrong! :(

ESLint: 6.6.0.

No files matching the pattern "." were found.
Please check for typing mistakes in the pattern.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So to lint typescript file we need to add an argument &lt;strong&gt;--ext &amp;lt;comma-seperated-list-of-file-extensions-to-watch&lt;/strong&gt;. So with this in mind, the command would look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Scans from the root of the project&lt;/span&gt;
eslint &lt;span class="nt"&gt;--ext&lt;/span&gt; ts,tsx &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="c"&gt;# Scans only src directory of the project&lt;/span&gt;
eslint &lt;span class="nt"&gt;--ext&lt;/span&gt; ts,tsx src/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all, you have now configured eslint with typescript! 😎&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This post was published on my &lt;a href="https://thesoreon.com/blog/how-to-set-up-eslint-with-typescript-in-vs-code" rel="noopener noreferrer"&gt;blog&lt;/a&gt;, so you can check it out here!&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>typescript</category>
      <category>eslint</category>
      <category>vscode</category>
    </item>
    <item>
      <title>Do you use GUI for git on Linux? Which one?</title>
      <dc:creator>Pavel Susicky</dc:creator>
      <pubDate>Sun, 14 Jul 2019 20:01:40 +0000</pubDate>
      <link>https://dev.to/susickypavel/do-you-use-gui-for-git-on-linux-which-one-477c</link>
      <guid>https://dev.to/susickypavel/do-you-use-gui-for-git-on-linux-which-one-477c</guid>
      <description>&lt;p&gt;&lt;strong&gt;Hello everyone!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I want to ask you which GUI you are using on your machine with Linux or do you use CLI? &lt;/p&gt;

&lt;p&gt;I'm asking because i'm not sure which one to choose. I have been using Git Extensions on Windows and i fell in love with it, because it's completely free and has awesome features and decent UI. &lt;/p&gt;

&lt;p&gt;However support for Linux is quite poor and it's not working properly (or i just can't configure it properly) &lt;/p&gt;

&lt;p&gt;So what are your favorites? &lt;/p&gt;

&lt;p&gt;[UPDATE]:&lt;br&gt;
If anyone is running on Linux and has hard times finding a fitting git GUI, i can recommend &lt;a href="https://gitahead.github.io/gitahead.com/" rel="noopener noreferrer"&gt;gitahead&lt;/a&gt;, which is open sourced and has all things i needed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Graphical git history&lt;/li&gt;
&lt;li&gt;Simple straightforward UI&lt;/li&gt;
&lt;li&gt;Playing nice with custom OS themes&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>linux</category>
      <category>git</category>
      <category>gui</category>
    </item>
    <item>
      <title>React reconciliation</title>
      <dc:creator>Pavel Susicky</dc:creator>
      <pubDate>Tue, 13 Nov 2018 21:28:52 +0000</pubDate>
      <link>https://dev.to/susickypavel/react-reconciliation-2k3k</link>
      <guid>https://dev.to/susickypavel/react-reconciliation-2k3k</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;React is an amazing library, which is used for creating user interfaces. When it comes to performance of react apps first thing that occur in my mind is Virtual DOM or maybe better a &lt;b&gt;reconciliation&lt;/b&gt; process. This concept'll tell us how react updates the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction" rel="noopener noreferrer"&gt;DOM&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;b&gt;Reconciliation&lt;/b&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Reconciliation is the process through which React updates the DOM.&lt;/em&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As a developer we are creating tree of components, react then takes this tree, process it and we get a Virtual DOM that it's kept in memory. When there is an update in our application (e.g. change in state or props) react will take the updated Virtual DOM and compares it with the old one Virtual DOM, then decides what and how should be changed. This procedure is repeated all over again. &lt;/p&gt;

&lt;p&gt;Also synced versions between Virtual DOM and "real" DOM are served by libraries such as &lt;b&gt;ReactDOM&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;React needs to be very fast at comparing those trees, so it uses heuristic algorithm with complexity of O(n), so this says for 1000 nodes we need 1000 comparasions.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This approach is used instead of &lt;a href="https://grfia.dlsi.ua.es/ml/algorithms/references/editsurvey_bille.pdf" rel="noopener noreferrer"&gt;state of the art algorithms&lt;/a&gt;, which have complexity of O(n^3) =&amp;gt; for 1000 nodes we need 1 bilion comparasions.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  However there are two important assumptions for this method:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Two elements of different types will produce different trees.&lt;/em&gt; &lt;b&gt;(known as pair-wise diff)&lt;/b&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So with this rule, diffing from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello World!&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Welcome.&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello World!&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Welcome.&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Would destroy &lt;b&gt;div&lt;/b&gt; element with all its children inside and made a new &lt;b&gt;span&lt;/b&gt; with h1 and paragraph.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;The developer can hint at which child elements may be stable across different renders with a key prop.&lt;/em&gt; &lt;b&gt;(known as list-wise diff)&lt;/b&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We have all come to this part when using react. This can be seen very often while iterating over an array and we return some kind of JSX as a respond.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;renderFlags&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Private&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Property&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;flag&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;flag&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;flag&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key attribute is very important for react to indicate which of the children in a tree were changed and which stayed unchanged. However there is an important point.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;key attribute shouldn't be filled with index argument (or any inconsistent source), because it causes performance issues.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;renderFlags&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// First render.&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Private&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Property&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;flag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;flag&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="c1"&gt;// Second Render&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Public&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Private&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Property&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;flag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;flag&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="cm"&gt;/*
        First render returns:
        &amp;lt;p key={0}&amp;gt;Private&amp;lt;/p&amp;gt;
        &amp;lt;p key={1}&amp;gt;Property&amp;lt;/p&amp;gt;

        Second render returns:
        &amp;lt;p key={0}&amp;gt;Public&amp;lt;/p&amp;gt;
        &amp;lt;p key={1}&amp;gt;Private&amp;lt;/p&amp;gt; ! Key changed from 0 to 1
        &amp;lt;p key={2}&amp;gt;Property&amp;lt;/p&amp;gt; ! Key changed from 1 to 2
    */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So if we add an element in the beginning of an array it shifts the index for rest of the elements. So react will mutate all of these children.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I can't really explain this easily, but there is a nice explanation in official &lt;a href="https://reactjs.org/docs/reconciliation.html" rel="noopener noreferrer"&gt;docs&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;b&gt;React fiber&lt;/b&gt;
&lt;/h2&gt;

&lt;p&gt;With react 16 new reconciliation engine appeared. It improves performance of react apps and has many of wonderful features, but the concept is a little bit more complex, so if you want to learn about it on your own there is a nice &lt;a href="https://github.com/acdlite/react-fiber-architecture" rel="noopener noreferrer"&gt;post&lt;/a&gt; by Andrew Clark.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;p&gt;Another good sources to read:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/faq-internals.html" rel="noopener noreferrer"&gt;https://reactjs.org/docs/faq-internals.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/reconciliation.html" rel="noopener noreferrer"&gt;https://reactjs.org/docs/reconciliation.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hackernoon.com/virtual-dom-in-reactjs-43a3fdb1d130" rel="noopener noreferrer"&gt;https://hackernoon.com/virtual-dom-in-reactjs-43a3fdb1d130&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/how-react-reconciliation-works/" rel="noopener noreferrer"&gt;https://css-tricks.com/how-react-reconciliation-works/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Thinking out of the box</title>
      <dc:creator>Pavel Susicky</dc:creator>
      <pubDate>Tue, 06 Nov 2018 21:51:36 +0000</pubDate>
      <link>https://dev.to/susickypavel/thinking-out-of-the-box-1f56</link>
      <guid>https://dev.to/susickypavel/thinking-out-of-the-box-1f56</guid>
      <description>&lt;p&gt;We have all heard this sentence (or cliché?), but what does it mean?&lt;/p&gt;

&lt;p&gt;According to old good friend wikipedia, it means to start thinking &lt;b&gt;differently&lt;/b&gt; or &lt;b&gt;unconventionally&lt;/b&gt; about some sort of problem, puzzle or whatever else. Simplified we should see it from other perspective. &lt;/p&gt;

&lt;h2&gt;
  
  
  Example!
&lt;/h2&gt;

&lt;p&gt;I'll take a most common problem and i'm pretty sure you've already seen it.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;The problem:&lt;/b&gt; "&lt;em&gt;connect the dots by drawing &lt;b&gt;four straight&lt;/b&gt;, continuous lines that pass through each of the nine dots, and &lt;b&gt;never lifting the pencil from the paper.&lt;/b&gt;&lt;/em&gt;"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1bb70ceesa4q3nadysgr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1bb70ceesa4q3nadysgr.png" alt="ninedots" width="434" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Okay, i see no problem in this, let's do it!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkv9kyoqucza3ljxkxcti.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkv9kyoqucza3ljxkxcti.png" alt="ninedotsfilledwrong" width="434" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Oh, that's wrong? Yeah, they are connected, but with FIVE straight lines and i need four. &lt;/p&gt;

&lt;p&gt;Ok, so i'll try another way! However, i don't want you to scroll five years, so we know that there is no way how to solve it with this method or might be?&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution!
&lt;/h2&gt;

&lt;p&gt;So if we think about it out of box. We should end up with solution below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmm4haz2b3hvv6ug90b9f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmm4haz2b3hvv6ug90b9f.png" alt="ninedotsfilledcorrectly" width="547" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that's the solution. The interesting thing is that our brain automatically created an "imaginary square" that we cannot escape, but in the reality we &lt;b&gt;CAN&lt;/b&gt;, because there is no rule telling us to stay in some kind of square.  &lt;/p&gt;

&lt;p&gt;Btw can you find a solution(s) for this puzzle with same rules, but you can use only 3 straight lines?&lt;/p&gt;

&lt;h2&gt;
  
  
  Other interesting puzzles
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Tower_of_Hanoi" rel="noopener noreferrer"&gt;Towers of Hanoi&lt;/a&gt;&lt;br&gt;
Very well known &lt;a href="https://en.wikipedia.org/wiki/Rubik%27s_Cube" rel="noopener noreferrer"&gt;Rubik's Cube&lt;/a&gt;&lt;br&gt;
&lt;a href="http://www.giftourprecious.com/wp-content/uploads/2017/10/Trace-The-Image-Brain-Teaser-Thinking-Outside-The-Box-Exercises.jpg" rel="noopener noreferrer"&gt;Drawing&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In my opinion this thing is connected with learning of anything, where you have plenty of ways how to solve the specific problem. It's very important to see other's work for our best improvements, everyone has a different style of thinking so we can collaborate why someone used this method and the other one used this one. &lt;/p&gt;

&lt;h3&gt;
  
  
  Thanks for reading
&lt;/h3&gt;

&lt;p&gt;This is my first post and i hope you liked it just a little bit! If you can please leave a comment down below. I very appreciate any kind of critism especially for my writing skills and i know about my poor vocabulary. &lt;/p&gt;

</description>
      <category>learning</category>
      <category>puzzles</category>
    </item>
  </channel>
</rss>
