Skip to content

Commit

Permalink
chore: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Souvikns committed Sep 23, 2024
1 parent 696086f commit b39bae9
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 41 deletions.
24 changes: 12 additions & 12 deletions src/commands/generate/fromTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default class Template extends Command {
}
}
if (flags['use-new-generator']) {
await this.generateUsingNewGenerator(asyncapi, template, output, options, genOption, interactive)
await this.generateUsingNewGenerator(asyncapi, template, output, options, genOption, interactive);
} else {
await this.generate(asyncapi, template, output, options, genOption, interactive);
}
Expand Down Expand Up @@ -350,17 +350,17 @@ export default class Template extends Command {
for (const [, value] of Object.entries(changedFiles)) {
let eventText;
switch (value.eventType) {
case 'changed':
eventText = green(value.eventType);
break;
case 'removed':
eventText = red(value.eventType);
break;
case 'renamed':
eventText = yellow(value.eventType);
break;
default:
eventText = yellow(value.eventType);
case 'changed':
eventText = green(value.eventType);
break;
case 'removed':
eventText = red(value.eventType);
break;
case 'renamed':
eventText = yellow(value.eventType);
break;
default:
eventText = yellow(value.eventType);
}
this.log(`\t${magenta(value.path)} was ${eventText}`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ declare module '@asyncapi/openapi-schema-parser';
declare module '@asyncapi/avro-schema-parser';
declare module '@asyncapi/raml-dt-schema-parser';
declare module '@asyncapi/protobuf-schema-parser';
declare module 'generator-v2';
declare module 'generator-v2';
12 changes: 6 additions & 6 deletions test/fixtures/newtemplate/__transpiled/index.js

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

34 changes: 17 additions & 17 deletions test/fixtures/newtemplate/hooks/generateAsyncapiFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ const fs = require('fs');
const path = require('path');

module.exports = {
'generate:before': generator => {
const asyncapi = generator.originalAsyncAPI;
let extension;
try {
JSON.parse(asyncapi);
extension = 'json'
} catch (error) {
extension = 'yaml'
}

fs.writeFileSync(
path.resolve(
generator.targetDir, `asyncapi.${extension}`
)
, asyncapi, { encoding: 'utf-8' }
);
'generate:before': generator => {
const asyncapi = generator.originalAsyncAPI;
let extension;
try {
JSON.parse(asyncapi);
extension = 'json';
} catch (error) {
extension = 'yaml';
}
}

fs.writeFileSync(
path.resolve(
generator.targetDir, `asyncapi.${extension}`
)
, asyncapi, { encoding: 'utf-8' }
);
}
};
10 changes: 5 additions & 5 deletions test/integration/generate/fromTemplate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ describe('template', () => {
'--use-new-generator',
])
.it('should be able to generate using newer version of generator', (ctx, done) => {
expect(ctx.stdout).to.contain('Check out your shiny new generated files at ./test/docs/2.\n\n')
cleanup('./test/docs/2')
done()
})
})
expect(ctx.stdout).to.contain('Check out your shiny new generated files at ./test/docs/2.\n\n');
cleanup('./test/docs/2');
done();
});
});

describe('git clash', () => {
const pathToOutput = './test/docs/2';
Expand Down

0 comments on commit b39bae9

Please sign in to comment.