Skip to content

Commit

Permalink
chore: update linting and dev dependency versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed Oct 12, 2023
1 parent 7c1ffd2 commit 4bc0ce0
Show file tree
Hide file tree
Showing 19 changed files with 415 additions and 320 deletions.
618 changes: 338 additions & 280 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@
"devDependencies": {
"@asyncapi/parserV1": "npm:@asyncapi/parser@^1.17.2",
"@types/jest": "^27.0.2",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"ajv": "^8.6.3",
"concurrently": "^7.5.0",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-github": "^4.6.1",
"eslint": "^8.51.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-github": "^4.10.1",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-security": "^1.7.1",
"eslint-plugin-sonarjs": "^0.19.0",
"jest": "^27.2.5",
Expand Down
3 changes: 2 additions & 1 deletion src/generators/AbstractGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import { AbstractDependencyManager } from './AbstractDependencyManager';

export interface CommonGeneratorOptions<
P extends Preset = Preset,
DependencyManager extends AbstractDependencyManager = AbstractDependencyManager
DependencyManager extends
AbstractDependencyManager = AbstractDependencyManager
> {
indentation?: {
type: IndentationTypes;
Expand Down
5 changes: 4 additions & 1 deletion src/generators/cplusplus/CplusplusDependencyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { AbstractDependencyManager } from '../AbstractDependencyManager';
import { CplusplusOptions } from './CplusplusGenerator';

export class CplusplusDependencyManager extends AbstractDependencyManager {
constructor(public options: CplusplusOptions, dependencies: string[] = []) {
constructor(
public options: CplusplusOptions,
dependencies: string[] = []
) {
super(dependencies);
}
}
5 changes: 4 additions & 1 deletion src/generators/csharp/CSharpDependencyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { AbstractDependencyManager } from '../AbstractDependencyManager';
import { CSharpOptions } from './CSharpGenerator';

export class CSharpDependencyManager extends AbstractDependencyManager {
constructor(public options: CSharpOptions, dependencies: string[] = []) {
constructor(
public options: CSharpOptions,
dependencies: string[] = []
) {
super(dependencies);
}
}
5 changes: 4 additions & 1 deletion src/generators/dart/DartDependencyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { AbstractDependencyManager } from '../AbstractDependencyManager';
import { DartOptions } from './DartGenerator';

export class DartDependencyManager extends AbstractDependencyManager {
constructor(public options: DartOptions, dependencies: string[] = []) {
constructor(
public options: DartOptions,
dependencies: string[] = []
) {
super(dependencies);
}

Expand Down
5 changes: 4 additions & 1 deletion src/generators/go/GoDependencyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { AbstractDependencyManager } from '../AbstractDependencyManager';
import { GoOptions } from './GoGenerator';

export class GoDependencyManager extends AbstractDependencyManager {
constructor(public options: GoOptions, dependencies: string[] = []) {
constructor(
public options: GoOptions,
dependencies: string[] = []
) {
super(dependencies);
}
}
1 change: 0 additions & 1 deletion src/generators/java/JavaConstrainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ export const JavaDefaultTypeMapping: JavaTypeMapping = {
return `${constrainedModel.valueModel.type}[]`;
},
Enum({ constrainedModel }): string {
const format = constrainedModel.originalInput?.['format'];
const valueTypes = constrainedModel.values.map((enumValue) =>
fromEnumValueToType(enumValue, constrainedModel.options.format)
);
Expand Down
5 changes: 4 additions & 1 deletion src/generators/java/JavaDependencyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import { JavaOptions } from './JavaGenerator';
export class JavaDependencyManager extends AbstractDependencyManager {
private modelDependencies: ConstrainedMetaModel[] = [];

constructor(public options: JavaOptions, dependencies: string[] = []) {
constructor(
public options: JavaOptions,
dependencies: string[] = []
) {
super(dependencies);
}

Expand Down
5 changes: 4 additions & 1 deletion src/generators/javascript/JavaScriptDependencyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { AbstractDependencyManager } from '../AbstractDependencyManager';
import { JavaScriptOptions } from './JavaScriptGenerator';

export class JavaScriptDependencyManager extends AbstractDependencyManager {
constructor(public options: JavaScriptOptions, dependencies: string[] = []) {
constructor(
public options: JavaScriptOptions,
dependencies: string[] = []
) {
super(dependencies);
}

Expand Down
5 changes: 4 additions & 1 deletion src/generators/kotlin/KotlinDependencyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { AbstractDependencyManager } from '../AbstractDependencyManager';
import { KotlinOptions } from './KotlinGenerator';

export class KotlinDependencyManager extends AbstractDependencyManager {
constructor(public options: KotlinOptions, dependencies: string[] = []) {
constructor(
public options: KotlinOptions,
dependencies: string[] = []
) {
super(dependencies);
}

Expand Down
5 changes: 4 additions & 1 deletion src/generators/php/PhpDependencyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { AbstractDependencyManager } from '../AbstractDependencyManager';
import { PhpOptions } from './PhpGenerator';

export class PhpDependencyManager extends AbstractDependencyManager {
constructor(public options: PhpOptions, dependencies: string[] = []) {
constructor(
public options: PhpOptions,
dependencies: string[] = []
) {
super(dependencies);
}
}
5 changes: 4 additions & 1 deletion src/generators/python/PythonDependencyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { AbstractDependencyManager } from '../AbstractDependencyManager';
import { PythonOptions } from './PythonGenerator';

export class PythonDependencyManager extends AbstractDependencyManager {
constructor(public options: PythonOptions, dependencies: string[] = []) {
constructor(
public options: PythonOptions,
dependencies: string[] = []
) {
super(dependencies);
}

Expand Down
5 changes: 4 additions & 1 deletion src/generators/rust/RustDependencyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { AbstractDependencyManager } from '../AbstractDependencyManager';
import { RustOptions } from './RustGenerator';

export class RustDependencyManager extends AbstractDependencyManager {
constructor(public options: RustOptions, dependencies: string[] = []) {
constructor(
public options: RustOptions,
dependencies: string[] = []
) {
super(dependencies);
}
}
5 changes: 4 additions & 1 deletion src/generators/typescript/TypeScriptDependencyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { ConstrainedMetaModel } from '../../models';
import { TypeScriptExportType, TypeScriptOptions } from './TypeScriptGenerator';

export class TypeScriptDependencyManager extends AbstractDependencyManager {
constructor(public options: TypeScriptOptions, dependencies: string[] = []) {
constructor(
public options: TypeScriptOptions,
dependencies: string[] = []
) {
super(dependencies);
}

Expand Down
6 changes: 3 additions & 3 deletions src/generators/typescript/presets/CommonPreset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ function renderArraySerialization(
return `let ${propName}: any[] = [];
for (const unionItem of ${modelInstanceVariable}) {
${propName}.push(\`${renderMarshalProperty(
'unionItem',
arrayModel.valueModel
)}\`);
'unionItem',
arrayModel.valueModel
)}\`);
}
json += \`"${unconstrainedProperty}": [\${${propName}.join(',')}],\`;`;
}
Expand Down
5 changes: 4 additions & 1 deletion src/models/ConstrainedMetaModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ export class ConstrainedIntegerModel extends ConstrainedMetaModel {}
export class ConstrainedStringModel extends ConstrainedMetaModel {}
export class ConstrainedBooleanModel extends ConstrainedMetaModel {}
export class ConstrainedTupleValueModel {
constructor(public index: number, public value: ConstrainedMetaModel) {}
constructor(
public index: number,
public value: ConstrainedMetaModel
) {}
}
export class ConstrainedTupleModel extends ConstrainedMetaModel {
constructor(
Expand Down
10 changes: 8 additions & 2 deletions src/models/MetaModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export class IntegerModel extends MetaModel {}
export class StringModel extends MetaModel {}
export class BooleanModel extends MetaModel {}
export class TupleValueModel {
constructor(public index: number, public value: MetaModel) {}
constructor(
public index: number,
public value: MetaModel
) {}
}
export class TupleModel extends MetaModel {
constructor(
Expand Down Expand Up @@ -88,7 +91,10 @@ export class UnionModel extends MetaModel {
}
}
export class EnumValueModel {
constructor(public key: string, public value: any) {}
constructor(
public key: string,
public value: any
) {}
}
export class EnumModel extends MetaModel {
constructor(
Expand Down
25 changes: 10 additions & 15 deletions test/processors/JsonSchemaInputProcessor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ describe('JsonSchemaInputProcessor', () => {
});
test('should process draft 7 schemas', async () => {
const inputSchemaPath = './JsonSchemaInputProcessor/draft-7.json';
const { inputMetaModel, inputSchema } = await getCommonInput(
inputSchemaPath
);
const { inputMetaModel, inputSchema } =
await getCommonInput(inputSchemaPath);
expect(inputMetaModel).toMatchObject({
models: { test: mockedMetaModel },
originalInput: inputSchema
Expand All @@ -75,9 +74,8 @@ describe('JsonSchemaInputProcessor', () => {

test('should process draft 6 schemas', async () => {
const inputSchemaPath = './JsonSchemaInputProcessor/draft-6.json';
const { inputMetaModel, inputSchema } = await getCommonInput(
inputSchemaPath
);
const { inputMetaModel, inputSchema } =
await getCommonInput(inputSchemaPath);
expect(inputMetaModel).toMatchObject({
models: { test: mockedMetaModel },
originalInput: inputSchema
Expand All @@ -93,9 +91,8 @@ describe('JsonSchemaInputProcessor', () => {

test('should process draft 4 schemas', async () => {
const inputSchemaPath = './JsonSchemaInputProcessor/draft-4.json';
const { inputMetaModel, inputSchema } = await getCommonInput(
inputSchemaPath
);
const { inputMetaModel, inputSchema } =
await getCommonInput(inputSchemaPath);
expect(inputMetaModel).toMatchObject({
models: { test: mockedMetaModel },
originalInput: inputSchema
Expand All @@ -111,9 +108,8 @@ describe('JsonSchemaInputProcessor', () => {

test('should be able to use $ref', async () => {
const inputSchemaPath = './JsonSchemaInputProcessor/references.json';
const { inputMetaModel, inputSchema } = await getCommonInput(
inputSchemaPath
);
const { inputMetaModel, inputSchema } =
await getCommonInput(inputSchemaPath);
const expectedResolvedInput = {
...inputSchema,
properties: { street_address: { type: 'string' } }
Expand All @@ -136,9 +132,8 @@ describe('JsonSchemaInputProcessor', () => {
test('should be able to use $ref when circular', async () => {
const inputSchemaPath =
'./JsonSchemaInputProcessor/references_circular.json';
const { inputMetaModel, inputSchema } = await getCommonInput(
inputSchemaPath
);
const { inputMetaModel, inputSchema } =
await getCommonInput(inputSchemaPath);
const expectedResolvedInput = {
...inputSchema,
definitions: {},
Expand Down

0 comments on commit 4bc0ce0

Please sign in to comment.