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

fix: fix illegal decorator check #6723

Merged
merged 20 commits into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

8 changes: 0 additions & 8 deletions packages/ast-spec/tests/fixtures-with-differences-errors.shot

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

Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand All @@ -1910,7 +1910,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand All @@ -1931,7 +1931,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand All @@ -1952,7 +1952,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand Down Expand Up @@ -1980,7 +1980,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand All @@ -2001,7 +2001,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand All @@ -2022,7 +2022,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand Down Expand Up @@ -2050,7 +2050,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand All @@ -2071,7 +2071,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand All @@ -2092,7 +2092,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand Down Expand Up @@ -2120,7 +2120,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand All @@ -2141,7 +2141,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand All @@ -2162,7 +2162,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand Down Expand Up @@ -2190,7 +2190,7 @@ class DecoratedClass {
public get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand All @@ -2211,7 +2211,7 @@ class DecoratedClass {
private get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand All @@ -2232,7 +2232,7 @@ class DecoratedClass {
protected get y() {
return this.x;
}
@foo @bar() set y(@foo @bar() value: x) {
@foo @bar() set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand Down Expand Up @@ -2260,7 +2260,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() public set y(@foo @bar() value: x) {
@foo @bar() public set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand All @@ -2281,7 +2281,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() private set y(@foo @bar() value: x) {
@foo @bar() private set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand All @@ -2302,7 +2302,7 @@ class DecoratedClass {
get y() {
return this.x;
}
@foo @bar() protected set y(@foo @bar() value: x) {
@foo @bar() protected set z(@foo @bar() value: x) {
this.x = x;
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-plugin/tests/rules/member-ordering.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ class Foo {
code: `
class Foo {
constructor() {}
@Dec() public A(): void;
@Dec() public A(): void {}
@Dec() private B: string;
private C(): void;
private D: string;
Expand All @@ -1473,7 +1473,7 @@ class Foo {
{
code: `
class Foo {
@Dec() private A(): void;
@Dec() private A(): void {}
@Dec() private B: string;
constructor() {}
private C(): void;
Expand Down Expand Up @@ -1510,7 +1510,7 @@ class Foo {
code: `
class Foo {
public A(): string;
@Dec() public B(): string;
@Dec() public B(): string {}
public C(): string;

d: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,7 @@ class Foo {
b2: string;

public c(): void;
@Dec() d(): void;
@Dec() d(): void {}
}
`,
options: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,10 @@ export interface Event<T> {
},
// https://github.com/typescript-eslint/typescript-eslint/issues/2369
`
export default function (@Optional() value = []) {
return value;
export class Test {
constructor(@Optional() value: number[] = []) {
console.log(value);
}
}

function Optional() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ describe('References:', () => {

declare class C {
@deco
foo(): TypeC;
foo(): TypeC {};
}
`,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ class Foo {
return 1;
}
@decorator
set foo() {}
set bar(value) {}
}