Skip to content

Commit

Permalink
Migrate to eslint v9 (#2486)
Browse files Browse the repository at this point in the history
* build: migrate to eslint v9 and clean it up

* style: manual fixes to make new eslint happy

* style: apply eslint autofix

* build: downgrade to TypeScript 5.6 to ensure compatability with typedoc
  • Loading branch information
axe312ger authored Jan 23, 2025
1 parent 2ff298d commit 5100ad6
Show file tree
Hide file tree
Showing 8 changed files with 336 additions and 875 deletions.
50 changes: 0 additions & 50 deletions .eslintrc.js

This file was deleted.

39 changes: 39 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// @ts-check

import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'

export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommended,
// Library
{
files: ['lib/**/*'],
rules: {
// Things we probably should fix at some point
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-empty-object-type': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-function-type': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
// Things we won't allow
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-this-alias': [
'error',
{
allowDestructuring: true, // Allow `const { props, state } = this`; false by default
allowedNames: ['self'], // Allow `const self = this`; `[]` by default
},
],
},
},
// Tests
{
files: ['test/**/*'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
},
}
)
1 change: 0 additions & 1 deletion lib/adapters/REST/endpoints/bulk-action.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { AxiosInstance } from 'contentful-sdk-core'
import type { GetBulkActionParams, GetSpaceEnvironmentParams } from '../../../common-types'
import type {
Expand Down
1 change: 0 additions & 1 deletion lib/adapters/REST/endpoints/release-action.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { AxiosInstance } from 'contentful-sdk-core'
import type { GetReleaseParams, GetSpaceEnvironmentParams } from '../../../common-types'
import type { ReleaseActionQueryOptions } from '../../../entities/release-action'
Expand Down
2 changes: 1 addition & 1 deletion lib/common-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2105,7 +2105,7 @@ export type MRReturn<
> = 'return' extends keyof MRActions[ET][Action] ? Promise<MRActions[ET][Action]['return']> : never

/** Base interface for all Payload interfaces. Used as part of the MakeRequestOptions to simplify payload definitions. */
// eslint-disable-next-line @typescript-eslint/no-empty-interface

export interface MakeRequestPayload {}

export interface MakeRequestOptions {
Expand Down
Loading

0 comments on commit 5100ad6

Please sign in to comment.