diff --git a/.eslintrc b/.eslintrc index 85e957da..16f5f9f7 100644 --- a/.eslintrc +++ b/.eslintrc @@ -20,7 +20,12 @@ "node": true }, "settings": { - "import/extensions": [".js", ".ts"] + "import/extensions": [".js", ".ts"], + "import/resolver": { + "typescript": { + "project": ["./tsconfig.json"] + } + } }, "rules": { "@typescript-eslint/no-unused-vars": [ diff --git a/src/index.ts b/src/index.ts index de84ece0..53baf221 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ -export * from './error' -export * from './struct' -export * from './structs/coercions' -export * from './structs/refinements' -export * from './structs/types' -export * from './structs/utilities' +export * from './error.js' +export * from './struct.js' +export * from './structs/coercions.js' +export * from './structs/refinements.js' +export * from './structs/types.js' +export * from './structs/utilities.js' diff --git a/src/struct.ts b/src/struct.ts index b482fd3b..9a5c37ec 100644 --- a/src/struct.ts +++ b/src/struct.ts @@ -1,5 +1,5 @@ -import { toFailures, shiftIterator, StructSchema, run } from './utils' -import { StructError, Failure } from './error' +import { toFailures, shiftIterator, StructSchema, run } from './utils.js' +import { StructError, Failure } from './error.js' /** * `Struct` objects encapsulate the validation logic for a specific type of diff --git a/src/structs/coercions.ts b/src/structs/coercions.ts index 6dca4ece..62566c50 100644 --- a/src/structs/coercions.ts +++ b/src/structs/coercions.ts @@ -1,6 +1,6 @@ -import { Struct, is, Coercer } from '../struct' -import { isPlainObject } from '../utils' -import { string, unknown } from './types' +import { Struct, is, Coercer } from '../struct.js' +import { isPlainObject } from '../utils.js' +import { string, unknown } from './types.js' /** * Augment a `Struct` to add an additional coercion step to its input. diff --git a/src/structs/refinements.ts b/src/structs/refinements.ts index e3f7736d..276bc925 100644 --- a/src/structs/refinements.ts +++ b/src/structs/refinements.ts @@ -1,5 +1,5 @@ -import { Struct, Refiner } from '../struct' -import { toFailures } from '../utils' +import { Struct, Refiner } from '../struct.js' +import { toFailures } from '../utils.js' /** * Ensure that a string, array, map, or set is empty. diff --git a/src/structs/types.ts b/src/structs/types.ts index 8bcc0ef3..19493104 100644 --- a/src/structs/types.ts +++ b/src/structs/types.ts @@ -1,5 +1,5 @@ -import { Infer, Struct } from '../struct' -import { define } from './utilities' +import { Infer, Struct } from '../struct.js' +import { define } from './utilities.js' import { ObjectSchema, ObjectType, @@ -9,7 +9,7 @@ import { AnyStruct, InferStructTuple, UnionToIntersection, -} from '../utils' +} from '../utils.js' /** * Ensure that any value passes validation. diff --git a/src/structs/utilities.ts b/src/structs/utilities.ts index d2162a3d..18b60e76 100644 --- a/src/structs/utilities.ts +++ b/src/structs/utilities.ts @@ -1,6 +1,6 @@ -import { Context, Struct, Validator } from '../struct' -import { Assign, ObjectSchema, ObjectType, PartialObjectSchema } from '../utils' -import { object, optional, type } from './types' +import { Context, Struct, Validator } from '../struct.js' +import { Assign, ObjectSchema, ObjectType, PartialObjectSchema } from '../utils.js' +import { object, optional, type } from './types.js' /** * Create a new struct that combines the properties properties from multiple diff --git a/src/utils.ts b/src/utils.ts index 92df9755..0928871a 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,5 @@ -import { Struct, Infer, Result, Context, Describe } from './struct' -import { Failure } from './error' +import { Struct, Infer, Result, Context, Describe } from './struct.js' +import { Failure } from './error.js' /** * Check if a value is an iterator.