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

chore: bump typescript-eslint to v8 #17624

Merged
merged 4 commits into from
Aug 5, 2024
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
11 changes: 8 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default tseslint.config(
],

'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/ban-types': 'off', // TODO: we should turn this on in a new PR
'@typescript-eslint/no-unsafe-function-type': 'off', // TODO: we should turn this on in a new PR
'@typescript-eslint/explicit-module-boundary-types': [
'error',
{ allowArgumentsExplicitlyTypedAsAny: true },
Expand All @@ -106,18 +106,23 @@ export default tseslint.config(
'error',
{ allow: ['arrowFunctions'] },
],
'@typescript-eslint/no-empty-object-type': [
'error',
{ allowInterfaces: 'with-single-extends' }, // maybe we should turn this on in a new PR
],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off', // maybe we should turn this on in a new PR
'no-extra-semi': 'off',
'@typescript-eslint/no-extra-semi': 'off', // conflicts with prettier
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-unused-expressions': 'off', // maybe we should turn this on in a new PR
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'@typescript-eslint/no-unused-vars': 'off', // maybe we should turn this on in a new PR
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-require-imports': 'off',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@typescript-eslint/no-var-requires was merged into @typescript-eslint/no-require-imports: typescript-eslint/typescript-eslint#8092

'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports', disallowTypeAnnotations: false },
],
// disable rules set in @typescript-eslint/stylistic v6 that wasn't set in @typescript-eslint/recommended v5 and which conflict with current code
// disable rules set in @typescript-eslint/stylistic which conflict with current code
// maybe we should turn them on in a new PR
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/ban-tslint-comment': 'off',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"tslib": "^2.6.3",
"tsx": "^4.16.2",
"typescript": "^5.5.3",
"typescript-eslint": "^7.18.0",
"typescript-eslint": "^8.0.0",
"vite": "workspace:*",
"vitest": "^2.0.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"eslint-plugin-react-refresh": "^0.4.7",
"globals": "^15.6.0",
"typescript": "^5.5.3",
"typescript-eslint": "^7.18.0",
"typescript-eslint": "^8.0.0",
"vite": "^5.3.5"
},
"overrides": {
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/importAnalysisBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function detectScriptRel() {
declare const scriptRel: string
declare const seen: Record<string, boolean>
function preload(
baseModule: () => Promise<{}>,
baseModule: () => Promise<unknown>,
deps?: string[],
importerUrl?: string,
) {
Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/types/shims.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ declare module 'postcss-import' {

// LESS' types somewhat references this which doesn't make sense in Node,
// so we have to shim it
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
declare interface HTMLLinkElement {}

// eslint-disable-next-line no-var
Expand Down
6 changes: 3 additions & 3 deletions packages/vite/src/types/ws.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ declare class WebSocket extends EventEmitter {
}

declare const WebSocketAlias: typeof WebSocket
interface WebSocketAlias extends WebSocket {} // tslint:disable-line no-empty-interface
interface WebSocketAlias extends WebSocket {}

declare namespace WebSocket {
/**
Expand Down Expand Up @@ -550,9 +550,9 @@ declare namespace WebSocket {
}

const WebSocketServer: typeof Server
interface WebSocketServer extends Server {} // tslint:disable-line no-empty-interface
interface WebSocketServer extends Server {}
const WebSocket: typeof WebSocketAlias
interface WebSocket extends WebSocketAlias {} // tslint:disable-line no-empty-interface
interface WebSocket extends WebSocketAlias {}

// WebSocket stream
function createWebSocketStream(
Expand Down
134 changes: 66 additions & 68 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion scripts/releaseUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export function run<EO extends ExecaOptions>(
bin: string,
args: string[],
opts?: EO,
): ResultPromise<EO & (keyof EO extends 'stdio' ? {} : { stdio: 'inherit' })> {
): ResultPromise<
EO & (keyof EO extends 'stdio' ? object : { stdio: 'inherit' })
> {
Copy link
Contributor Author

@JoshuaKGoldberg JoshuaKGoldberg Jul 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://v8--typescript-eslint.netlify.app/rules/ban-types: this is now covered by @typescript-eslint/no-empty-object-type. This particular object is better described as object, I think.

return execa(bin, args, { stdio: 'inherit', ...opts }) as any
}

Expand Down