Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Info about ignores
  • Loading branch information
elsassph authored Sep 14, 2021
1 parent 1eb272d commit e774f9f
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,18 @@ npm init -y
npm install brighterscript @rokucommunity/bslint
```

Add the plugin to your `bsconfig.json` file in the root of your project,
or create a minimal file like that:
**Important**: add the plugin to your `bsconfig.json` file in the root of your project,
or create a minimal `bsconfig.json` like that:

```json
{
"plugins": [ "@rokucommunity/bslint" ]
}
```

Otherwise, you will only see issues coming from the
[brighterscript](https://github.com/rokucommunity/brighterscript) compiler.

### Command line interface (CLI)

The `bslint` command will run the BrighterScript compiler without publishing
Expand Down Expand Up @@ -72,6 +75,8 @@ and call `npm run lint`.

`bslint` can be configured using a `bslint.json` file in the root of your project.

Note: `bslint.json` is not the same file as `bsconfig.json`!

```json
{
"rules": {},
Expand All @@ -83,9 +88,26 @@ and call `npm run lint`.
Where each value is optional:

- `rules`: see below
- `globals`: a list of tokens which should be considered valid (ex. `_brs_`)
- `globals`: a list of tokens which should always be considered as safe (ex. `_brs_`)
- `ignores`: a list of files or globs of files to omit from linting

### Ignores

Unlike `brighterscripts`'s `diagnosticFilter` which hides issues, `bslint` will completely
skip ignored files when running the extra linting rules.

*Note: it won't remove issues reported by the compiler itself!*

Format should follow "glob search" rules, as implemented in
[minimatch](https://www.npmjs.com/package/minimatch) module.

Examples:

- `"lib/**/*"`: ignore everything under any `lib` folder,
- `"**/lib/**/*"`: same with explicit initial wildcard (added automatically if missing)
- `"specific-script.brs"`: ignore specific file name
- `"*.test.brs"`: partial match of file name

## Rules

Linting rules can be set in a `bslint.json` file in the root of your project.
Expand Down

0 comments on commit e774f9f

Please sign in to comment.