Skip to content

Commit

Permalink
Revert "Add explicit file extensions to relative import paths"
Browse files Browse the repository at this point in the history
This reverts commit 3bfe041.
  • Loading branch information
MajorLift committed May 23, 2024
1 parent 6c4e6cd commit 220fe62
Show file tree
Hide file tree
Showing 232 changed files with 278 additions and 316 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ module.exports = {
{
files: ['*.ts'],
extends: ['@metamask/eslint-config-typescript'],
rules: {
'import/no-useless-path-segments': ['error', { noUselessIndex: false }],
}
},

{
Expand Down
2 changes: 1 addition & 1 deletion test/api/assert.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { throws, doesNotThrow } from 'assert';
import { describe, it } from 'vitest';

import { assert, string, StructError } from '../../src/index.js';
import { assert, string, StructError } from '../../src';

describe('assert', () => {
it('valid as helper', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/api/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
defaulted,
literal,
coerce,
} from '../../src/index.js';
} from '../../src';

describe('create', () => {
it('missing as helper', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/api/is.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { strictEqual } from 'assert';
import { describe, it } from 'vitest';

import { is, string } from '../../src/index.js';
import { is, string } from '../../src';

describe('is', () => {
it('valid as helper', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/api/mask.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
StructError,
array,
type,
} from '../../src/index.js';
} from '../../src';

describe('mask', () => {
it('object as helper', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/api/validate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
refine,
object,
any,
} from '../../src/index.js';
} from '../../src';

describe('validate', () => {
it('valid as helper', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
create as createValue,
deprecated,
StructError,
} from '../src/index.js';
} from '../src';

describe('superstruct', () => {
describe('validation', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/typings/any.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, any } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, any } from '../../src';
import { test } from '../index.test';

test<any>((value) => {
assert(value, any());
Expand Down
4 changes: 2 additions & 2 deletions test/typings/array.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, array, number } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, array, number } from '../../src';
import { test } from '../index.test';

test<unknown[]>((value) => {
assert(value, array());
Expand Down
4 changes: 2 additions & 2 deletions test/typings/assign.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, assign, object, number, string } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, assign, object, number, string } from '../../src';
import { test } from '../index.test';

test<{
a: number;
Expand Down
4 changes: 2 additions & 2 deletions test/typings/bigint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, bigint } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, bigint } from '../../src';
import { test } from '../index.test';

test<bigint>((value) => {
assert(value, bigint());
Expand Down
4 changes: 2 additions & 2 deletions test/typings/boolean.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, boolean } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, boolean } from '../../src';
import { test } from '../index.test';

test<boolean>((value) => {
assert(value, boolean());
Expand Down
4 changes: 2 additions & 2 deletions test/typings/coerce.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, coerce, string, number } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, coerce, string, number } from '../../src';
import { test } from '../index.test';

test<number>((value) => {
assert(
Expand Down
4 changes: 2 additions & 2 deletions test/typings/date.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, date } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, date } from '../../src';
import { test } from '../index.test';

test<Date>((value) => {
assert(value, date());
Expand Down
4 changes: 2 additions & 2 deletions test/typings/defaulted.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, defaulted, string } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, defaulted, string } from '../../src';
import { test } from '../index.test';

test<string>((value) => {
assert(value, defaulted(string(), 'Untitled'));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/deprecated.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, object, deprecated, any } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, object, deprecated, any } from '../../src';
import { test } from '../index.test';

test<unknown>((value) => {
const log = () => {
Expand Down
6 changes: 3 additions & 3 deletions test/typings/describe.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Describe } from '../../src/index.js';
import type { Describe } from '../../src';
import {
any,
object,
Expand Down Expand Up @@ -27,8 +27,8 @@ import {
max,
min,
pattern,
} from '../../src/index.js';
import { test } from '../index.test.js';
} from '../../src';
import { test } from '../index.test';

test<Describe<any>>(() => {
return any();
Expand Down
4 changes: 2 additions & 2 deletions test/typings/dynamic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, dynamic, string } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, dynamic, string } from '../../src';
import { test } from '../index.test';

test<string>((value) => {
assert(
Expand Down
4 changes: 2 additions & 2 deletions test/typings/empty.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, empty, string, array, map, set } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, empty, string, array, map, set } from '../../src';
import { test } from '../index.test';

test<string>((value) => {
assert(value, empty(string()));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/enums.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, enums } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, enums } from '../../src';
import { test } from '../index.test';

test<'a' | 'b' | 'c'>((value) => {
assert(value, enums(['a', 'b', 'c']));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/func.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, func } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, func } from '../../src';
import { test } from '../index.test';

// eslint-disable-next-line @typescript-eslint/ban-types
test<Function>((value) => {
Expand Down
6 changes: 3 additions & 3 deletions test/typings/infer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Infer } from '../../src/index.js';
import { object, assert } from '../../src/index.js';
import { test } from '../index.test.js';
import type { Infer } from '../../src';
import { object, assert } from '../../src';
import { test } from '../index.test';

const Struct = object();
type T = Infer<typeof Struct>;
Expand Down
4 changes: 2 additions & 2 deletions test/typings/instance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, instance } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, instance } from '../../src';
import { test } from '../index.test';

test<Date>((value) => {
assert(value, instance(Date));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/integer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, integer } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, integer } from '../../src';
import { test } from '../index.test';

test<number>((value) => {
assert(value, integer());
Expand Down
4 changes: 2 additions & 2 deletions test/typings/intersection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, intersection, object, string } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, intersection, object, string } from '../../src';
import { test } from '../index.test';

test<{ a: string; b: string }>((value) => {
assert(
Expand Down
4 changes: 2 additions & 2 deletions test/typings/lazy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, lazy, string } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, lazy, string } from '../../src';
import { test } from '../index.test';

test<string>((value) => {
assert(
Expand Down
4 changes: 2 additions & 2 deletions test/typings/literal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, literal } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, literal } from '../../src';
import { test } from '../index.test';

test<true>((value) => {
assert(value, literal(true));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/map.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, map, string, number } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, map, string, number } from '../../src';
import { test } from '../index.test';

test<Map<string, number>>((value) => {
assert(value, map(string(), number()));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/max.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, number, max } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, number, max } from '../../src';
import { test } from '../index.test';

test<number>((value) => {
assert(value, max(number(), 0));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/min.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, number, min } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, number, min } from '../../src';
import { test } from '../index.test';

test<number>((value) => {
assert(value, min(number(), 0));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/never.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, never } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, never } from '../../src';
import { test } from '../index.test';

test<never>((value) => {
assert(value, never());
Expand Down
4 changes: 2 additions & 2 deletions test/typings/nonempty.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, nonempty, string, array, map, set } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, nonempty, string, array, map, set } from '../../src';
import { test } from '../index.test';

test<string>((value) => {
assert(value, nonempty(string()));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/nullable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, nullable, string, object, enums } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, nullable, string, object, enums } from '../../src';
import { test } from '../index.test';

test<string | null>((value) => {
assert(value, nullable(string()));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/number.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, number } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, number } from '../../src';
import { test } from '../index.test';

test<number>((value) => {
assert(value, number());
Expand Down
4 changes: 2 additions & 2 deletions test/typings/object.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, object, number, string } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, object, number, string } from '../../src';
import { test } from '../index.test';

test<Record<string, unknown>>((value) => {
assert(value, object());
Expand Down
4 changes: 2 additions & 2 deletions test/typings/omit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, omit, object, number, string, type } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, omit, object, number, string, type } from '../../src';
import { test } from '../index.test';

test<{
b: string;
Expand Down
11 changes: 2 additions & 9 deletions test/typings/optional.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import {
assert,
optional,
string,
number,
object,
enums,
} from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, optional, string, number, object, enums } from '../../src';
import { test } from '../index.test';

test<string | undefined>((value) => {
assert(value, optional(string()));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/partial.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, object, number } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, object, number } from '../../src';
import { test } from '../index.test';

test<{ a?: number }>((value) => {
assert(value, object({ a: number() }));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/pattern.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, pattern, string } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, pattern, string } from '../../src';
import { test } from '../index.test';

test<string>((value) => {
assert(value, pattern(string(), /.*/u));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/pick.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, pick, object, number, string } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, pick, object, number, string } from '../../src';
import { test } from '../index.test';

test<{
b: string;
Expand Down
4 changes: 2 additions & 2 deletions test/typings/record.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, record, string, number } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, record, string, number } from '../../src';
import { test } from '../index.test';

test<Record<string, number>>((value) => {
assert(value, record(string(), number()));
Expand Down
4 changes: 2 additions & 2 deletions test/typings/refine.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, refine, string } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, refine, string } from '../../src';
import { test } from '../index.test';

test<string>((value) => {
assert(
Expand Down
4 changes: 2 additions & 2 deletions test/typings/regexp.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, regexp } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, regexp } from '../../src';
import { test } from '../index.test';

test<RegExp>((value) => {
assert(value, regexp());
Expand Down
4 changes: 2 additions & 2 deletions test/typings/set.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, set, string } from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, set, string } from '../../src';
import { test } from '../index.test';

test<Set<string>>((value) => {
assert(value, set(string()));
Expand Down
12 changes: 2 additions & 10 deletions test/typings/size.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import {
assert,
size,
string,
array,
number,
map,
set,
} from '../../src/index.js';
import { test } from '../index.test.js';
import { assert, size, string, array, number, map, set } from '../../src';
import { test } from '../index.test';

test<number>((value) => {
assert(value, size(number(), 1, 5));
Expand Down
Loading

0 comments on commit 220fe62

Please sign in to comment.