diff --git a/rollup.config.js b/rollup.config.js index 1c2a419..da430aa 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,5 @@ -import { readFileSync } from 'fs' -import { resolve } from 'path' +import { readFileSync } from 'node:fs' +import { resolve } from 'node:path' import { nodeResolve } from '@rollup/plugin-node-resolve' import replace from '@rollup/plugin-replace' diff --git a/src/__tests__/filePatterns.spec.ts b/src/__tests__/filePatterns.spec.ts index 5243414..50c950c 100644 --- a/src/__tests__/filePatterns.spec.ts +++ b/src/__tests__/filePatterns.spec.ts @@ -15,7 +15,7 @@ describe('filePatterns', () => { '**/*.{cjs,js,jsx,mjs,ts,tsx}', ] - expect(filePatterns.includePatterns[Linter.ESLint]).toEqual(expectedPatterns) + expect(filePatterns.includePatterns[Linter.ESLint]).toStrictEqual(expectedPatterns) expect(colourLog.config).toHaveBeenCalledWith('ESLint Patterns', expectedPatterns) }) @@ -29,7 +29,7 @@ describe('filePatterns', () => { 'foo', ] - expect(filePatterns.includePatterns[Linter.ESLint]).toEqual(expectedPatterns) + expect(filePatterns.includePatterns[Linter.ESLint]).toStrictEqual(expectedPatterns) expect(colourLog.config).toHaveBeenCalledWith('ESLint Patterns', expectedPatterns) }) @@ -44,7 +44,7 @@ describe('filePatterns', () => { 'bar', ] - expect(filePatterns.includePatterns[Linter.ESLint]).toEqual(expectedPatterns) + expect(filePatterns.includePatterns[Linter.ESLint]).toStrictEqual(expectedPatterns) expect(colourLog.config).toHaveBeenCalledWith('ESLint Patterns', expectedPatterns) }) @@ -55,7 +55,7 @@ describe('filePatterns', () => { '**/*.{md,mdx}', ] - expect(filePatterns.includePatterns[Linter.Markdownlint]).toEqual(expectedPatterns) + expect(filePatterns.includePatterns[Linter.Markdownlint]).toStrictEqual(expectedPatterns) expect(colourLog.config).toHaveBeenCalledWith('Markdownlint Patterns', expectedPatterns) }) @@ -66,7 +66,7 @@ describe('filePatterns', () => { '**/*.{css,scss,less,sass,styl,stylus}', ] - expect(filePatterns.includePatterns[Linter.Stylelint]).toEqual(expectedPatterns) + expect(filePatterns.includePatterns[Linter.Stylelint]).toStrictEqual(expectedPatterns) expect(colourLog.config).toHaveBeenCalledWith('Stylelint Patterns', expectedPatterns) }) @@ -78,7 +78,7 @@ describe('filePatterns', () => { '**/*.+(map|min).*', ] - expect(filePatterns.ignorePatterns).toEqual(expectedPatterns) + expect(filePatterns.ignorePatterns).toStrictEqual(expectedPatterns) expect(colourLog.config).toHaveBeenCalledWith('Ignore', expectedPatterns) }) @@ -92,7 +92,7 @@ describe('filePatterns', () => { '**/*.+(map|min).*', ] - expect(filePatterns.ignorePatterns).toEqual(expectedPatterns) + expect(filePatterns.ignorePatterns).toStrictEqual(expectedPatterns) expect(colourLog.config).toHaveBeenCalledWith('Ignore', expectedPatterns) }) @@ -106,7 +106,7 @@ describe('filePatterns', () => { '**/*.+(map|min).*', ] - expect(filePatterns.ignorePatterns).toEqual(expectedPatterns) + expect(filePatterns.ignorePatterns).toStrictEqual(expectedPatterns) expect(colourLog.config).toHaveBeenCalledWith('Ignore', expectedPatterns) }) @@ -121,7 +121,7 @@ describe('filePatterns', () => { 'foo', ] - expect(filePatterns.ignorePatterns).toEqual(expectedPatterns) + expect(filePatterns.ignorePatterns).toStrictEqual(expectedPatterns) expect(colourLog.config).toHaveBeenCalledWith('Ignore', expectedPatterns) }) @@ -137,7 +137,7 @@ describe('filePatterns', () => { 'foo', ] - expect(filePatterns.ignorePatterns).toEqual(expectedPatterns) + expect(filePatterns.ignorePatterns).toStrictEqual(expectedPatterns) expect(colourLog.config).toHaveBeenCalledWith('Ignore', expectedPatterns) }) diff --git a/src/__tests__/sourceFiles.spec.ts b/src/__tests__/sourceFiles.spec.ts index 928a1c7..120e19f 100644 --- a/src/__tests__/sourceFiles.spec.ts +++ b/src/__tests__/sourceFiles.spec.ts @@ -24,7 +24,7 @@ describe('sourceFiles', () => { const files = await sourceFiles(commonArgs) expect(glob).toHaveBeenCalledWith(['*.ts'], { ignore: [ 'node_modules' ] }) - expect(files).toEqual([]) + expect(files).toStrictEqual([]) expect(colourLog.configDebug).toHaveBeenCalledWith('Sourced 0 files matching "*.ts" for ESLint:', []) }) @@ -36,7 +36,7 @@ describe('sourceFiles', () => { const files = await sourceFiles(commonArgs) expect(glob).toHaveBeenCalledWith(['*.ts'], { ignore: [ 'node_modules' ] }) - expect(files).toEqual(mockedFiles) + expect(files).toStrictEqual(mockedFiles) expect(colourLog.configDebug).toHaveBeenCalledWith('Sourced 1 file matching "*.ts" for ESLint:', mockedFiles) }) @@ -48,7 +48,7 @@ describe('sourceFiles', () => { const files = await sourceFiles(commonArgs) expect(glob).toHaveBeenCalledWith(['*.ts'], { ignore: [ 'node_modules' ] }) - expect(files).toEqual(mockedFiles) + expect(files).toStrictEqual(mockedFiles) expect(colourLog.configDebug).toHaveBeenCalledWith('Sourced 2 files matching "*.ts" for ESLint:', mockedFiles) }) diff --git a/src/linters/markdownlint/__tests__/loadConfig.spec.ts b/src/linters/markdownlint/__tests__/loadConfig.spec.ts index d3e9bbb..91fbc65 100644 --- a/src/linters/markdownlint/__tests__/loadConfig.spec.ts +++ b/src/linters/markdownlint/__tests__/loadConfig.spec.ts @@ -1,4 +1,4 @@ -import fs from 'fs' +import fs from 'node:fs' import markdownlint from 'markdownlint' diff --git a/src/utils/__tests__/cache.spec.ts b/src/utils/__tests__/cache.spec.ts index df94ee5..2582a61 100644 --- a/src/utils/__tests__/cache.spec.ts +++ b/src/utils/__tests__/cache.spec.ts @@ -1,11 +1,11 @@ -import fs from 'fs' -import path from 'path' +import fs from 'node:fs' +import path from 'node:path' import colourLog from '@Utils/colourLog' import { clearCacheDirectory, getCacheDirectory } from '../cache' -jest.mock('fs') +jest.mock('node:fs') jest.mock('@Utils/colourLog', () => ({ info: jest.fn(), })) @@ -47,7 +47,7 @@ describe('getCacheDirectory', () => { const result = getCacheDirectory('.eslintcache') expect(path.resolve).toHaveBeenCalledWith(process.cwd(), '.lintpilotcache', '.eslintcache') - expect(result).toEqual(`${process.cwd()}/.lintpilotcache/.eslintcache`) + expect(result).toBe(`${process.cwd()}/.lintpilotcache/.eslintcache`) }) })