Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to eslint v9 #2486

Merged
merged 4 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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