Skip to content

Commit

Permalink
Bump typescript-eslint from 8.18.1 to 8.18.2 (#5654)
Browse files Browse the repository at this point in the history
* Bump typescript-eslint from 8.18.1 to 8.18.2

Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.18.1 to 8.18.2.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.18.2/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Remove useless usage of generics

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Chitoku <[email protected]>
  • Loading branch information
dependabot[bot] and chitoku-k authored Dec 28, 2024
1 parent a5ab479 commit ec28e0f
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 102 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"tsconfig-paths-webpack-plugin": "^4.2.0",
"turnstile-types": "^1.2.3",
"typescript": "^5.7.2",
"typescript-eslint": "^8.18.1",
"typescript-eslint": "^8.18.2",
"typescript-plugin-css-modules": "^5.1.0",
"unified": "^11.0.5",
"webpack": "^5.97.1",
Expand Down
10 changes: 5 additions & 5 deletions plugins/historia-taxonomy-plugin/createArticles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ interface PaginatedArticle {
id: string
}

interface Article<TDirectory extends string, TName extends string> {
interface Article {
id: string
prev?: PaginatedArticle
next?: PaginatedArticle
file: File<TDirectory, TName>
file: File
attributes: {
created: string
page: boolean | null
Expand All @@ -32,7 +32,7 @@ export interface ArticleContext extends Context {
interface Data {
categories?: {
items: {
articles: Article<string, string>[]
articles: Article[]
}[]
}
}
Expand Down Expand Up @@ -90,8 +90,8 @@ const createArticles = async ({
file,
} = article

let prev: Article<string, string> | PaginatedArticle | undefined = article.prev
let next: Article<string, string> | PaginatedArticle | undefined = article.next
let prev: Article | PaginatedArticle | undefined = article.prev
let next: Article | PaginatedArticle | undefined = article.next

if (!prev && !next) {
prev = articles[index - 1]
Expand Down
6 changes: 3 additions & 3 deletions plugins/historia-taxonomy-plugin/gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const createResolvers: GatsbyNode['createResolvers'] = ({
path: {
type: 'String!',
resolve(source: Article, _: unknown, context: ResolveContext) {
return getPath(context.nodeModel.getNodeById<File<string, string>>({ id: source.parent }))
return getPath(context.nodeModel.getNodeById<File>({ id: source.parent }))
},
},
prev: {
Expand All @@ -185,7 +185,7 @@ export const createResolvers: GatsbyNode['createResolvers'] = ({
const dirname = path.join('posts', path.dirname(source.frontmatter.prev))
const basename = path.basename(source.frontmatter.prev)

const file = await context.nodeModel.findOne<File<string, string>>({
const file = await context.nodeModel.findOne<File>({
type: 'File',
query: {
filter: {
Expand Down Expand Up @@ -218,7 +218,7 @@ export const createResolvers: GatsbyNode['createResolvers'] = ({
const dirname = path.join('posts', path.dirname(source.frontmatter.next))
const basename = path.basename(source.frontmatter.next)

const file = await context.nodeModel.findOne<File<string, string>>({
const file = await context.nodeModel.findOne<File>({
type: 'File',
query: {
filter: {
Expand Down
44 changes: 9 additions & 35 deletions plugins/historia-taxonomy-plugin/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,14 @@ export interface Paginatable {
}
}

export interface File<TDirectory extends string, TName extends string> {
export interface File {
children: string[]
relativeDirectory: TDirectory
name: TName
relativeDirectory: Directory
name: string
}

type Directory<
TDirectory extends string,
> = TDirectory extends `posts/${infer Subdirectory}`
? `/${Subdirectory}`
: TDirectory extends 'posts'
? '/'
: TDirectory

type Path<
TDirectory extends string,
TName extends string,
TIndex extends string,
> = Directory<TDirectory> extends ''
? ''
: Directory<TDirectory> extends '/'
? `/${TName}`
: Directory<TDirectory> extends string
? string
: TName extends 'index'
? `${Directory<TDirectory>}${TIndex}`
: `${Directory<TDirectory>}/${TName}`
type Directory = string
type Path = string

export const splitPages = <T>(items: T[], limit: number): T[][] => {
const pages: T[][] = []
Expand All @@ -46,20 +27,13 @@ export const splitPages = <T>(items: T[], limit: number): T[][] => {
return pages
}

const getDirectory = <
TDirectory extends string,
TName extends string,
>(file: File<TDirectory, TName>): Directory<TDirectory> => file.relativeDirectory.replace(/^posts(?:\/|$)/u, '/') as Directory<TDirectory>
const getDirectory = (file: File): Directory => file.relativeDirectory.replace(/^posts(?:\/|$)/u, '/')

export const getPath = <
TDirectory extends string,
TName extends string,
TIndex extends string,
>(file: File<TDirectory, TName>, index: TIndex = '/' as TIndex): Path<TDirectory, TName, TIndex> => {
export const getPath = (file: File, index = '/'): Path => {
const directory = getDirectory(file)
if (!directory) {
return '' as Path<TDirectory, TName, TIndex>
return ''
}

return path.join(directory, file.name === 'index' ? index : file.name) as Path<TDirectory, TName, TIndex>
return path.join(directory, file.name === 'index' ? index : file.name)
}
116 changes: 58 additions & 58 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4929,15 +4929,15 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/eslint-plugin@npm:8.18.1":
version: 8.18.1
resolution: "@typescript-eslint/eslint-plugin@npm:8.18.1"
"@typescript-eslint/eslint-plugin@npm:8.18.2":
version: 8.18.2
resolution: "@typescript-eslint/eslint-plugin@npm:8.18.2"
dependencies:
"@eslint-community/regexpp": "npm:^4.10.0"
"@typescript-eslint/scope-manager": "npm:8.18.1"
"@typescript-eslint/type-utils": "npm:8.18.1"
"@typescript-eslint/utils": "npm:8.18.1"
"@typescript-eslint/visitor-keys": "npm:8.18.1"
"@typescript-eslint/scope-manager": "npm:8.18.2"
"@typescript-eslint/type-utils": "npm:8.18.2"
"@typescript-eslint/utils": "npm:8.18.2"
"@typescript-eslint/visitor-keys": "npm:8.18.2"
graphemer: "npm:^1.4.0"
ignore: "npm:^5.3.1"
natural-compare: "npm:^1.4.0"
Expand All @@ -4946,7 +4946,7 @@ __metadata:
"@typescript-eslint/parser": ^8.0.0 || ^8.0.0-alpha.0
eslint: ^8.57.0 || ^9.0.0
typescript: ">=4.8.4 <5.8.0"
checksum: 10/ec061a9c64477260d1ef0fc6283d8754838181e17aa90b3b8b9a70936a2ca4bae11607070917a7701e13f5301ced2b6da4b4b6e5cf525c484f97481e540b5111
checksum: 10/717eecbc17ab80d0cb536f0095b0d5547c9e20d9d750118623d0a96c4a5ea3c6f449d03433c426ec43096979c6cfbe0d6a3cfdc369aae86ac0eb6763756407cc
languageName: node
linkType: hard

Expand Down Expand Up @@ -4974,19 +4974,19 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/parser@npm:8.18.1":
version: 8.18.1
resolution: "@typescript-eslint/parser@npm:8.18.1"
"@typescript-eslint/parser@npm:8.18.2":
version: 8.18.2
resolution: "@typescript-eslint/parser@npm:8.18.2"
dependencies:
"@typescript-eslint/scope-manager": "npm:8.18.1"
"@typescript-eslint/types": "npm:8.18.1"
"@typescript-eslint/typescript-estree": "npm:8.18.1"
"@typescript-eslint/visitor-keys": "npm:8.18.1"
"@typescript-eslint/scope-manager": "npm:8.18.2"
"@typescript-eslint/types": "npm:8.18.2"
"@typescript-eslint/typescript-estree": "npm:8.18.2"
"@typescript-eslint/visitor-keys": "npm:8.18.2"
debug: "npm:^4.3.4"
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: ">=4.8.4 <5.8.0"
checksum: 10/09a601ef8b837962e5bb2687358520f337f9d0bbac5c6d5e159654faa5caaffb24d990e8d6bc4dc51ff5008dd9e182315c35bc5e9e3789090ccef8b8040e7659
checksum: 10/e8d7364fe0ec5d29186cc046b077b49de527d30b9e4dbc49c14685dbe4e7e902553eefe37efc5eb74685b5998d35beb255143b66e00f25acd19ac0590f7ecea3
languageName: node
linkType: hard

Expand Down Expand Up @@ -5027,13 +5027,13 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/scope-manager@npm:8.18.1":
version: 8.18.1
resolution: "@typescript-eslint/scope-manager@npm:8.18.1"
"@typescript-eslint/scope-manager@npm:8.18.2":
version: 8.18.2
resolution: "@typescript-eslint/scope-manager@npm:8.18.2"
dependencies:
"@typescript-eslint/types": "npm:8.18.1"
"@typescript-eslint/visitor-keys": "npm:8.18.1"
checksum: 10/14f7c09924c3a006b20752e5204b33c2b6974fc00bea16c23f471e65f2fb089fcbd3fb5296bcfd6727ac95c32ba24ebb15ba84fbf1deadc17b4cc5ca7f41c72a
"@typescript-eslint/types": "npm:8.18.2"
"@typescript-eslint/visitor-keys": "npm:8.18.2"
checksum: 10/073ebc22888b7ca21fed70feb84d8fa2fe4b0d039035179052875b055b62165cc2e8aadf079c17931b7f24d021ff7ee4e204559540e0c1fbe49b8950a4143102
languageName: node
linkType: hard

Expand All @@ -5054,18 +5054,18 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/type-utils@npm:8.18.1":
version: 8.18.1
resolution: "@typescript-eslint/type-utils@npm:8.18.1"
"@typescript-eslint/type-utils@npm:8.18.2":
version: 8.18.2
resolution: "@typescript-eslint/type-utils@npm:8.18.2"
dependencies:
"@typescript-eslint/typescript-estree": "npm:8.18.1"
"@typescript-eslint/utils": "npm:8.18.1"
"@typescript-eslint/typescript-estree": "npm:8.18.2"
"@typescript-eslint/utils": "npm:8.18.2"
debug: "npm:^4.3.4"
ts-api-utils: "npm:^1.3.0"
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: ">=4.8.4 <5.8.0"
checksum: 10/cde53d05f4ca6e172239918cba2b560b9f837aa1fc7d5220784b1a6af9c8c525db020a5160822087e320305492fe359b7fb191420789b5f1e47a01e0cda21ac9
checksum: 10/56a67b50557c589bb3c1f8e9bbea5cb8edca9cf2a642e2d46b614a6b2cf4d4518d00b8b869a58d2e059b256088ec673232d5f2d62d53733d818336d50175f1df
languageName: node
linkType: hard

Expand All @@ -5083,10 +5083,10 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/types@npm:8.18.1":
version: 8.18.1
resolution: "@typescript-eslint/types@npm:8.18.1"
checksum: 10/57a6141ba17be929291a644991f3a76f94fce330376f6a079decb20fb53378d636ad6878f8f9b6fcb8244cf1ca8b118f9e8901ae04cf3de2aa9f9ff57791d97a
"@typescript-eslint/types@npm:8.18.2":
version: 8.18.2
resolution: "@typescript-eslint/types@npm:8.18.2"
checksum: 10/adc011ff310344f1aa8ee8041c4524107c40547141b9dd83ea0d551ccc60f5e18c7700ac1376d706f42ac597670f61993e1074696aa20d68c8a05506776f5184
languageName: node
linkType: hard

Expand Down Expand Up @@ -5127,12 +5127,12 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/typescript-estree@npm:8.18.1":
version: 8.18.1
resolution: "@typescript-eslint/typescript-estree@npm:8.18.1"
"@typescript-eslint/typescript-estree@npm:8.18.2":
version: 8.18.2
resolution: "@typescript-eslint/typescript-estree@npm:8.18.2"
dependencies:
"@typescript-eslint/types": "npm:8.18.1"
"@typescript-eslint/visitor-keys": "npm:8.18.1"
"@typescript-eslint/types": "npm:8.18.2"
"@typescript-eslint/visitor-keys": "npm:8.18.2"
debug: "npm:^4.3.4"
fast-glob: "npm:^3.3.2"
is-glob: "npm:^4.0.3"
Expand All @@ -5141,7 +5141,7 @@ __metadata:
ts-api-utils: "npm:^1.3.0"
peerDependencies:
typescript: ">=4.8.4 <5.8.0"
checksum: 10/8ecc1b50b9fc32116eee1b3b00f3fb29cf18026c0bbb50ab5f6e01db58ef62b8ac01824f2950f132479be6e1b82466a2bfd1e2cb4525aa8dbce4c27fc2494cfc
checksum: 10/0c3fa4d0c69da7b55973c9fbdb06b9fb7fb59f15243f59056d7361cf7daa992dc5e89f2cf2317c16e7c0a75d8edc5c6dd8f67ef47e62f2dadce5ecc80d4f4d36
languageName: node
linkType: hard

Expand All @@ -5163,18 +5163,18 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/utils@npm:8.18.1":
version: 8.18.1
resolution: "@typescript-eslint/utils@npm:8.18.1"
"@typescript-eslint/utils@npm:8.18.2":
version: 8.18.2
resolution: "@typescript-eslint/utils@npm:8.18.2"
dependencies:
"@eslint-community/eslint-utils": "npm:^4.4.0"
"@typescript-eslint/scope-manager": "npm:8.18.1"
"@typescript-eslint/types": "npm:8.18.1"
"@typescript-eslint/typescript-estree": "npm:8.18.1"
"@typescript-eslint/scope-manager": "npm:8.18.2"
"@typescript-eslint/types": "npm:8.18.2"
"@typescript-eslint/typescript-estree": "npm:8.18.2"
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: ">=4.8.4 <5.8.0"
checksum: 10/7b33d2ac273ad606a3dcb776bcf02c901812952550cdc93d4ece272b3b0e5d2a4e05fa92f9bd466f4a296ddd5992902d3b6623aa1c29d09e8e392897103e42a8
checksum: 10/70cf891d7ab099d6bfa103973c71916bc08bf0bcb7c05861c6f5f660d8dc796ddc081a1c9b1168abbe5b85d4583617f85ca1e2aaac56a5c78dcfdeb908fdc86c
languageName: node
linkType: hard

Expand Down Expand Up @@ -5212,13 +5212,13 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/visitor-keys@npm:8.18.1":
version: 8.18.1
resolution: "@typescript-eslint/visitor-keys@npm:8.18.1"
"@typescript-eslint/visitor-keys@npm:8.18.2":
version: 8.18.2
resolution: "@typescript-eslint/visitor-keys@npm:8.18.2"
dependencies:
"@typescript-eslint/types": "npm:8.18.1"
"@typescript-eslint/types": "npm:8.18.2"
eslint-visitor-keys: "npm:^4.2.0"
checksum: 10/00e88b1640a68c3afea08731395eb09a8216892248fee819cb7526e99093256743239d6b9e880a499f1c0ddfe2ffa4d1ad895d9e778b5d42e702d5880db1a594
checksum: 10/fa6e4194ae70b005172e180fe1ab89a33c70ee05cf789be2808043ce609ebc11fb8776ae28b01308e8feea432ab32a3d3e96d0acb20da92d6f1b7098cbb26567
languageName: node
linkType: hard

Expand Down Expand Up @@ -12368,7 +12368,7 @@ __metadata:
tsconfig-paths-webpack-plugin: "npm:^4.2.0"
turnstile-types: "npm:^1.2.3"
typescript: "npm:^5.7.2"
typescript-eslint: "npm:^8.18.1"
typescript-eslint: "npm:^8.18.2"
typescript-plugin-css-modules: "npm:^5.1.0"
unified: "npm:^11.0.5"
webpack: "npm:^5.97.1"
Expand Down Expand Up @@ -21311,17 +21311,17 @@ __metadata:
languageName: node
linkType: hard

"typescript-eslint@npm:^8.18.1":
version: 8.18.1
resolution: "typescript-eslint@npm:8.18.1"
"typescript-eslint@npm:^8.18.2":
version: 8.18.2
resolution: "typescript-eslint@npm:8.18.2"
dependencies:
"@typescript-eslint/eslint-plugin": "npm:8.18.1"
"@typescript-eslint/parser": "npm:8.18.1"
"@typescript-eslint/utils": "npm:8.18.1"
"@typescript-eslint/eslint-plugin": "npm:8.18.2"
"@typescript-eslint/parser": "npm:8.18.2"
"@typescript-eslint/utils": "npm:8.18.2"
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: ">=4.8.4 <5.8.0"
checksum: 10/2be2a14c10fc0988f50e63899e21980c53f6686b60bdda61750577e1481f3e857cf1d5de360849288a220cc053da84e678ca304935d885fe6365afc27e0b9fd2
checksum: 10/84f33c4f5dcdf9149c9178ebc71ec8fff91353d499aad656372b445310c6186efc615997d711f6afea2727463027c5c4957b9ea248e7f406f33f4203061d7c68
languageName: node
linkType: hard

Expand Down

0 comments on commit ec28e0f

Please sign in to comment.