Skip to content

Commit 0d83bef

Browse files
committed
🔧 Enforce folder and file naming conventions
1 parent 21b027b commit 0d83bef

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

eslint.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import checkFile from 'eslint-plugin-check-file'
12
import svelteEslint from 'eslint-plugin-svelte'
23
import svelteParser from 'svelte-eslint-parser'
34
import tsESLint, { type ConfigWithExtends } from 'typescript-eslint'
@@ -43,6 +44,21 @@ const CUSTOM_RULES: ConfigWithExtends['rules'] = {
4344
'svelte/html-quotes': ['warn', { prefer: 'double' }],
4445
'svelte/block-lang': ['error', { script: ['ts', null], style: null }],
4546
'svelte/comment-directive': ['error', { reportUnusedDisableDirectives: true }],
47+
// Check File
48+
'check-file/filename-naming-convention': [
49+
'error',
50+
{
51+
'src/**/*.{ts.d.ts}': 'CAMEL_CASE',
52+
'tools/**/*.{ts.d.ts}': 'CAMEL_CASE',
53+
},
54+
],
55+
'check-file/folder-naming-convention': [
56+
'error',
57+
{
58+
'src/**': 'KEBAB_CASE',
59+
'tools/**': 'KEBAB_CASE',
60+
},
61+
],
4662
// TypeScript
4763
'@typescript-eslint/no-explicit-any': 'off',
4864
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
@@ -166,6 +182,7 @@ export default tsESLint.config(
166182
plugins: {
167183
'@typescript-eslint': tsESLint.plugin,
168184
svelte: svelteEslint,
185+
'check-file': checkFile,
169186
},
170187
},
171188
{

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"esbuild-plugin-inline-worker": "^0.1.1",
101101
"esbuild-plugin-svelte": "^0.1.1",
102102
"eslint": "^9.20.0",
103+
"eslint-plugin-check-file": "^3.0.0",
103104
"eslint-plugin-svelte": "^2.46.1",
104105
"find-cache-dir": "^5.0.0",
105106
"firebase": "^9.19.0",

yarn.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2250,6 +2250,14 @@ eslint-compat-utils@^0.5.1:
22502250
dependencies:
22512251
semver "^7.5.4"
22522252

2253+
eslint-plugin-check-file@^3.0.0:
2254+
version "3.0.0"
2255+
resolved "https://registry.yarnpkg.com/eslint-plugin-check-file/-/eslint-plugin-check-file-3.0.0.tgz#f465cc232e16fa5d522fe0e1538975b198fbd273"
2256+
integrity sha512-WCkGSE5bA1er0r8Hin7DL8GjHT09WSsO/1AwoCWpaDrvDd4dfXaYXJxHYP08J2wPYA4KqiVJ78U9bG/SZ1+qdw==
2257+
dependencies:
2258+
is-glob "^4.0.3"
2259+
micromatch "^4.0.8"
2260+
22532261
eslint-plugin-svelte@^2.46.1:
22542262
version "2.46.1"
22552263
resolved "https://registry.yarnpkg.com/eslint-plugin-svelte/-/eslint-plugin-svelte-2.46.1.tgz#22691c8685420cd4eabf0cbaa31a0cfb8395595b"

0 commit comments

Comments
 (0)