Skip to content

Commit 353c478

Browse files
committed
docs: add basic example
1 parent 6f6e9b9 commit 353c478

File tree

9 files changed

+1037
-0
lines changed

9 files changed

+1037
-0
lines changed

examples/basic/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Basic Example
2+
3+
This example demonstrates how to use `eslint-plugin-check-file` to enforce consistent file and folder naming conventions.

examples/basic/eslint.config.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import checkFile from '../../lib/index.js';
2+
3+
export default [
4+
{
5+
files: ['src/**/*'],
6+
plugins: {
7+
'check-file': checkFile,
8+
},
9+
rules: {
10+
'check-file/no-index': 'error',
11+
'check-file/filename-blocklist': [
12+
'error',
13+
{
14+
'**/*.model.ts': '*.models.ts',
15+
'**/*.util.ts': '*.utils.ts',
16+
},
17+
],
18+
'check-file/folder-match-with-fex': [
19+
'error',
20+
{
21+
'*.test.{js,jsx,ts,tsx}': '**/__tests__/',
22+
'*.styled.{jsx,tsx}': '**/components/',
23+
},
24+
],
25+
'check-file/filename-naming-convention': [
26+
'error',
27+
{
28+
'**/*.{jsx,tsx}': 'PASCAL_CASE',
29+
'**/*.{js,ts}': 'CAMEL_CASE',
30+
},
31+
],
32+
'check-file/folder-naming-convention': [
33+
'error',
34+
{
35+
'src/**/': 'CAMEL_CASE',
36+
'src/components/*/': 'PASCAL_CASE',
37+
},
38+
],
39+
},
40+
},
41+
];

0 commit comments

Comments
 (0)