<?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: Kriz Poon</title>
    <description>The latest articles on DEV Community by Kriz Poon (@krizpoon).</description>
    <link>https://dev.to/krizpoon</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%2F219689%2F55a148ae-6b89-47ac-8624-e7c2b4f5e9bd.jpeg</url>
      <title>DEV Community: Kriz Poon</title>
      <link>https://dev.to/krizpoon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/krizpoon"/>
    <language>en</language>
    <item>
      <title>ESLint folder naming rule for NextJS [slug] folders</title>
      <dc:creator>Kriz Poon</dc:creator>
      <pubDate>Sun, 25 Sep 2022 22:18:11 +0000</pubDate>
      <link>https://dev.to/krizpoon/eslint-folder-naming-rule-for-nextjs-slug-folders-54md</link>
      <guid>https://dev.to/krizpoon/eslint-folder-naming-rule-for-nextjs-slug-folders-54md</guid>
      <description>&lt;p&gt;We have a &lt;code&gt;check-file/folder-naming-convention&lt;/code&gt; ESLint rule in our NextJS project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"check-file/folder-naming-convention": [
  "error",
  {
    "src/pages/**/": "KEBEB_CASE",
    ...
  }
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It was fine until we have a &lt;code&gt;[slug]&lt;/code&gt; folder for some dynamic routes.&lt;/p&gt;

&lt;p&gt;Luckily, &lt;code&gt;check-file/folder-naming-convention&lt;/code&gt; supports custom pattern. Here is how we solved it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"check-file/folder-naming-convention": [
  "error",
  {
    "src/pages/**/": "?(\\[)+([a-z0-9-])?(\\])",
    ...
  }
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>eslint</category>
      <category>nextjs</category>
      <category>glob</category>
    </item>
  </channel>
</rss>
