8000 chore: WIP! Add linter by KFlash · Pull Request #89 · kataw/kataw · GitHub
[go: up one dir, main page]

Skip to content

chore: WIP! Add linter - #89

Closed
KFlash wants to merge 4 commits into
mainfrom
linter
Closed

KFlash wants to merge 4 commits into
mainfrom
linter

Conversation

@KFlash
@KFlash KFlash commented Jun 4, 2021 •
Copy link
Copy Markdown
Contributor

This adds a linter to Kataw. By default an autoFix option can be enabled and it will try to fix as much errors as possible.

Additional rules can be set like this:

{
linterOptions: {
    SwitchDefault: true // require switch default
  }
}

The diagnostics has been updated with a Linter bitwise mask so it's possible to use a different color for this in an reporter.

The question is what kind of rules should we allow? We have only 28 slots available - 28 rules we can add.

Example on current API approach:

kataw.parseScript('switch(x) {}', { linterOptions: { switchDefault: true} }, function() {});

// A 'default' clause is required

@KFlash
KFlash marked this pull request as draft June 4, 2021 09:26
@KFlash
KFlash requested a review from aladdin-add June 4, 2021 09:27
@KFlash
KFlash commented Jun 4, 2021
Copy link
Copy Markdown
Contributor Author

Closing this for now. Will reopen later.

@KFlash KFlash closed this Jun 4, 2021
@KFlash
KFlash deleted the linter branch July 12, 2021 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0