Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement AA comma linting and fixing #40

Merged
merged 1 commit into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ or create a minimal `bsconfig.json` like that:
}
```

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

### Command line interface (CLI)
Expand Down Expand Up @@ -98,7 +98,7 @@ 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
Format should follow "glob search" rules, as implemented in
[minimatch](https://www.npmjs.com/package/minimatch) module.

Examples:
Expand Down Expand Up @@ -128,6 +128,7 @@ Default rules:
"condition-style": "no-group",
"named-function-style": "auto",
"anon-function-style": "auto",
"aa-comma-style": "no-dangling",
"no-print": "off",

"type-annotations": "off",
Expand Down Expand Up @@ -172,6 +173,13 @@ Default rules:
- `auto`: use `sub` for `Void` functions, otherwise use `function` (**default**)
- `off`: no not validate

- `aa-comma-style`: validation of commas in Associative Array (AA) literals

- `always`: enforce the presence of commas, always
- `no-dangling`: enforce the presence of commas but don't leave one dangling (**default**)
- `never`: enforce that optional commas aren't used
- `off`: do not validate

- `no-print`: prevent usage of `print` statements in code (`error | warn | info | off`)

### Strictness rules
Expand Down Expand Up @@ -236,6 +244,7 @@ Running `bslint` with `--fix` parameter will attempt to fix common code-style is
- Using wrong `sub` or `function` keyword,
- Using/missing the optional `then` keyword,
- Using/missing parenthesis around `if/while` conditions.
- Adding/removing Associative Array (AA) literals' commas where needed.
- Case sensitivity (align with first occurence)

## Usage checking (approximative)
Expand Down
Loading