Skip to content

Commit

Permalink
update eslint dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
timlrx committed Apr 27, 2024
1 parent d1dc8df commit c93cc03
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 227 deletions.
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@
"devDependencies": {
"@changesets/cli": "2.19.0-temp.0",
"@effect-ts/tracing-plugin": "^0.20.0",
"@types/prettier": "^2.7.3",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"eslint": "^8.43.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"prettier": "^2.8.8",
"ts-patch": "^2.1.0",
"eslint-plugin-simple-import-sort": "^12.1.0",
"prettier": "^3.2.5",
"ts-patch": "^3.1.2",
"typescript": "^5.1.6"
},
"resolutions": {
Expand Down
4 changes: 2 additions & 2 deletions packages/@contentlayer/client/src/guards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ type TypeNameOneOrMany = GetDocumentTypeNamesGen | GetDocumentTypeNamesGen[]
type TypeForTypeNameOneOrMany<N extends TypeNameOneOrMany> = N extends GetDocumentTypeNamesGen
? GetDocumentTypeMapGen<Document>[N]
: N extends GetDocumentTypeNamesGen[]
? GetDocumentTypeMapGen<Document>[N[number]]
: never
? GetDocumentTypeMapGen<Document>[N[number]]
: never

function is<N extends TypeNameOneOrMany>(typeName: N, _: any): _ is TypeForTypeNameOneOrMany<N>
function is<N extends TypeNameOneOrMany>(typeName: N): (_: any) => _ is TypeForTypeNameOneOrMany<N>
Expand Down
16 changes: 8 additions & 8 deletions packages/@contentlayer/core/src/_ArtifactsDir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ import { getCwd } from './cwd.js'
export const getDirPath = ({ cwd }: { cwd: AbsolutePosixFilePath }): AbsolutePosixFilePath =>
filePathJoin(cwd, '.contentlayer' as AbsolutePosixFilePath)

export const mkdir: T.Effect<OT.HasTracer & HasCwd & fs.HasFs, fs.MkdirError, AbsolutePosixFilePath> = T.gen(function* (
$,
) {
const cwd = yield* $(getCwd)
const dirPath = getDirPath({ cwd })
export const mkdir: T.Effect<OT.HasTracer & HasCwd & fs.HasFs, fs.MkdirError, AbsolutePosixFilePath> = T.gen(
function* ($) {
const cwd = yield* $(getCwd)
const dirPath = getDirPath({ cwd })

yield* $(fs.mkdirp(dirPath))
yield* $(fs.mkdirp(dirPath))

return dirPath
})
return dirPath
},
)

export const getCacheDirPath: T.Effect<
OT.HasTracer & HasCwd & fs.HasFs,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'vitest/config'
import path from 'path'
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
Expand Down
2 changes: 1 addition & 1 deletion packages/@contentlayer/source-files/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'vitest/config'
import path from 'path'
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
Expand Down
25 changes: 20 additions & 5 deletions packages/@contentlayer/utils/src/node/fs-watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,46 @@ import { unknownFilePath } from '../file-paths.js'
export class FileAdded {
readonly _tag = 'FileAdded'

constructor(public path: UnknownFilePath, public stats: O.Option<fs.Stats>) {}
constructor(
public path: UnknownFilePath,
public stats: O.Option<fs.Stats>,
) {}
}

export class FileRemoved {
readonly _tag = 'FileRemoved'

constructor(public path: UnknownFilePath, public stats: O.Option<fs.Stats>) {}
constructor(
public path: UnknownFilePath,
public stats: O.Option<fs.Stats>,
) {}
}

export class FileChanged {
readonly _tag = 'FileChanged'

constructor(public path: UnknownFilePath, public stats: O.Option<fs.Stats>) {}
constructor(
public path: UnknownFilePath,
public stats: O.Option<fs.Stats>,
) {}
}

export class DirectoryAdded {
readonly _tag = 'DirectoryAdded'

constructor(public path: UnknownFilePath, public stats: O.Option<fs.Stats>) {}
constructor(
public path: UnknownFilePath,
public stats: O.Option<fs.Stats>,
) {}
}

export class DirectoryRemoved {
readonly _tag = 'DirectoryRemoved'

constructor(public path: UnknownFilePath, public stats: O.Option<fs.Stats>) {}
constructor(
public path: UnknownFilePath,
public stats: O.Option<fs.Stats>,
) {}
}

export type FileSystemEvent = FileAdded | FileRemoved | FileChanged | DirectoryAdded | DirectoryRemoved
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'vitest/config'
import path from 'path'
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ test('mdx - resolveCwd - contentDirPath', async () => {
documentTypes: [Post],
mdx: {
resolveCwd: 'contentDirPath',
// @ts-ignore - remarkMdxImages has not been updated to the new unified js types
remarkPlugins: [remarkMdxImages],
esbuildOptions: (options) => {
options.platform = 'node'
Expand Down Expand Up @@ -78,7 +77,6 @@ test('mdx - resolveCwd - relative', async () => {
documentTypes: [Post],
mdx: {
resolveCwd: 'relative',
// @ts-ignore - remarkMdxImages has not been updated to the new unified js types
remarkPlugins: [remarkMdxImages],
esbuildOptions: (options) => {
options.platform = 'node'
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'vitest/config'
import path from 'path'
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
Expand Down
Loading

0 comments on commit c93cc03

Please sign in to comment.