Skip to content

Commit

Permalink
docs(#41): update README
Browse files Browse the repository at this point in the history
  • Loading branch information
dukeluo committed Apr 14, 2024
1 parent 4d6725c commit dc22162
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,54 @@ npm install eslint-plugin-check-file --save-dev

## Usage

### Flat Config

```javascript
import checkFile from 'eslint-plugin-check-file';

export default [
{
files: ['src/**/*'],
plugins: {
'check-file': checkFile,
},
rules: {
'check-file/no-index': 'error',
'check-file/filename-blocklist': [
'error',
{
'**/*.model.ts': '*.models.ts',
'**/*.util.ts': '*.utils.ts',
},
],
'check-file/folder-match-with-fex': [
'error',
{
'*.test.{js,jsx,ts,tsx}': '**/__tests__/',
'*.styled.{jsx,tsx}': '**/pages/',
},
],
'check-file/filename-naming-convention': [
'error',
{
'**/*.{jsx,tsx}': 'CAMEL_CASE',
'**/*.{js,ts}': 'KEBAB_CASE',
},
],
'check-file/folder-naming-convention': [
'error',
{
'src/**/': 'CAMEL_CASE',
'mocks/*/': 'KEBAB_CASE',
},
],
},
},
];
```

### `eslintrc`

Add `check-file` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
Expand Down

0 comments on commit dc22162

Please sign in to comment.