-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Description
Class properties with a generic type declaration appear to be recognized as methods rather than properties as they should be. I have included my ESLint configuration, an example that recreates the issue, and a screenshot of the ESLint error.
plugins: [
'sort-class-members',
],
rules: {
'sort-class-members/sort-class-members': [
2,
{
accessorPairPositioning: 'getThenSet',
order: [
'[properties]',
'constructor',
'[methods]',
],
},
],
},
export default abstract class Foo<T> {
protected abstract readonly _foo: T;
public readonly bar: string;
public readonly baz: string;
protected constructor(bar: string) {
this.bar = bar;
this.baz = bar.trim();
}
public get data(): Foo<T>['_foo'] {
if (!this._foo) {
throw new Error('Something is missing');
}
return this._foo;
}
protected abstract parse(baz?: string): T;
protected abstract stringify(): string;
}
Metadata
Metadata
Assignees
Labels
No labels