<?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: Philip Jöbstl</title>
    <description>The latest articles on DEV Community by Philip Jöbstl (@phlashdev).</description>
    <link>https://dev.to/phlashdev</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%2F189976%2Ff7746e97-bed8-403d-8bd0-2c9a0f819773.jpeg</url>
      <title>DEV Community: Philip Jöbstl</title>
      <link>https://dev.to/phlashdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/phlashdev"/>
    <language>en</language>
    <item>
      <title>Angular: Migrate from TSLint to ESLint</title>
      <dc:creator>Philip Jöbstl</dc:creator>
      <pubDate>Wed, 06 Apr 2022 11:34:31 +0000</pubDate>
      <link>https://dev.to/phlashdev/angular-migrate-from-tslint-to-eslint-3dgc</link>
      <guid>https://dev.to/phlashdev/angular-migrate-from-tslint-to-eslint-3dgc</guid>
      <description>&lt;p&gt;Excerpt from &lt;a href="https://en.wikipedia.org/wiki/Lint_(software)"&gt;Wikipedia&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Lint, or a linter, is a static code analysis tool used to flag programming errors, bugs, stylistic errors and suspicious constructs. The term originates from a Unix utility that examined C language source code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Linting in TypeScript
&lt;/h2&gt;

&lt;p&gt;Linters can have a great impact on the development of your application. This is espescially true if the technology used comes out of the JavaScript environment. &lt;em&gt;The&lt;/em&gt; standard linter in the JS world is a tool called &lt;a href="https://eslint.org/"&gt;ESLint&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Opposing to this, &lt;em&gt;TSLint&lt;/em&gt; emerged as the defacto standard linting tool for TypeScript projects. But to simplify the experience for developers switching to TypeScript, ESLint began to incorporate features specific to TSLint. In 2019, TSLint stopped active development of new features, and encourages it's users to migrate to ESLint. You can read more details about this decision on the &lt;a href="https://blog.palantir.com/tslint-in-2019-1a144c2317a9"&gt;Palantir Blog&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Migration path for existing projects
&lt;/h2&gt;

&lt;p&gt;You can find all necessary tools and information to simplify the migration of existing Angular projects to ESLint at the GitHub Repo &lt;a href="https://github.com/angular-eslint/angular-eslint"&gt;Angular ESLint&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;First you have to add the relevant packages as dev dependencies by using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng add @angular-eslint/schematics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can use &lt;code&gt;convert-tslint-to-eslint&lt;/code&gt;. This will remove all TSLint specific configuration. It also creates the necessary files for ESLint and converts references in NPM scripts or code comments like &lt;code&gt;tslint:disable&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng g @angular-eslint/schematics:convert-tslint-to-eslint
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! You can now execute ESLint by running the following of your command line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run lint
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Code editor support
&lt;/h2&gt;

&lt;p&gt;ESLint has a variety of integrations for various dev tools. You can find a full list at the &lt;a href="https://eslint.org/docs/user-guide/integrations"&gt;ESLint user guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To integrate ESLint into &lt;em&gt;VS Code&lt;/em&gt;, you can install the wonderful plugin called, well, ... &lt;a href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint"&gt;ESLint (dbaeumer.vscode-eslint)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I would also recommend you to install the optional, but nevertheless interesting &lt;a href="https://marketplace.visualstudio.com/items?itemName=ghmcadams.lintlens"&gt;LintLens (ghmcadams.lintlens)&lt;/a&gt;. It gives you additional infos about the configured linting rules directly while editing your &lt;code&gt;.eslintrc.json&lt;/code&gt; file.&lt;/p&gt;

&lt;h2&gt;
  
  
  It's a wrap
&lt;/h2&gt;

&lt;p&gt;And this is all you need to migrate your existing Angular applications from TSLint to ESLint. I hope this post will help someone out there, so please share it if you like!&lt;/p&gt;

</description>
      <category>angular</category>
      <category>typescript</category>
      <category>vscode</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
