Skip to content

Commit

Permalink
build: use module resolution nodenext
Browse files Browse the repository at this point in the history
  • Loading branch information
borisdiakur committed Mar 8, 2024
1 parent add518e commit acc6522
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
access,
constants,
} from 'fs/promises'
import memoizeFs, { getCacheFilePath, type MemoizerOptions } from './index'
import memoizeFs, { getCacheFilePath, type MemoizerOptions } from './index.js'
import * as path from 'path'
import serialize from 'serialize-javascript'

Expand Down Expand Up @@ -295,7 +295,7 @@ describe('memoize-fs', () => {

const memFn = await memoize.fn(
() =>
new Promise(function (resolve, reject) {
new Promise(function (_, reject) {
setTimeout(function () {
reject(Error('qux'))
}, 10)
Expand Down Expand Up @@ -631,7 +631,7 @@ describe('memoize-fs', () => {
}
const memFn = await memoize.fn(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function (a: unknown, b: unknown, circ: Circ) {
function (a: unknown, b: unknown) {
return {
a: a,
b: b,
Expand All @@ -646,7 +646,7 @@ describe('memoize-fs', () => {
},
{ cacheId: 'foobar' }
)
let result = await memFn(1, 2, new Circ())
let result = await memFn(1, 2)

assert.ok(Circ.prototype.isPrototypeOf(result.circ)) // eslint-disable-line no-prototype-builtins
assert.strictEqual(result.circ.abc, 'Hello')
Expand All @@ -666,7 +666,7 @@ describe('memoize-fs', () => {
},
} as never)
c = 999
result = await memFn(1, 2, new Circ())
result = await memFn(1, 2)

assert.deepStrictEqual(result, {
a: 1,
Expand Down Expand Up @@ -722,7 +722,7 @@ describe('memoize-fs', () => {
let d = 3
const memFn = await memoize.fn(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function (a: number, b: number, c: () => boolean) {
function (a: number, b: number, _: () => boolean) {
return a + b + d
},
{ cacheId: 'foobar' }
Expand Down Expand Up @@ -751,7 +751,7 @@ describe('memoize-fs', () => {
let d = 3
const memFn = await memoize.fn(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function (a: number, b: number, c?: { [key: string]: () => boolean }) {
function (a: number, b: number, _?: { [key: string]: () => boolean }) {
return a + b + d
},
{ cacheId: 'foobar' }
Expand Down Expand Up @@ -813,7 +813,7 @@ describe('memoize-fs', () => {
{ cacheId: 'foobar' }
)

await memFn(function (err) {
await memFn(function (err: Error) {
console.error(err)
})
const files = await readdir(path.join(cachePath, 'foobar'))
Expand Down Expand Up @@ -878,15 +878,15 @@ describe('memoize-fs', () => {
},
{ cacheId: 'foobar' }
)
await memFn(true, true, function (err) {
await memFn(true, true, function (err: Error | null) {
if (err) {
d = err
}
})
assert.ifError(d)
d = undefined
c = false
await memFn(true, true, function (err) {
await memFn(true, true, function (err: Error | null) {
if (err) {
d = err
}
Expand All @@ -913,15 +913,15 @@ describe('memoize-fs', () => {
},
{ cacheId: 'foobar' }
)
await memFn(function (err) {
await memFn(function (err: Error | null) {
if (err) {
d = err
}
})
assert.ifError(d)
d = undefined
c = false
await memFn(function (err) {
await memFn(function (err: Error | null) {
if (err) {
d = err
}
Expand All @@ -941,7 +941,7 @@ describe('memoize-fs', () => {
let n = 0
const memFn = await memoize.fn(function (
// eslint-disable-next-line @typescript-eslint/no-unused-vars
cb: (err: Error | null) => void
_: (err: Error | null) => void
) {
return n++
})
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ES2022",
"moduleResolution": "Node",
"module": "nodenext",
"moduleResolution": "nodenext",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
Expand Down

0 comments on commit acc6522

Please sign in to comment.