diff --git a/src/rules/orderedImportsRule.ts b/src/rules/orderedImportsRule.ts index 9e2733c127d..fbd42a99fc1 100644 --- a/src/rules/orderedImportsRule.ts +++ b/src/rules/orderedImportsRule.ts @@ -24,7 +24,6 @@ import { isStringLiteral, } from "tsutils"; import * as ts from "typescript"; - import * as Lint from "../index"; export class Rule extends Lint.Rules.AbstractRule { @@ -135,7 +134,7 @@ export class Rule extends Lint.Rules.AbstractRule { type Transform = (x: string) => string; const TRANSFORMS = new Map([ ["any", () => ""], - ["case-insensitive", x => x.toLowerCase()], + ["case-insensitive", x => x.toUpperCase()], ["lowercase-first", flipCase], ["lowercase-last", x => x], ["full", x => x], diff --git a/test/rules/ordered-imports/case-insensitive/test.ts.fix b/test/rules/ordered-imports/case-insensitive/test.ts.fix index fe75ec2d0f2..2bbfa13056a 100644 --- a/test/rules/ordered-imports/case-insensitive/test.ts.fix +++ b/test/rules/ordered-imports/case-insensitive/test.ts.fix @@ -6,6 +6,10 @@ import {A, B} from 'foo'; // failure import {A, bz, C} from 'foo'; // failure import {A, b, C} from 'zfoo'; +// Underscores come last. +import {A, C, _b} from 'zfoo'; // failure +import {A, C, _b} from 'zfoo'; + import {g} from "y"; // failure import { a as d, diff --git a/test/rules/ordered-imports/case-insensitive/test.ts.lint b/test/rules/ordered-imports/case-insensitive/test.ts.lint index 441d926d90d..b2f83c9ccb1 100644 --- a/test/rules/ordered-imports/case-insensitive/test.ts.lint +++ b/test/rules/ordered-imports/case-insensitive/test.ts.lint @@ -9,6 +9,11 @@ import {bz, A, C} from 'foo'; // failure ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Import sources within a group must be alphabetized.] ~~~~~ [Named imports must be alphabetized.] +// Underscores come last. +import {A, _b, C} from 'zfoo'; // failure + ~~~~~ [Named imports must be alphabetized.] +import {A, C, _b} from 'zfoo'; + import { b as c, ~~~~~~~