Skip to content

Commit dc22162

Browse files
committed
docs(#41): update README
1 parent 4d6725c commit dc22162

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

+48
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,54 @@ npm install eslint-plugin-check-file --save-dev
2828

2929
## Usage
3030

31+
### Flat Config
32+
33+
```javascript
34+
import checkFile from 'eslint-plugin-check-file';
35+
36+
export default [
37+
{
38+
files: ['src/**/*'],
39+
plugins: {
40+
'check-file': checkFile,
41+
},
42+
rules: {
43+
'check-file/no-index': 'error',
44+
'check-file/filename-blocklist': [
45+
'error',
46+
{
47+
'**/*.model.ts': '*.models.ts',
48+
'**/*.util.ts': '*.utils.ts',
49+
},
50+
],
51+
'check-file/folder-match-with-fex': [
52+
'error',
53+
{
54+
'*.test.{js,jsx,ts,tsx}': '**/__tests__/',
55+
'*.styled.{jsx,tsx}': '**/pages/',
56+
},
57+
],
58+
'check-file/filename-naming-convention': [
59+
'error',
60+
{
61+
'**/*.{jsx,tsx}': 'CAMEL_CASE',
62+
'**/*.{js,ts}': 'KEBAB_CASE',
63+
},
64+
],
65+
'check-file/folder-naming-convention': [
66+
'error',
67+
{
68+
'src/**/': 'CAMEL_CASE',
69+
'mocks/*/': 'KEBAB_CASE',
70+
},
71+
],
72+
},
73+
},
74+
];
75+
```
76+
77+
### `eslintrc`
78+
3179
Add `check-file` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
3280

3381
```json

0 commit comments

Comments
 (0)