Skip to content

Commit

Permalink
Fixed some lint issues 😍
Browse files Browse the repository at this point in the history
  • Loading branch information
01taylop committed Aug 2, 2024
1 parent 7e5a50a commit 913d9fa
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
20 changes: 10 additions & 10 deletions src/__tests__/filePatterns.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

Expand All @@ -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)
})

Expand All @@ -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)
})

Expand All @@ -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)
})

Expand All @@ -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)
})

Expand All @@ -78,7 +78,7 @@ describe('filePatterns', () => {
'**/*.+(map|min).*',
]

expect(filePatterns.ignorePatterns).toEqual(expectedPatterns)
expect(filePatterns.ignorePatterns).toStrictEqual(expectedPatterns)
expect(colourLog.config).toHaveBeenCalledWith('Ignore', expectedPatterns)
})

Expand All @@ -92,7 +92,7 @@ describe('filePatterns', () => {
'**/*.+(map|min).*',
]

expect(filePatterns.ignorePatterns).toEqual(expectedPatterns)
expect(filePatterns.ignorePatterns).toStrictEqual(expectedPatterns)
expect(colourLog.config).toHaveBeenCalledWith('Ignore', expectedPatterns)
})

Expand All @@ -106,7 +106,7 @@ describe('filePatterns', () => {
'**/*.+(map|min).*',
]

expect(filePatterns.ignorePatterns).toEqual(expectedPatterns)
expect(filePatterns.ignorePatterns).toStrictEqual(expectedPatterns)
expect(colourLog.config).toHaveBeenCalledWith('Ignore', expectedPatterns)
})

Expand All @@ -121,7 +121,7 @@ describe('filePatterns', () => {
'foo',
]

expect(filePatterns.ignorePatterns).toEqual(expectedPatterns)
expect(filePatterns.ignorePatterns).toStrictEqual(expectedPatterns)
expect(colourLog.config).toHaveBeenCalledWith('Ignore', expectedPatterns)
})

Expand All @@ -137,7 +137,7 @@ describe('filePatterns', () => {
'foo',
]

expect(filePatterns.ignorePatterns).toEqual(expectedPatterns)
expect(filePatterns.ignorePatterns).toStrictEqual(expectedPatterns)
expect(colourLog.config).toHaveBeenCalledWith('Ignore', expectedPatterns)
})

Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/sourceFiles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:', [])
})

Expand All @@ -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)
})

Expand All @@ -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)
})

Expand Down
2 changes: 1 addition & 1 deletion src/linters/markdownlint/__tests__/loadConfig.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from 'fs'
import fs from 'node:fs'

import markdownlint from 'markdownlint'

Expand Down
8 changes: 4 additions & 4 deletions src/utils/__tests__/cache.spec.ts
Original file line number Diff line number Diff line change
@@ -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(),
}))
Expand Down Expand Up @@ -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`)
})

})

0 comments on commit 913d9fa

Please sign in to comment.