<?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: Glory Isaiah</title>
    <description>The latest articles on DEV Community by Glory Isaiah (@layor2257).</description>
    <link>https://dev.to/layor2257</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%2F1101230%2F75c3b829-dbe9-4e3c-b7df-9857f043e989.jpeg</url>
      <title>DEV Community: Glory Isaiah</title>
      <link>https://dev.to/layor2257</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/layor2257"/>
    <language>en</language>
    <item>
      <title>Level Up Your Code Quality with ESLint: Catching Errors and Enforcing Consistency</title>
      <dc:creator>Glory Isaiah</dc:creator>
      <pubDate>Thu, 13 Jul 2023 10:27:10 +0000</pubDate>
      <link>https://dev.to/layor2257/level-up-your-code-quality-with-eslint-catching-errors-and-enforcing-consistency-1245</link>
      <guid>https://dev.to/layor2257/level-up-your-code-quality-with-eslint-catching-errors-and-enforcing-consistency-1245</guid>
      <description>&lt;p&gt;&lt;a href="https://eslint.org/"&gt;ESLint&lt;/a&gt; is a powerful utility designed to detect and report patterns present in code.&lt;/p&gt;

&lt;p&gt;How to install ESlint using npm&lt;/p&gt;

&lt;p&gt;Intialize a npm project&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Install eslint as a dev dependency&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install eslint --save-dev&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Setup eslint in your project by running this command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx eslint --init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Start using eslint by running this command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx eslint your-file.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you are using Yarn&lt;/p&gt;

&lt;p&gt;Intialize a Yarn project&lt;/p&gt;

&lt;p&gt;&lt;code&gt;yarn init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run the following command to install eslint( Note: this would install it as a Dev dependency)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;yarn add eslint --dev&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Setup eslint in your project by running the command below:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx eslint --init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run this command to start using eslint in your project:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx eslint your-file.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To set up lint rule enforcement using GitHub Actions, we will create a configuration file. This file, named eslint.yml, will define an automated action that runs during the workflow. Below is an example of the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: ESLint

on:
  push:
    branches:
      - development
      - staging
      - production
  pull_request:
    branches:
      - development
      - staging
      - production

jobs:
  lint:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Setup Node.js
        uses: actions/setup-node@v2
        with:
          node-version: 16

      - name: Install dependencies
        run: npm install

      - name: Run ESLint
        run: npm run lint

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

&lt;/div&gt;



&lt;p&gt;The workflow will be triggered when a push or a pull request is made to the specified environment branches (develop, staging, production).&lt;/p&gt;

&lt;p&gt;Both push and pull requests will trigger the ESLint job to run and perform lint checks using ESLint.&lt;/p&gt;

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