<?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: Nisharg Shah</title>
    <description>The latest articles on DEV Community by Nisharg Shah (@nishargshah).</description>
    <link>https://dev.to/nishargshah</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%2F367995%2Fb616817f-9ded-4ae7-9379-ec526abe91c4.jpeg</url>
      <title>DEV Community: Nisharg Shah</title>
      <link>https://dev.to/nishargshah</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nishargshah"/>
    <language>en</language>
    <item>
      <title>Level Up Your Code with Airbnb's Extended ESLint Configuration</title>
      <dc:creator>Nisharg Shah</dc:creator>
      <pubDate>Sat, 26 Apr 2025 11:17:27 +0000</pubDate>
      <link>https://dev.to/nishargshah/level-up-your-code-with-airbnbs-extended-eslint-configuration-1lml</link>
      <guid>https://dev.to/nishargshah/level-up-your-code-with-airbnbs-extended-eslint-configuration-1lml</guid>
      <description>&lt;p&gt;Writing clean and consistent code is super important, not just for you, but for your whole team. That’s why we use  &lt;strong&gt;ESLint&lt;/strong&gt;, a tool that checks your code and gives you helpful tips!&lt;/p&gt;

&lt;p&gt;You’ve probably heard of the  &lt;strong&gt;Airbnb ESLint Config&lt;/strong&gt;  — it’s super popular! But here’s the problem 😬 It hasn’t been updated in  &lt;strong&gt;over 3 years&lt;/strong&gt;, and it doesn’t work well with the  &lt;strong&gt;new ESLint 9&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Solution?
&lt;/h1&gt;

&lt;p&gt;Say hello to  &lt;strong&gt;eslint-config-airbnb-extended,&lt;/strong&gt;  a newer and smarter version of the Airbnb style guide that works perfectly with  &lt;strong&gt;ESLint 9&lt;/strong&gt;  and future versions.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why Choose eslint-config-airbnb-extended?
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;eslint-config-airbnb-extended&lt;/code&gt;  is designed exclusively for  &lt;strong&gt;ESLint’s flat configuration&lt;/strong&gt; system, moving away from legacy  &lt;code&gt;.eslintrc*&lt;/code&gt;  files.​ That means it doesn't use old-style config files anymore and it also supports both  &lt;strong&gt;JavaScript&lt;/strong&gt;  and  &lt;strong&gt;TypeScript&lt;/strong&gt;  projects.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;eslint-config-airbnb-extended&lt;/code&gt;  builds upon the solid foundation of Airbnb's style guide, offering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Airbnb Configuration:&lt;/strong&gt;  Built on top of Airbnb’s highly opinionated ESLint config.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Flat Configuration Support&lt;/strong&gt;: Embraces ESLint’s flat configuration system, moving away from legacy  &lt;code&gt;.eslintrc&lt;/code&gt;  files for a more streamlined setup.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;TypeScript Support:&lt;/strong&gt;  Out-of-the-box TypeScript support for all your code.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Pre-configured Rules:&lt;/strong&gt;  Ready-to-go rules that enforce consistent coding practices.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Enhanced Customization&lt;/strong&gt;: Provides additional rules and plugins to accommodate a broader range of coding standards and preferences.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Simplified Setup:&lt;/strong&gt;  Offers an automated configuration process to set up your project in seconds with a simple command-line tool.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Getting Started
&lt;/h1&gt;

&lt;p&gt;To quickly integrate  &lt;code&gt;eslint-config-airbnb-extended&lt;/code&gt;  into your project, use 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;npx create-airbnb-x-config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script will guide you through the setup process, configuring ESLint with the extended Airbnb rules tailored to your project’s needs.&lt;/p&gt;

