-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move from tslint to eslint (#178)
* fix: move from tslint to eslint closes #159 * feat: add workit-cli for eslint * update workit template to 4.1.0 as well * fix: ignore tests folder * fix: add prettierignore file * ci: remove travis config * fix: convert examples to eslint Signed-off-by: Olivier Albertini <[email protected]>
- Loading branch information
1 parent
cfa88f9
commit 0dce14b
Showing
251 changed files
with
1,835 additions
and
1,620 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module.exports = { | ||
// prettier conflicts | ||
"no-underscore-dangle": "off", | ||
"max-len": "off", | ||
"max-classes-per-file": "off", | ||
"class-methods-use-this": "off", | ||
"no-await-in-loop": "off", | ||
"import/prefer-default-export": "off", | ||
"comma-dangle": "off", | ||
"object-curly-newline":"off", | ||
"arrow-parens": "off", | ||
"implicit-arrow-linebreak": "off", | ||
"prettier/prettier": "error", | ||
"@typescript-eslint/no-useless-constructor": "off", // not good with inversify | ||
"@typescript-eslint/no-misused-promises": "off", | ||
"@typescript-eslint/interface-name-prefix": ["error", { "prefixWithI": "always" }], | ||
"@typescript-eslint/explicit-member-accessibility": ["error", { | ||
"accessibility": "explicit", | ||
"overrides": { | ||
"accessors": "explicit", | ||
"constructors": "no-public", | ||
"methods": "explicit", | ||
"properties": "explicit", | ||
"parameterProperties": "explicit" | ||
} | ||
}], | ||
"@typescript-eslint/naming-convention": [ | ||
"error", | ||
{ | ||
"selector": "memberLike", | ||
"modifiers": ["private"], | ||
"format": ["camelCase", "UPPER_CASE"], | ||
"leadingUnderscore": "require" | ||
} | ||
], | ||
"header/header": [2, "block", [ | ||
`\n * Copyright (c) ${new Date().getFullYear()} Ville de Montreal. All rights reserved.\n * Licensed under the MIT license.\n * See LICENSE file in the project root for full license information.\n ` | ||
]] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
lib | ||
.vscode | ||
coverage | ||
*lock* | ||
*.md | ||
tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = { | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"prettier", | ||
"header" | ||
], | ||
"extends": [ | ||
"airbnb-typescript/base", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"prettier/@typescript-eslint" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": { | ||
...require('../../eslint.rules.js'), | ||
"no-console": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,37 @@ | ||
/*! | ||
* Copyright (c) 2019 Ville de Montreal. All rights reserved. | ||
/* | ||
* Copyright (c) 2020 Ville de Montreal. All rights reserved. | ||
* Licensed under the MIT license. | ||
* See LICENSE file in the project root for full license information. | ||
*/ | ||
// tslint:disable: no-floating-promises | ||
// tslint:disable: no-console | ||
|
||
import { SERVICE_IDENTIFIER as CORE_IDENTIFIER, TAG } from 'workit-camunda'; | ||
import { IoC, Worker } from 'workit-core'; | ||
import { HelloWorldTask } from '../tasks/helloWorldTask'; | ||
|
||
(async () => { | ||
enum LOCAL_IDENTIFIER { | ||
sample_activity = 'sample_activity' | ||
} | ||
enum LOCAL_IDENTIFIER { | ||
sampleActivity = 'sample_activity', | ||
} | ||
|
||
IoC.bindTo(HelloWorldTask, LOCAL_IDENTIFIER.sample_activity); | ||
const worker = IoC.get<Worker>(CORE_IDENTIFIER.worker, TAG.camundaBpm); // TAG.zeebe | ||
IoC.bindTo(HelloWorldTask, LOCAL_IDENTIFIER.sampleActivity); | ||
const worker = IoC.get<Worker>(CORE_IDENTIFIER.worker, TAG.camundaBpm); // TAG.zeebe | ||
|
||
const stop = () => { | ||
console.info('SIGTERM signal received.'); | ||
console.log('Closing worker'); | ||
worker | ||
.stop() | ||
.then(() => { | ||
console.log('worker closed'); | ||
process.exit(0); | ||
}) | ||
.catch((e: Error) => { | ||
console.log(e); | ||
process.exit(1); | ||
}); | ||
}; | ||
const stop = (): void => { | ||
console.info('SIGTERM signal received.'); | ||
console.log('Closing worker'); | ||
worker | ||
.stop() | ||
.then(() => { | ||
console.log('worker closed'); | ||
process.exit(0); | ||
}) | ||
.catch((e: Error) => { | ||
console.log(e); | ||
process.exit(1); | ||
}); | ||
}; | ||
|
||
worker.start(); | ||
worker.run(); | ||
worker.start(); | ||
worker.run(); | ||
|
||
process.on('SIGINT', stop); | ||
process.on('SIGTERM', stop); | ||
})(); | ||
process.on('SIGINT', stop); | ||
process.on('SIGTERM', stop); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
/*! | ||
* Copyright (c) 2019 Ville de Montreal. All rights reserved. | ||
/* | ||
* Copyright (c) 2020 Ville de Montreal. All rights reserved. | ||
* Licensed under the MIT license. | ||
* See LICENSE file in the project root for full license information. | ||
*/ | ||
|
||
import axios from 'axios'; | ||
import { TaskBase } from "workit-core"; | ||
import { TaskBase } from 'workit-core'; | ||
import { IMessage } from 'workit-types'; | ||
|
||
// tslint:disable:no-console | ||
export class HelloWorldTask extends TaskBase<IMessage> { | ||
public async execute(message: IMessage): Promise<IMessage> { | ||
const { properties } = message; | ||
|
||
console.log(`Executing task: ${properties.activityId}`); | ||
console.log(`${properties.bpmnProcessId}::${properties.processInstanceId} Servus!`); | ||
|
||
const response = await axios.get('https://jsonplaceholder.typicode.com/todos/1'); | ||
const { properties } = message; | ||
|
||
console.log('\ndata:'); | ||
console.log(response.data); | ||
console.log(`Executing task: ${properties.activityId}`); | ||
console.log(`${properties.bpmnProcessId}::${properties.processInstanceId} Servus!`); | ||
|
||
return message; | ||
const response = await axios.get('https://jsonplaceholder.typicode.com/todos/1'); | ||
|
||
console.log('\ndata:'); | ||
console.log(response.data); | ||
|
||
return message; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules/ | ||
lib/ | ||
.vscode | ||
coverage | ||
*lock* | ||
*.md | ||
tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = { | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"prettier", | ||
"header" | ||
], | ||
"extends": [ | ||
"airbnb-typescript/base", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"prettier/@typescript-eslint" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": { | ||
...require('../../eslint.rules.js'), | ||
"no-console": "off" | ||
} | ||
} |
Oops, something went wrong.