Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#IC-489] migrate ts-lint to eslint for io-functions-public #49

Merged
merged 6 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"ignorePatterns": [
"node_modules",
"generated",
"**/__tests__/*",
"**/__mocks__/*",
"Dangerfile.*",
"*.d.ts"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"extends": [
"@pagopa/eslint-config/strong",
],
"rules": {

}
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,7 @@ coverage

yarn-error.log

generated
generated
# eslint section
!.eslintrc.js
.eslintcache
1 change: 0 additions & 1 deletion Dangerfile.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// import custom DangerJS rules
// see http://danger.systems/js
// see https://github.com/teamdigitale/danger-plugin-digitalcitizenship/
// tslint:disable-next-line:prettier
import checkDangers from "danger-plugin-digitalcitizenship";

checkDangers();
34 changes: 17 additions & 17 deletions Info/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ import * as packageJson from "../package.json";
import { checkApplicationHealth, HealthCheck } from "../utils/healthcheck";

interface IInfo {
name: string;
version: string;
readonly name: string;
readonly version: string;
}

type InfoHandler = () => Promise<
IResponseSuccessJson<IInfo> | IResponseErrorInternal
>;

export function InfoHandler(healthCheck: HealthCheck): InfoHandler {
return () =>
healthCheck
.fold<IResponseSuccessJson<IInfo> | IResponseErrorInternal>(
problems => ResponseErrorInternal(problems.join("\n\n")),
_ =>
ResponseSuccessJson({
name: packageJson.name,
version: packageJson.version
})
)
.run();
}
export const InfoHandler = (
healthCheck: HealthCheck
): InfoHandler => (): ReturnType<InfoHandler> =>
healthCheck
.fold<IResponseSuccessJson<IInfo> | IResponseErrorInternal>(
problems => ResponseErrorInternal(problems.join("\n\n")),
_ =>
ResponseSuccessJson({
name: packageJson.name,
version: packageJson.version
})
)
.run();

export function Info(): express.RequestHandler {
export const Info = (): express.RequestHandler => {
const handler = InfoHandler(checkApplicationHealth());

return wrapRequestHandler(handler);
}
};
2 changes: 0 additions & 2 deletions ValidateProfileEmail/__tests__/handler.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* tslint:disable: no-any */

import { ResourceNotFoundCode } from "io-functions-commons/dist/src/utils/azure_storage";

import {
Expand Down
Loading