&lt;p&gt;This tool will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Ask you some quick questions&lt;/li&gt;
&lt;li&gt;  Auto-detect your package manager (&lt;code&gt;npm/yarn/pnpm&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;  Install all the things you need (or give you commands if you want to do it yourself)&lt;/li&gt;
&lt;li&gt;  Give you a  &lt;strong&gt;GitHub link&lt;/strong&gt;  with your custom config&lt;/li&gt;
&lt;li&gt;  You copy → paste the config into your  &lt;code&gt;eslint.config.mjs&lt;/code&gt;  file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to learn how to set up &lt;strong&gt;&lt;code&gt;eslint-config-airbnb-extended&lt;/code&gt;&lt;/strong&gt; the detailed way, check out the  &lt;a href="https://github.com/NishargShah/eslint-config-airbnb-extended/tree/master/packages/eslint-config-airbnb-extended#installation" rel="noopener noreferrer"&gt;full guide&lt;/a&gt;. It will show you everything step by step, what you need to install, how to set it up, and how to use it in your code.&lt;/p&gt;

&lt;p&gt;If you like doing things yourself, there’s also a part that shows you how to install it  &lt;strong&gt;manually&lt;/strong&gt;. That means you’ll get to install each piece one by one and make it work just the way you want.&lt;/p&gt;

&lt;h1&gt;
  
  
  Key Features
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Modern JavaScript Ready:&lt;/strong&gt;  Supports all the cool new stuff in JavaScript, so your code is always up to date, with help from  &lt;code&gt;@stylistic/eslint-plugin&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;React &amp;amp; JSX Support&lt;/strong&gt;: Enforces best practices for building React components with clean and maintainable JSX, using  &lt;code&gt;eslint-plugin-react&lt;/code&gt;  and  &lt;code&gt;eslint-plugin-jsx-a11y&lt;/code&gt;. These packages keep your React code in line with accessibility and best practices.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;React Hooks Friendly&lt;/strong&gt;: Prevents common mistakes with React hooks and enforces the rules of hooks, thanks to  &lt;code&gt;eslint-plugin-react-hooks&lt;/code&gt;. This ensures that you’re always using hooks in the right way.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Prettier Matching&lt;/strong&gt;: Works alongside Prettier to keep your code formatting consistent and beautiful.  &lt;code&gt;eslint-config-prettier&lt;/code&gt;  helps ensure that the ESLint rules and Prettier configurations match perfectly for flawless code formatting.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Accessibility First&lt;/strong&gt;: Encourages accessible UI development with helpful lint rules for JSX accessibility, powered by  &lt;code&gt;eslint-plugin-jsx-a11y&lt;/code&gt;. It guides you in making your applications more inclusive for users with disabilities.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Smart Imports&lt;/strong&gt;: Helps manage imports cleanly and correctly, including support for TypeScript paths, using  &lt;code&gt;eslint-import-x&lt;/code&gt;  and  &lt;code&gt;eslint-import-resolver-typescript&lt;/code&gt;. These packages make sure your imports are well-organized and error-free.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Node.js Best Practices&lt;/strong&gt;: Includes rules that improve the quality and performance of Node.js applications, with the help of  &lt;code&gt;eslint-plugin-n&lt;/code&gt;. This package makes sure your backend code follows best practices.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Modular Setup&lt;/strong&gt;: Well-organized structure using modules like  &lt;code&gt;configs&lt;/code&gt;,  &lt;code&gt;plugins&lt;/code&gt;, and  &lt;code&gt;rules&lt;/code&gt;  for easier customization and scalability.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Make it Stricter?
&lt;/h1&gt;

&lt;p&gt;This package also comes with  &lt;strong&gt;strict configuration options,&lt;/strong&gt; but they’re not enabled by default. If you’re looking to take your linting game to the next level, you can turn on stricter rules for  &lt;strong&gt;imports&lt;/strong&gt;,  &lt;strong&gt;React&lt;/strong&gt;, and  &lt;strong&gt;TypeScript&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;For Import Statements&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This rule set (&lt;code&gt;rules.base.importsStrict&lt;/code&gt;) helps you keep your import statements well-organized and professional by&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Making sure imports are always in a consistent order&lt;/li&gt;
&lt;li&gt;  Separating type imports (used by TypeScript) from regular imports&lt;/li&gt;
&lt;li&gt;  Follows patterns commonly used in production-level codebases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes your files easier to read and maintain, especially as your project grows.&lt;/p&gt;

&lt;h2&gt;
  
  
  For React Code
&lt;/h2&gt;

&lt;p&gt;The React-specific strict rules (&lt;code&gt;rules.react.strict&lt;/code&gt;) help improve your component quality by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  A check to make sure every element inside a list has a unique  &lt;code&gt;key&lt;/code&gt;  prop (important for performance and avoiding bugs)&lt;/li&gt;
&lt;li&gt;  Automatic sorting of props in JSX (helps with consistency)&lt;/li&gt;
&lt;li&gt;  Disabling  &lt;code&gt;prop-types&lt;/code&gt;  since you're using TypeScript, which already handles type checking&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It encourages cleaner and more modern React practices.&lt;/p&gt;

&lt;h2&gt;
  
  
  For TypeScript Code
&lt;/h2&gt;

&lt;p&gt;The TypeScript strict rules (&lt;code&gt;rules.typescript.typescriptEslintStrict&lt;/code&gt;) are designed to make your code safer and more predictable. They:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Banning  &lt;code&gt;@ts-ignore&lt;/code&gt;, and instead requiring  &lt;code&gt;@ts-expect-error&lt;/code&gt;  so you know exactly why an error is expected&lt;/li&gt;
&lt;li&gt;  Disallowing the use of  &lt;code&gt;any&lt;/code&gt;, which can hide potential bugs&lt;/li&gt;
&lt;li&gt;  Preventing the use of  &lt;code&gt;!&lt;/code&gt;  (non-null assertions), which can lead to unexpected crashes&lt;/li&gt;
&lt;li&gt;  Encouraging better alternatives like  &lt;code&gt;??&lt;/code&gt;  (nullish coalescing) and optional chaining (&lt;code&gt;?.&lt;/code&gt;) for safer access to values&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re passionate about writing clean and consistent code with ESLint, give these strict rules a try. Sure, it might feel a bit strict at first, but once you get used to it, you’ll wonder how you ever coded without it.&lt;/p&gt;

&lt;p&gt;So, what are you waiting for? Enable it, explore the rules, and see the difference for yourself. For a complete guide and detailed rule descriptions, refer to the  &lt;a href="https://github.com/NishargShah/eslint-config-airbnb-extended/tree/master/packages/eslint-config-airbnb-extended#strict-rules" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Writing clean and consistent code is super important for you and your team.  &lt;strong&gt;ESLint&lt;/strong&gt;  helps by checking your code and giving tips to make it better. The  &lt;strong&gt;Airbnb ESLint Config&lt;/strong&gt;  was popular but hasn’t been updated in years, and it doesn’t work well with the newest version of ESLint.&lt;/p&gt;

&lt;p&gt;So, we now have  &lt;code&gt;eslint-config-airbnb-extended&lt;/code&gt;  It’s a better version that works perfectly with the latest ESLint and helps with both JavaScript and TypeScript projects. It’s easy to set up and comes with ready-made rules that keep your code clean and consistent.&lt;/p&gt;

&lt;p&gt;With  &lt;strong&gt;eslint-config-airbnb-extended&lt;/strong&gt;, you get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  A setup that’s super easy and fast to use&lt;/li&gt;
&lt;li&gt;  Support for modern JavaScript &amp;amp; TypeScript features&lt;/li&gt;
&lt;li&gt;  Better rules for React, JSX, and accessibility&lt;/li&gt;
&lt;li&gt;  A perfect match with Prettier to keep your code looking great&lt;/li&gt;
&lt;li&gt;  Better organization for your imports and Node.js backend code&lt;/li&gt;
&lt;li&gt;  Strict configurations to make your code better and more reliable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, you can write code that looks good, works well, and follows the best practices! For more details and to explore the full range of features, visit the  &lt;a href="https://github.com/NishargShah/eslint-config-airbnb-extended" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>eslint</category>
      <category>javascript</category>
      <category>typescript</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
