Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Update: rewrite TokenStore (fixes #7810) - Refactors TokenStore with ES2015 classes. - Adds object-style options to every method of TokenStore. E.g. `{includeComments: true, skip: 0, filter: null}` - Adds `getFirstTokenBetween` and `getLastTokenBetween` methods. - Adds `getTokenOrCommentAfter` and `getTokenOrCommentBefore` methods to TokenStore for backward compatibility. - Removes the TokenStore instance for the mix of tokens and comments. * Chore: refactor with new API * Docs: update working-with-rules.md * Fix: improve tests * Chore: simplify `isNot*` functions * Chore: fix jsdoc comments. * Fix: `isComment` returns true for shebang * Chore: remove unnecessary `isOfToken` function * Chore: refactor TokenStore; remove `movePrev` methods * Chore: rename variables: start, end, imap * Fix: this.predicate() → predicate() * Chore: typeof → in * Chore: use lodash.sortedIndexBy * Chore: update jsdoc comments * Docs: add a note for skip & filter * Chore: fix typo * Chore: fix "Block" to `.startsWith("Block")` To change `Block` to `BlockComment` in future. * Docs: add compatibility notes to JSDoc * Chore: modularize TokenStore * Chore: fix plural in test descriptions * Fix: add assertions for options.skip and options.count * Chore: it/ic → tokenIndex/commentIndex
- Loading branch information
1 parent
329dcdc
commit 834f45d
Showing
49 changed files
with
2,579 additions
and
456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.