Skip to content

Commit 006f41a

Browse files
author
Andrii Kirmas
committed
Fix enforcing import type errors
1 parent 206b407 commit 006f41a

File tree

9 files changed

+33
-13
lines changed

9 files changed

+33
-13
lines changed

__sandbox__/atom.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Cut, Strip, UnionToIntersection } from "../src/ts-swiss.types"
1+
import type { Cut, Strip, UnionToIntersection } from "../src/ts-swiss.types"
22

33
it("stripper", () => {
44
type C1 = `${"visible-print"}-${"inline"|"block"|"inline-block"}`|`col${""|"-y"|"-x"}`|"display"

__sandbox__/bem.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Ever0, Extends, PartDeep } from "../src/ts-swiss.types"
2-
import { CssModule } from "../src/definitions.types"
2+
import type { CssModule } from "../src/definitions.types"
33

44
it("tree2classes", () => {
55

__sandbox__/double-shape.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Falsy } from "../src/ts-swiss.types"
2-
import { ClassHash } from "../src/main.types"
1+
import type { Falsy } from "../src/ts-swiss.types"
2+
import type { ClassHash } from "../src/main.types"
33

44
type ClassNamesDirect<K extends string = string> = Record<K, ClassHash>
55
// type ClassNamesToggle<K extends string = string> = Record<K, boolean>

__tests__/readme.spec.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react"
22
import expectRender from "../expect-to-same-render"
3-
import classNaming, { classBeming, ClassNamed, Undefineds } from "../src"
3+
import classNaming, { classBeming } from "../src"
4+
import type { ClassNamed, Undefineds } from "../src"
45
import type {ClassHash, ClassNamesProperty} from "../src"
56
// import css_module from "./button.module.css"
67
const css_module = {button: "BTN"}

__tests__/versus-classnames.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import classnames_default from "classnames"
55
import classnames_bind from "classnames/bind"
66

77
import css from "./some.css"
8-
import module from "./some.module.css"
8+
import type module from "./some.module.css"
99

1010
const module_css: typeof module = {
1111
"class1": "hash1",

src/bem.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { classBeming, setOptions } from "./bem";
2-
import { ClassHash } from "./definitions.types";
3-
import { ClassNamed, ClassNamesProperty } from "./main.types";
2+
import type { ClassHash } from "./definitions.types";
3+
import type { ClassNamed, ClassNamesProperty } from "./main.types";
44

55
describe("contexting", () => {
66
describe("empty", () => {

src/global.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,24 @@ declare namespace ReactClassNaming {
2424
modDelimiter: "--"
2525
}
2626
}
27+
28+
interface StrToNum {
29+
"0": 0
30+
"1": 1
31+
"2": 2
32+
"3": 3
33+
"4": 4
34+
"5": 5
35+
"6": 6
36+
"7": 7
37+
"8": 8
38+
"9": 9
39+
"10": 10
40+
"11": 11
41+
"12": 12
42+
"25": 25
43+
"50": 50
44+
"75": 75
45+
"100": 100
46+
}
2747
}

src/map.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import {
1+
import type {
22
CssModule,
33
} from "./definitions.types";
44
import type {
55
ClassNamesMapping, ClassNamesMap,
66
} from "./naming.types";
77
import {resolver} from "./core"
8-
import { AnyObject, OmitIndexed } from "./ts-swiss.types";
9-
import { GetProps } from "./react-swiss.types";
10-
8+
import type { AnyObject, OmitIndexed } from "./ts-swiss.types";
9+
import type { GetProps } from "./react-swiss.types"
1110
const {keys: $keys} = Object
1211

1312
export {

src/react-swiss.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type {
88
import type {
99
ReactRelated,
1010
} from "./definitions.types"
11-
import {
11+
import type {
1212
GetProps
1313
} from "./react-swiss.types"
1414

0 commit comments

Comments
 (0)