Skip to content

Commit

Permalink
[#IC-489] migrate ts-lint to eslint for io-functions-public (#49)
Browse files Browse the repository at this point in the history
* migrate ts-lint to eslint for io-functions-public

* fix azure pipeline

* fix linter errors

* Applied suggestions from PR

* removed more linter ignoring comments

* removed sonarjs linter ignoring comment
  • Loading branch information
arcogabbo authored May 30, 2022
1 parent 67dd800 commit 6ba3c68
Show file tree
Hide file tree
Showing 12 changed files with 1,769 additions and 431 deletions.
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

0 comments on commit 6ba3c68

Please sign in to comment.