Skip to content

Commit

Permalink
Eslint upgrade 20240731 (#100)
Browse files Browse the repository at this point in the history
* Upgrade to typescript-eslint v8, part 1.

* Upgrade to typescript-eslint v8, part 2.

* Revert "Upgrade to typescript-eslint v8, part 2."

This reverts commit 79e6339.

* remove old eslint configurations
  • Loading branch information
ajvincent authored Aug 11, 2024
1 parent 2d87536 commit 20a6143
Show file tree
Hide file tree
Showing 121 changed files with 725 additions and 3,645 deletions.
72 changes: 0 additions & 72 deletions .eslintrc.json

This file was deleted.

64 changes: 32 additions & 32 deletions dist/exports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -966,15 +966,15 @@ declare class DecoratorImpl extends DecoratorStructureBase implements DecoratorS
declare const ParameterDeclarationStructureBase: mixin_decorators.MixinClass<object, {
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
scope?: ts_morph.Scope;
scope?: ts_morph.Scope | undefined;
readonly decorators: DecoratorImpl[];
name: string;
hasOverrideKeyword: boolean;
hasQuestionToken: boolean;
isReadonly: boolean;
type?: stringOrWriterFunction;
type?: stringOrWriterFunction | undefined;
typeStructure: TypeStructures | undefined;
initializer?: stringOrWriterFunction;
initializer?: stringOrWriterFunction | undefined;
}, typeof StructureBase>;
declare class ParameterDeclarationImpl extends ParameterDeclarationStructureBase implements ParameterDeclarationStructureClassIfc {
readonly kind: StructureKind.Parameter;
Expand Down Expand Up @@ -1010,7 +1010,7 @@ declare const CallSignatureDeclarationStructureBase: mixin_decorators.MixinClass
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
readonly parameters: ParameterDeclarationImpl[];
returnType?: stringOrWriterFunction;
returnType?: stringOrWriterFunction | undefined;
returnTypeStructure: TypeStructures | undefined;
readonly typeParameters: (TypeParameterDeclarationImpl | string)[];
}, typeof StructureBase>;
Expand All @@ -1030,7 +1030,7 @@ declare const ClassDeclarationStructureBase: mixin_decorators.MixinClass<object,
hasDeclareKeyword: boolean;
isDefaultExport: boolean;
isExported: boolean;
name?: string;
name?: string | undefined;
}, typeof StructureBase>;
declare class ClassDeclarationImpl extends ClassDeclarationStructureBase implements ClassDeclarationStructureClassIfc {
#private;
Expand Down Expand Up @@ -1073,9 +1073,9 @@ declare const ConstructorDeclarationStructureBase: mixin_decorators.MixinClass<o
readonly docs: (JSDocImpl | string)[];
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
scope?: ts_morph.Scope;
scope?: ts_morph.Scope | undefined;
readonly parameters: ParameterDeclarationImpl[];
returnType?: stringOrWriterFunction;
returnType?: stringOrWriterFunction | undefined;
returnTypeStructure: TypeStructures | undefined;
readonly typeParameters: (TypeParameterDeclarationImpl | string)[];
}, typeof StructureBase>;
Expand All @@ -1093,9 +1093,9 @@ declare const ConstructorDeclarationOverloadStructureBase: mixin_decorators.Mixi
readonly docs: (JSDocImpl | string)[];
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
scope?: ts_morph.Scope;
scope?: ts_morph.Scope | undefined;
readonly parameters: ParameterDeclarationImpl[];
returnType?: stringOrWriterFunction;
returnType?: stringOrWriterFunction | undefined;
returnTypeStructure: TypeStructures | undefined;
readonly typeParameters: (TypeParameterDeclarationImpl | string)[];
}, typeof StructureBase>;
Expand All @@ -1110,7 +1110,7 @@ declare const ConstructSignatureDeclarationStructureBase: mixin_decorators.Mixin
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
readonly parameters: ParameterDeclarationImpl[];
returnType?: stringOrWriterFunction;
returnType?: stringOrWriterFunction | undefined;
returnTypeStructure: TypeStructures | undefined;
readonly typeParameters: (TypeParameterDeclarationImpl | string)[];
}, typeof StructureBase>;
Expand Down Expand Up @@ -1145,7 +1145,7 @@ declare const EnumMemberStructureBase: mixin_decorators.MixinClass<object, {
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
name: string;
initializer?: stringOrWriterFunction;
initializer?: stringOrWriterFunction | undefined;
}, typeof StructureBase>;
declare class EnumMemberImpl extends EnumMemberStructureBase implements EnumMemberStructureClassIfc {
readonly kind: StructureKind.EnumMember;
Expand Down Expand Up @@ -1213,15 +1213,15 @@ declare const FunctionDeclarationStructureBase: mixin_decorators.MixinClass<obje
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
readonly parameters: ParameterDeclarationImpl[];
returnType?: stringOrWriterFunction;
returnType?: stringOrWriterFunction | undefined;
returnTypeStructure: TypeStructures | undefined;
readonly typeParameters: (TypeParameterDeclarationImpl | string)[];
isAsync: boolean;
isGenerator: boolean;
hasDeclareKeyword: boolean;
isDefaultExport: boolean;
isExported: boolean;
name?: string;
name?: string | undefined;
}, typeof StructureBase>;
declare class FunctionDeclarationImpl extends FunctionDeclarationStructureBase implements FunctionDeclarationStructureClassIfc {
readonly kind: StructureKind.Function;
Expand All @@ -1237,7 +1237,7 @@ declare const FunctionDeclarationOverloadStructureBase: mixin_decorators.MixinCl
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
readonly parameters: ParameterDeclarationImpl[];
returnType?: stringOrWriterFunction;
returnType?: stringOrWriterFunction | undefined;
returnTypeStructure: TypeStructures | undefined;
readonly typeParameters: (TypeParameterDeclarationImpl | string)[];
isAsync: boolean;
Expand All @@ -1257,9 +1257,9 @@ declare const GetAccessorDeclarationStructureBase: mixin_decorators.MixinClass<o
readonly docs: (JSDocImpl | string)[];
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
scope?: ts_morph.Scope;
scope?: ts_morph.Scope | undefined;
readonly parameters: ParameterDeclarationImpl[];
returnType?: stringOrWriterFunction;
returnType?: stringOrWriterFunction | undefined;
returnTypeStructure: TypeStructures | undefined;
readonly typeParameters: (TypeParameterDeclarationImpl | string)[];
readonly decorators: DecoratorImpl[];
Expand Down Expand Up @@ -1329,7 +1329,7 @@ declare const IndexSignatureDeclarationStructureBase: mixin_decorators.MixinClas
readonly docs: (JSDocImpl | string)[];
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
returnType?: stringOrWriterFunction;
returnType?: stringOrWriterFunction | undefined;
returnTypeStructure: TypeStructures | undefined;
isReadonly: boolean;
}, typeof StructureBase>;
Expand Down Expand Up @@ -1464,9 +1464,9 @@ declare const MethodDeclarationStructureBase: mixin_decorators.MixinClass<object
readonly docs: (JSDocImpl | string)[];
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
scope?: ts_morph.Scope;
scope?: ts_morph.Scope | undefined;
readonly parameters: ParameterDeclarationImpl[];
returnType?: stringOrWriterFunction;
returnType?: stringOrWriterFunction | undefined;
returnTypeStructure: TypeStructures | undefined;
readonly typeParameters: (TypeParameterDeclarationImpl | string)[];
readonly decorators: DecoratorImpl[];
Expand All @@ -1493,9 +1493,9 @@ declare const MethodDeclarationOverloadStructureBase: mixin_decorators.MixinClas
readonly docs: (JSDocImpl | string)[];
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
scope?: ts_morph.Scope;
scope?: ts_morph.Scope | undefined;
readonly parameters: ParameterDeclarationImpl[];
returnType?: stringOrWriterFunction;
returnType?: stringOrWriterFunction | undefined;
returnTypeStructure: TypeStructures | undefined;
readonly typeParameters: (TypeParameterDeclarationImpl | string)[];
isAbstract: boolean;
Expand All @@ -1517,7 +1517,7 @@ declare const MethodSignatureStructureBase: mixin_decorators.MixinClass<object,
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
readonly parameters: ParameterDeclarationImpl[];
returnType?: stringOrWriterFunction;
returnType?: stringOrWriterFunction | undefined;
returnTypeStructure: TypeStructures | undefined;
readonly typeParameters: (TypeParameterDeclarationImpl | string)[];
name: string;
Expand Down Expand Up @@ -1574,17 +1574,17 @@ declare const PropertyDeclarationStructureBase: mixin_decorators.MixinClass<obje
readonly docs: (JSDocImpl | string)[];
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
scope?: ts_morph.Scope;
scope?: ts_morph.Scope | undefined;
readonly decorators: DecoratorImpl[];
isAbstract: boolean;
name: string;
hasOverrideKeyword: boolean;
hasQuestionToken: boolean;
hasExclamationToken: boolean;
isReadonly: boolean;
type?: stringOrWriterFunction;
type?: stringOrWriterFunction | undefined;
typeStructure: TypeStructures | undefined;
initializer?: stringOrWriterFunction;
initializer?: stringOrWriterFunction | undefined;
hasDeclareKeyword: boolean;
}, typeof StructureBase>;
declare class PropertyDeclarationImpl extends PropertyDeclarationStructureBase implements PropertyDeclarationStructureClassIfc {
Expand All @@ -1606,9 +1606,9 @@ declare const PropertySignatureStructureBase: mixin_decorators.MixinClass<object
name: string;
hasQuestionToken: boolean;
isReadonly: boolean;
type?: stringOrWriterFunction;
type?: stringOrWriterFunction | undefined;
typeStructure: TypeStructures | undefined;
initializer?: stringOrWriterFunction;
initializer?: stringOrWriterFunction | undefined;
}, typeof StructureBase>;
declare class PropertySignatureImpl extends PropertySignatureStructureBase implements PropertySignatureStructureClassIfc {
readonly kind: StructureKind.PropertySignature;
Expand All @@ -1622,9 +1622,9 @@ declare const SetAccessorDeclarationStructureBase: mixin_decorators.MixinClass<o
readonly docs: (JSDocImpl | string)[];
readonly leadingTrivia: stringOrWriterFunction[];
readonly trailingTrivia: stringOrWriterFunction[];
scope?: ts_morph.Scope;
scope?: ts_morph.Scope | undefined;
readonly parameters: ParameterDeclarationImpl[];
returnType?: stringOrWriterFunction;
returnType?: stringOrWriterFunction | undefined;
returnTypeStructure: TypeStructures | undefined;
readonly typeParameters: (TypeParameterDeclarationImpl | string)[];
readonly decorators: DecoratorImpl[];
Expand Down Expand Up @@ -1682,7 +1682,7 @@ declare const TypeAliasDeclarationStructureBase: mixin_decorators.MixinClass<obj
readonly trailingTrivia: stringOrWriterFunction[];
readonly typeParameters: (TypeParameterDeclarationImpl | string)[];
name: string;
type?: stringOrWriterFunction;
type?: stringOrWriterFunction | undefined;
typeStructure: TypeStructures | undefined;
hasDeclareKeyword: boolean;
isDefaultExport: boolean;
Expand All @@ -1704,9 +1704,9 @@ declare const VariableDeclarationStructureBase: mixin_decorators.MixinClass<obje
readonly trailingTrivia: stringOrWriterFunction[];
name: string;
hasExclamationToken: boolean;
type?: stringOrWriterFunction;
type?: stringOrWriterFunction | undefined;
typeStructure: TypeStructures | undefined;
initializer?: stringOrWriterFunction;
initializer?: stringOrWriterFunction | undefined;
}, typeof StructureBase>;
declare class VariableDeclarationImpl extends VariableDeclarationStructureBase implements VariableDeclarationStructureClassIfc {
readonly kind: StructureKind.VariableDeclaration;
Expand Down
5 changes: 2 additions & 3 deletions dist/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var TypeStructureKind;

/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
/**
* This proxy handler is simply making any methods which modify an array in
* place unreachable, and likewise prevents setting index values.
Expand Down Expand Up @@ -144,7 +145,6 @@ const COPY_FIELDS = Symbol("copy fields");
const REPLACE_WRITER_WITH_STRING = Symbol("replaceWriterWithString");
const STRUCTURE_AND_TYPES_CHILDREN = Symbol("otherwise unreachable structure and type-structure children");

/* eslint-disable @typescript-eslint/no-empty-function */
class StructureBase {
/** @internal */
static [COPY_FIELDS](source, target) {
Expand Down Expand Up @@ -945,7 +945,6 @@ class TypeStructuresWithChildren extends TypeStructuresBase {
if (childTypes.length > this.maxChildCount)
childTypes = childTypes.slice(0, this.maxChildCount);
const lastIndex = childTypes.length - 1;
// eslint-disable-next-line @typescript-eslint/prefer-for-of
for (let index = 0; index <= lastIndex; index++) {
const child = childTypes[index];
child.writerFunction(writer);
Expand Down Expand Up @@ -1884,7 +1883,7 @@ function convertFunctionTypeNode(typeNode, consoleTrap, subStructureResolver) {
// https://github.com/dsherret/ts-morph/issues/1434
typeParameterNodes = typeNode.getTypeParameters();
}
catch (ex) {
catch {
typeParameterNodes = typeNode.getChildrenOfKind(SyntaxKind.TypeParameter);
}
const typeParameterStructures = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class CallSignatureDeclarationImpl implements CallSignatureDeclar
| [kind](./ts-morph-structures.callsignaturedeclarationimpl.kind.md) | <code>readonly</code> | StructureKind.CallSignature | |
| [leadingTrivia](./ts-morph-structures.callsignaturedeclarationimpl.leadingtrivia.md) | <code>readonly</code> | [stringOrWriterFunction](./ts-morph-structures.stringorwriterfunction.md)<!-- -->\[\] | |
| [parameters](./ts-morph-structures.callsignaturedeclarationimpl.parameters.md) | <code>readonly</code> | [ParameterDeclarationImpl](./ts-morph-structures.parameterdeclarationimpl.md)<!-- -->\[\] | |
| [returnType?](./ts-morph-structures.callsignaturedeclarationimpl.returntype.md) | | [stringOrWriterFunction](./ts-morph-structures.stringorwriterfunction.md) | _(Optional)_ |
| [returnType?](./ts-morph-structures.callsignaturedeclarationimpl.returntype.md) | | [stringOrWriterFunction](./ts-morph-structures.stringorwriterfunction.md) \| undefined | _(Optional)_ |
| [returnTypeStructure](./ts-morph-structures.callsignaturedeclarationimpl.returntypestructure.md) | | [TypeStructures](./ts-morph-structures.typestructures.md) \| undefined | |
| [trailingTrivia](./ts-morph-structures.callsignaturedeclarationimpl.trailingtrivia.md) | <code>readonly</code> | [stringOrWriterFunction](./ts-morph-structures.stringorwriterfunction.md)<!-- -->\[\] | |
| [typeParameters](./ts-morph-structures.callsignaturedeclarationimpl.typeparameters.md) | <code>readonly</code> | ([TypeParameterDeclarationImpl](./ts-morph-structures.typeparameterdeclarationimpl.md) \| string)\[\] | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
**Signature:**

```typescript
returnType?: stringOrWriterFunction;
returnType?: stringOrWriterFunction | undefined;
```
2 changes: 1 addition & 1 deletion docs/api/ts-morph-structures.classdeclarationimpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class ClassDeclarationImpl implements ClassDeclarationStructureCl
| [kind](./ts-morph-structures.classdeclarationimpl.kind.md) | <code>readonly</code> | StructureKind.Class | |
| [leadingTrivia](./ts-morph-structures.classdeclarationimpl.leadingtrivia.md) | <code>readonly</code> | [stringOrWriterFunction](./ts-morph-structures.stringorwriterfunction.md)<!-- -->\[\] | |
| [methods](./ts-morph-structures.classdeclarationimpl.methods.md) | <code>readonly</code> | [MethodDeclarationImpl](./ts-morph-structures.methoddeclarationimpl.md)<!-- -->\[\] | |
| [name?](./ts-morph-structures.classdeclarationimpl.name.md) | | string | _(Optional)_ |
| [name?](./ts-morph-structures.classdeclarationimpl.name.md) | | string \| undefined | _(Optional)_ |
| [properties](./ts-morph-structures.classdeclarationimpl.properties.md) | <code>readonly</code> | [PropertyDeclarationImpl](./ts-morph-structures.propertydeclarationimpl.md)<!-- -->\[\] | |
| [setAccessors](./ts-morph-structures.classdeclarationimpl.setaccessors.md) | <code>readonly</code> | [SetAccessorDeclarationImpl](./ts-morph-structures.setaccessordeclarationimpl.md)<!-- -->\[\] | |
| [staticBlocks](./ts-morph-structures.classdeclarationimpl.staticblocks.md) | <code>readonly</code> | [ClassStaticBlockDeclarationImpl](./ts-morph-structures.classstaticblockdeclarationimpl.md)<!-- -->\[\] | |
Expand Down
2 changes: 1 addition & 1 deletion docs/api/ts-morph-structures.classdeclarationimpl.name.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
**Signature:**

```typescript
name?: string;
name?: string | undefined;
```
Loading

0 comments on commit 20a6143

Please sign in to comment.