Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: update eslint version internally to latest #10244

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

Merged
merged 7 commits into from
Nov 4, 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
2 changes: 0 additions & 2 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
'ajv',
// ESM only so we can't go higher until we natively run ESM internally.
'globby',
// Blocked until we enable ESLint v9 locally in our own PR (#9119).
'eslint',
// ESM only so we can't go higher until we natively run ESM internally.
'execa',
],
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"cross-fetch": "^4.0.0",
"cspell": "^8.15.2",
"downlevel-dts": ">=0.11.0",
"eslint": "^9.3.0",
"eslint": "^9.13.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-eslint-plugin": "^6.2.0",
"eslint-plugin-import": "^2.29.1",
Expand Down Expand Up @@ -137,7 +137,6 @@
"@types/estree": "link:./tools/dummypkg",
"@types/node": "^20.0.0",
"@types/react": "^18.2.14",
"eslint": "^9",
Copy link
Member Author

Choose a reason for hiding this comment

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

Unsure of exactly what we wanna do with the various places the dependency is declared. I removed the resolutions field and did yarn up eslint. But, lmk if we want to manage it differently

"eslint-plugin-eslint-plugin@^5.5.0": "patch:eslint-plugin-eslint-plugin@npm%3A5.5.1#./.yarn/patches/eslint-plugin-eslint-plugin-npm-5.5.1-4206c2506d.patch",
"eslint-visitor-keys": "^3.4.1",
"jest-config": "^29",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"ajv": "^6.12.6",
"cross-env": "^7.0.3",
"cross-fetch": "*",
"eslint": "*",
"eslint": "^9.13.0",
"jest": "29.7.0",
"jest-specific-snapshot": "^8.0.0",
"json-schema": "*",
Expand Down
161 changes: 147 additions & 14 deletions packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts
Copy link
Member Author

Choose a reason for hiding this comment

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

These changes are due to eslint/eslint#18799

Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import rule from '../../src/rules/no-useless-constructor';

const ruleTester = new RuleTester();

const error = {
messageId: 'noUselessConstructor' as const,
type: AST_NODE_TYPES.MethodDefinition,
};

ruleTester.run('no-useless-constructor', rule, {
valid: [
'class A {}',
Expand Down Expand Up @@ -214,13 +209,30 @@ class A extends Object {
`,
],
invalid: [
/* eslint-disable @typescript-eslint/no-unnecessary-template-expression -- trailing whitespace */

{
code: `
class A {
constructor() {}
}
`,
errors: [error],
errors: [
{
messageId: 'noUselessConstructor',
suggestions: [
{
messageId: 'removeConstructor',
output: `
class A {
${' '}
}
`,
},
],
type: AST_NODE_TYPES.MethodDefinition,
},
],
},
{
code: `
Expand All @@ -230,7 +242,22 @@ class A extends B {
}
}
`,
errors: [error],
errors: [
{
messageId: 'noUselessConstructor',
suggestions: [
{
messageId: 'removeConstructor',
output: `
class A extends B {
${' '}
}
`,
},
],
type: AST_NODE_TYPES.MethodDefinition,
},
],
},
{
code: `
Expand All @@ -240,7 +267,22 @@ class A extends B {
}
}
`,
errors: [error],
errors: [
{
messageId: 'noUselessConstructor',
suggestions: [
{
messageId: 'removeConstructor',
output: `
class A extends B {
${' '}
}
`,
},
],
type: AST_NODE_TYPES.MethodDefinition,
},
],
},
{
code: `
Expand All @@ -250,7 +292,22 @@ class A extends B {
}
}
`,
errors: [error],
errors: [
{
messageId: 'noUselessConstructor',
suggestions: [
{
messageId: 'removeConstructor',
output: `
class A extends B {
${' '}
}
`,
},
],
type: AST_NODE_TYPES.MethodDefinition,
},
],
},
{
code: `
Expand All @@ -260,7 +317,22 @@ class A extends B {
}
}
`,
errors: [error],
errors: [
{
messageId: 'noUselessConstructor',
suggestions: [
{
messageId: 'removeConstructor',
output: `
class A extends B {
${' '}
}
`,
},
],
type: AST_NODE_TYPES.MethodDefinition,
},
],
},
{
code: `
Expand All @@ -270,7 +342,22 @@ class A extends B.C {
}
}
`,
errors: [error],
errors: [
{
messageId: 'noUselessConstructor',
suggestions: [
{
messageId: 'removeConstructor',
output: `
class A extends B.C {
${' '}
}
`,
},
],
type: AST_NODE_TYPES.MethodDefinition,
},
],
},
{
code: `
Expand All @@ -280,7 +367,22 @@ class A extends B {
}
}
`,
errors: [error],
errors: [
{
messageId: 'noUselessConstructor',
suggestions: [
{
messageId: 'removeConstructor',
output: `
class A extends B {
${' '}
}
`,
},
],
type: AST_NODE_TYPES.MethodDefinition,
},
],
},
{
code: `
Expand All @@ -290,15 +392,46 @@ class A extends B {
}
}
`,
errors: [error],
errors: [
{
messageId: 'noUselessConstructor',
suggestions: [
{
messageId: 'removeConstructor',
output: `
class A extends B {
${' '}
}
`,
},
],
type: AST_NODE_TYPES.MethodDefinition,
},
],
},
{
code: `
class A {
public constructor() {}
}
`,
errors: [error],
errors: [
{
messageId: 'noUselessConstructor',
suggestions: [
{
messageId: 'removeConstructor',
output: `
class A {
${' '}
}
`,
},
],
type: AST_NODE_TYPES.MethodDefinition,
},
],
},
/* eslint-enable @typescript-eslint/no-unnecessary-template-expression */
],
});

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

2 changes: 1 addition & 1 deletion packages/eslint-plugin/typings/eslint-rules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ declare module 'eslint/lib/rules/no-useless-constructor' {
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';

const rule: TSESLint.RuleModule<
'noUselessConstructor',
'noUselessConstructor' | 'removeConstructor',
[],
unknown,
{
Expand Down
2 changes: 1 addition & 1 deletion packages/website-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@typescript-eslint/typescript-estree": "workspace:*",
"@typescript-eslint/visitor-keys": "workspace:*",
"esbuild": "~0.24.0",
"eslint": "*",
"eslint": "^9.13.0",
"esquery": "*",
"prettier": "^3.2.5",
"tsx": "*"
Expand Down
2 changes: 1 addition & 1 deletion packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@uiw/react-shields": "2.0.1",
"clsx": "^2.1.0",
"docusaurus-plugin-typedoc": "^1.0.1",
"eslint": "*",
"eslint": "^9.13.0",
"json5": "^2.2.3",
"konamimojisplosion": "^0.5.2",
"lz-string": "^1.5.0",
Expand Down
Loading
Loading