Skip to content

Commit

Permalink
chore: lint command changes & add vscode editor settings to use prett…
Browse files Browse the repository at this point in the history
…ier, eslint

Signed-off-by: Sai Sankeerth <[email protected]>
  • Loading branch information
Sai Sankeerth committed Jan 20, 2024
1 parent 34f577f commit c7a9569
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 16 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/component-test-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ jobs:
run: |
npm run test:ts -- component
- name: Uplaod Report to S3
run: |
aws s3 cp ./test_reports/ s3://test-integrations-dev/integrations-test-reports/rudder-transformer/${{ github.event.number }}/ --recursive
- name: Comment on PR with S3 Object URL
uses: actions/github-script@v7
with:
Expand All @@ -55,7 +53,7 @@ jobs:
// Get the pull request number
const prNumber = context.payload.pull_request.number;
const commentBody = `Test report for this run is available at: https://test-integrations-dev.s3.amazonaws.com/integrations-test-reports/rudder-transformer/${prNumber}/test-report.html`;
// Comment on the pull request
github.rest.issues.createComment({
Expand All @@ -64,5 +62,3 @@ jobs:
issue_number: prNumber,
body: commentBody
});
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"prettier.requireConfig": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
},
"eslint.validate": ["javascript", "typescript"]
}
5 changes: 3 additions & 2 deletions src/adapters/networkHandlerFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ SUPPORTED_VERSIONS.forEach((version) => {
// },
// generic: GenericNetworkHandler,
// }
handlers[version][dest] =
require(`../${version}/destinations/${dest}/networkHandler`).networkHandler;
handlers[version][dest] = require(
`../${version}/destinations/${dest}/networkHandler`,
).networkHandler;
} catch {
// Do nothing as exception indicates
// network handler is not defined for that destination
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class ControllerUtility {

private static convertSourceInputv0Tov1(sourceEvents: unknown[]): SourceInput[] {
return sourceEvents.map(
(sourceEvent) => ({ event: sourceEvent, source: undefined } as SourceInput),
(sourceEvent) => ({ event: sourceEvent, source: undefined }) as SourceInput,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/services/destination/nativeIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export class NativeIntegrationDestinationService implements DestinationService {
error: JSON.stringify(v0Response.destinationResponse?.response),
statusCode: v0Response.status,
metadata,
} as DeliveryJobState),
}) as DeliveryJobState,
);
responseProxy = {
response: jobStates,
Expand Down
2 changes: 1 addition & 1 deletion src/services/userTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class UserTransformService {
statusCode: status,
metadata: e.metadata,
error: errorString,
} as ProcessorTransformationResponse),
}) as ProcessorTransformationResponse,
),
);
stats.counter('user_transform_errors', eventsToProcess.length, {
Expand Down
2 changes: 1 addition & 1 deletion src/v0/destinations/adobe_analytics/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function escapeToHTML(inputString) {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
}[match]),
})[match],
);
}

Expand Down
4 changes: 2 additions & 2 deletions test/test_reporter/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ export const generateTestReport = (testData, output, result) => {

export const initaliseReport = () => {
const htmlTemplate = generateHTMLTemplate();
if (!fs.existsSync('test_reports')){
if (!fs.existsSync('test_reports')) {
fs.mkdirSync('test_reports');
}
}
fs.writeFileSync('test_reports/test-report.html', htmlTemplate);
console.log('Report initialised');
};
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/* Language and Environment */
"target": "ES2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"lib": [
"es2019"
"es2019",
] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
Expand Down Expand Up @@ -100,8 +100,8 @@

/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
},
"exclude": ["./src/**/*.test.js", "./src/**/*.test.ts", "./test"],
"include": ["./src", "./src/**/*.json"]
"include": ["./src", "./src/**/*.json"],
}

0 comments on commit c7a9569

Please sign in to comment.