要求类、接口和类型字面量中成员的排序方式保持一致的风格。
// 默认排序规则:field-constructor-method
export class Foo2 {
// -> field
protected static e: string = '';
public d: string = '';
private readonly c: string = '';
// -> constructor
public constructor() {
console.info('constructor');
}
// -> method
public static a(): void {
console.info('static method');
}
public b(): void {
console.info(this.c);
}
} // 默认排序规则:field-constructor-method
export class Foo2 {
// -> method
public static a(): void {
console.info('static method');
}
public b(): void {
console.info(this.c);
}
// -> field
protected static e: string = '';
private readonly c: string = '';
public d: string = '';
// -> constructor
public constructor() {
console.info('constructor');
}
}