Skip to content

Commit

Permalink
docs: update ignore rc
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinjiang committed Jan 19, 2024
1 parent c62ff9c commit 6ba7bca
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ zhlint --config <filepath>

# .zhlintignore by default
zhlint --ignore <filepath>
zhlint --file-ignore <filepath>

# .zhlintcaseignore by default
zhlint --case-ignore <filepath>

# current directory by default
zhlint --dir <path>
Expand All @@ -68,7 +72,9 @@ In the config file, you can write a JSON like:

For more details, see [supported rules](#supported-rules).

In the ignore file, you can write some lines of ignored cases like:
In the file-ignore file, you can write some lines to ignore files in [.gitignore syntax](https://git-scm.com/docs/gitignore#_pattern_format):

In the case-ignore file, you can write some lines of ignored cases like:

```txt
( , )
Expand Down Expand Up @@ -121,9 +127,10 @@ const value = '自动在中文和English之间加入空格'

const dir = '...' // the target directory path
const configPath = '...' // the config file path
const ignorePath = '...' // the ignore file path
const fileIgnorePath = '...' // the file-ignore file path
const caseIgnorePath = '...' // the case-ignore file path

const config = readRc(dir, configPath, ignorePath)
const config = readRc(dir, configPath, fileIgnorePath, caseIgnorePath)
const output = runWithConfig(value, config)

// ... further actions
Expand Down Expand Up @@ -175,7 +182,7 @@ type Options = {
- `preset`: `string` (optional)
- `rules`: `RuleOptions` without the `preset` field. (optional)
- `hyperParsers`: `string[]` (optional)
- `ignores`: `string[]` and the priority is lower than `.zhlintignore`. (optional)
- `caseIgnores`: `string[]` and the priority is lower than `.zhlintcaseignore`. (optional)
### Output
Expand Down
15 changes: 11 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ zhlint --config <filepath>

# .zhlintignore by default
zhlint --ignore <filepath>
zhlint --file-ignore <filepath>

# .zhlintcaseignore by default
zhlint --case-ignore <filepath>

# current directory by default
zhlint --dir <path>
Expand All @@ -74,7 +78,9 @@ In the config file, you can write a JSON like:

For more details, see [supported rules](#supported-rules).

In the ignore file, you can write some lines of ignored cases like:
In the file-ignore file, you can write some lines to ignore files in [.gitignore syntax](https://git-scm.com/docs/gitignore#_pattern_format):

In the case-ignore file, you can write some lines of ignored cases like:

```txt
( , )
Expand Down Expand Up @@ -131,9 +137,10 @@ const value = '自动在中文和English之间加入空格'

const dir = '...' // the target directory path
const configPath = '...' // the config file path
const ignorePath = '...' // the ignore file path
const fileIgnorePath = '...' // the file-ignore file path
const caseIgnorePath = '...' // the case-ignore file path

const config = readRc(dir, configPath, ignorePath)
const config = readRc(dir, configPath, fileIgnorePath, caseIgnorePath)
const output = runWithConfig(value, config)

// ... further actions
Expand Down Expand Up @@ -187,7 +194,7 @@ type Options = {
- `preset`: `string` (optional)
- `rules`: `RuleOptions` without the `preset` field. (optional)
- `hyperParsers`: `string[]` (optional)
- `ignores`: `string[]` and the priority is lower than `.zhlintignore`. (optional)
- `caseIgnores`: `string[]` and the priority is lower than `.zhlintcaseignore`. (optional)
### Output
Expand Down

0 comments on commit 6ba7bca

Please sign in to comment.