Skip to content

Commit

Permalink
chore: auto-organize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
bd82 committed Jul 8, 2023
1 parent 3f3d2b0 commit 6be02ad
Show file tree
Hide file tree
Showing 21 changed files with 59 additions and 70 deletions.
14 changes: 7 additions & 7 deletions examples/grammars/graphql/gen/graphql-bundled.min.mjs

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions packages/chevrotain/scripts/version-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import fs from "fs"
import {
apiString,
currVersion,
packagePath,
pkgJson,
readmePath,
versionPath
} from "./version-config.js"
Expand Down
4 changes: 2 additions & 2 deletions packages/chevrotain/src/parse/grammar/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ import {
ILookaheadStrategy,
IProduction,
IProductionWithOccurrence,
TokenType,
Rule
Rule,
TokenType
} from "@chevrotain/types"
import {
IGrammarValidatorErrorMessageProvider,
Expand Down
4 changes: 2 additions & 2 deletions packages/chevrotain/src/parse/grammar/llk_lookahead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import {
ILookaheadStrategy,
ILookaheadValidationError,
IOrAlt,
OptionalProductionType,
Rule,
TokenType,
OptionalProductionType
TokenType
} from "@chevrotain/types"
import { flatMap, isEmpty } from "lodash-es"
import { defaultGrammarValidatorErrorProvider } from "../errors_public.js"
Expand Down
6 changes: 3 additions & 3 deletions packages/chevrotain/src/parse/grammar/lookahead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import {
RepetitionWithSeparator
} from "@chevrotain/gast"
import {
BaseParser,
IOrAlt,
IProduction,
IProductionWithOccurrence,
LookaheadSequence,
LookaheadProductionType,
LookaheadSequence,
Rule,
TokenType,
BaseParser
TokenType
} from "@chevrotain/types"

export enum PROD_TYPE {
Expand Down
4 changes: 2 additions & 2 deletions packages/chevrotain/src/parse/parser/traits/looksahead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import { MixedInParser } from "./parser_traits.js"
import {
Alternation,
GAstVisitor,
getProductionDslName,
Option,
Repetition,
RepetitionMandatory,
RepetitionMandatoryWithSeparator,
RepetitionWithSeparator,
Rule,
getProductionDslName
Rule
} from "@chevrotain/gast"
import { LLkLookaheadStrategy } from "../../grammar/llk_lookahead.js"

Expand Down
7 changes: 1 addition & 6 deletions packages/chevrotain/src/scan/reg_exp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ import {
Group,
Set
} from "@chevrotain/regexp-to-ast"
import { isArray } from "lodash-es"
import { every } from "lodash-es"
import { forEach } from "lodash-es"
import { find } from "lodash-es"
import { values } from "lodash-es"
import { includes } from "lodash-es"
import { every, find, forEach, includes, isArray, values } from "lodash-es"
import { PRINT_ERROR, PRINT_WARNING } from "@chevrotain/utils"
import { ASTNode, getRegExpAst } from "./reg_exp_parser.js"
import { charCodeToOptimizedIndex, minOptimizationVal } from "./lexer.js"
Expand Down
6 changes: 4 additions & 2 deletions packages/chevrotain/test/full_flow/ecma_quirks/ecma_quirks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { createToken } from "../../../src/scan/tokens_public.js"
import { Lexer } from "../../../src/scan/lexer_public.js"
import { EmbeddedActionsParser } from "../../../src/parse/parser/traits/parser_traits.js"
import {
EmbeddedActionsParser,
MixedInParser
} from "../../../src/parse/parser/traits/parser_traits.js"

import { END_OF_FILE } from "../../../src/parse/parser/parser.js"
import { MismatchedTokenException } from "../../../src/parse/exceptions_public.js"
Expand All @@ -15,7 +18,6 @@ import type {
Rule,
TokenType
} from "@chevrotain/types"
import { MixedInParser } from "../../../src/parse/parser/traits/parser_traits.js"
import { getLookaheadPaths } from "../../../src/parse/grammar/lookahead.js"

declare type QuirksTokens = {
Expand Down
1 change: 1 addition & 0 deletions packages/chevrotain/test/test.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable -- config file */
import chai from "chai"
import sinonChai from "sinon-chai"

chai.use(sinonChai)
/* eslint-enable -- config file */
2 changes: 1 addition & 1 deletion packages/cst-dts-gen-test/test/options_spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GenerateDtsOptions } from "@chevrotain/types"
import { generateCstDts } from "@chevrotain/cst-dts-gen"
import { CstParser, createToken } from "chevrotain"
import { createToken, CstParser } from "chevrotain"
import { expect } from "chai"

describe("The DTS generator", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cst-dts-gen-test/test/sample_test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BaseParser } from "chevrotain"
import { expect } from "chai"
import { readFileSync } from "fs"
import { resolve, relative, basename, dirname } from "path"
import { basename, dirname, relative, resolve } from "path"
import { generateCstDts } from "@chevrotain/cst-dts-gen"
import { fileURLToPath } from "url"

Expand Down
2 changes: 1 addition & 1 deletion packages/cst-dts-gen/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Rule, GenerateDtsOptions } from "@chevrotain/types"
import { GenerateDtsOptions, Rule } from "@chevrotain/types"
import { buildModel } from "./model.js"
import { genDts } from "./generate.js"

Expand Down
8 changes: 4 additions & 4 deletions packages/cst-dts-gen/src/generate.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { upperFirst, flatten, isArray, map, reduce, uniq } from "lodash-es"
import { flatten, isArray, map, reduce, uniq, upperFirst } from "lodash-es"
import { GenerateDtsOptions } from "@chevrotain/types"
import {
CstNodeTypeDefinition,
PropertyTypeDefinition,
PropertyArrayType,
TokenArrayType,
RuleArrayType
PropertyTypeDefinition,
RuleArrayType,
TokenArrayType
} from "./model.js"

export function genDts(
Expand Down
4 changes: 2 additions & 2 deletions packages/cst-dts-gen/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import type {
Terminal,
TokenType
} from "@chevrotain/types"
import { NonTerminal, GAstVisitor } from "@chevrotain/gast"
import { flatten, values, some, groupBy, assign, map } from "lodash-es"
import { GAstVisitor, NonTerminal } from "@chevrotain/gast"
import { assign, flatten, groupBy, map, some, values } from "lodash-es"

export function buildModel(
productions: Record<string, Rule>
Expand Down
4 changes: 1 addition & 3 deletions packages/gast/src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { some } from "lodash-es"
import { every } from "lodash-es"
import { includes } from "lodash-es"
import { every, includes, some } from "lodash-es"
import {
AbstractProduction,
Alternation,
Expand Down
7 changes: 1 addition & 6 deletions packages/gast/src/model.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import { map } from "lodash-es"
import { forEach } from "lodash-es"
import { isString } from "lodash-es"
import { isRegExp } from "lodash-es"
import { pickBy } from "lodash-es"
import { assign } from "lodash-es"
import { assign, forEach, isRegExp, isString, map, pickBy } from "lodash-es"
import type {
IGASTVisitor,
IProduction,
Expand Down
18 changes: 9 additions & 9 deletions packages/gast/test/helpers_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import { expect } from "chai"
import type { ITokenConfig, TokenType } from "@chevrotain/types"
import {
Alternation,
Terminal,
Rule,
Alternative,
isBranchingProd,
isOptionalProd,
isSequenceProd,
NonTerminal,
Option,
Repetition,
RepetitionWithSeparator,
RepetitionMandatoryWithSeparator,
RepetitionMandatory,
Option,
NonTerminal,
isSequenceProd,
isOptionalProd,
isBranchingProd
RepetitionMandatoryWithSeparator,
RepetitionWithSeparator,
Rule,
Terminal
} from "../src/api.js"

function createDummyToken(opts: ITokenConfig): TokenType {
Expand Down
14 changes: 7 additions & 7 deletions packages/gast/test/model_spec.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { expect } from "chai"
import { ITokenConfig, TokenType } from "@chevrotain/types"
import {
getProductionDslName,
Alternation,
Alternative,
getProductionDslName,
NonTerminal,
Option,
Repetition,
RepetitionMandatory,
RepetitionMandatoryWithSeparator,
Terminal,
Option,
RepetitionWithSeparator,
Repetition,
serializeProduction,
Alternative,
Rule,
serializeGrammar
serializeGrammar,
serializeProduction,
Terminal
} from "../src/api.js"

function createDummyToken(opts: ITokenConfig): TokenType {
Expand Down
14 changes: 7 additions & 7 deletions packages/gast/test/visitor_spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { expect } from "chai"
import type { ITokenConfig, TokenType } from "@chevrotain/types"
import {
GAstVisitor,
Terminal,
Rule,
Alternation,
Alternative,
GAstVisitor,
NonTerminal,
Option,
Repetition,
RepetitionWithSeparator,
RepetitionMandatoryWithSeparator,
RepetitionMandatory,
Option,
NonTerminal
RepetitionMandatoryWithSeparator,
RepetitionWithSeparator,
Rule,
Terminal
} from "../src/api.js"

function createDummyToken(opts: ITokenConfig): TokenType {
Expand Down
4 changes: 2 additions & 2 deletions packages/regexp-to-ast/test/visitor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { expect } from "chai"
import type {
Alternative,
Assertion,
Character,
Disjunction,
Group,
GroupBackReference,
Quantifier,
RegExpPattern,
Set,
Character
Set
} from "../types"
import { RegExpParser } from "../src/regexp-parser.js"
import { BaseRegExpVisitor } from "../src/base-regexp-visitor.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/website/scripts/version-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import fs from "fs"
import git from "gitty"
import _ from "lodash"
import {
changeLogPath,
changeLogString,
currVersion,
changeLogPath,
markdownDocsFiles
} from "./version-config.js"

Expand Down

0 comments on commit 6be02ad

Please sign in to comment.