initial commit

This commit is contained in:
Sebastian Seedorf
2020-12-03 14:17:47 +01:00
commit c94c35ea9d
9 changed files with 3850 additions and 0 deletions

46
.eslintrc.js Normal file
View File

@@ -0,0 +1,46 @@
// eslint-disable-next-line no-undef
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
'no-null',
'promise',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:promise/recommended',
],
rules: {
'no-console': 'error',
'max-len': ['error', {'code': 128}],
'no-process-env': 'error',
'no-process-exit': 'error',
'no-null/no-null': 'error',
'no-useless-return': 'error',
'prefer-arrow-callback': 'warn',
'consistent-return': 'error',
'@typescript-eslint/explicit-function-return-type': [
'error', {
'allowExpressions': true,
},
],
'no-void': 'error',
'comma-spacing': 'error',
'comma-dangle': ['error', 'always-multiline'],
'comma-style': 'error',
'semi': 'error',
'no-implicit-coercion': 'error',
'quotes': ['error', 'single', 'avoid-escape'],
'keyword-spacing': 'error',
'semi-spacing': 'error',
'arrow-spacing': 'error',
'object-curly-spacing': 'error',
'array-bracket-spacing': 'error',
'key-spacing': 'error',
'block-spacing': 'error',
'promise/always-return': 'off',
},
};

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/node-check24-technical.iml" filepath="$PROJECT_DIR$/.idea/node-check24-technical.iml" />
</modules>
</component>
</project>

12
.idea/node-check24-technical.iml generated Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

3707
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

36
package.json Normal file
View File

@@ -0,0 +1,36 @@
{
"name": "check24-technical",
"version": "1.0.0",
"description": "Technical interview with check24",
"main": "out/index.ts",
"scripts": {
"test": "nyc mocha -r ts-node/register ./test/**/*.ts"
},
"repository": {
"type": "git",
"url": "https://git.sebse.de/sebse/node-check24-technical.git"
},
"author": "Sebastian Seedorf",
"license": "ISC",
"dependencies": {
"express": "^4.17.1",
"mocha": "^8.2.1",
"nyc": "^15.1.0"
},
"devDependencies": {
"@types/chai": "^4.2.14",
"@types/express": "^4.17.9",
"@types/mocha": "^8.0.4",
"@types/node": "^14.14.10",
"@types/rewire": "^2.5.28",
"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"chai": "^4.2.0",
"eslint": "^7.14.0",
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-promise": "^4.2.1",
"rewire": "^5.0.0",
"ts-node": "^9.1.0",
"typescript": "^4.1.2"
}
}

5
src/index.ts Normal file
View File

@@ -0,0 +1,5 @@
export function main(): string {
return 'Hello World';
}
main();

9
test/index.ts Normal file
View File

@@ -0,0 +1,9 @@
import {expect} from 'chai';
import {main} from '../src';
describe('index', () => {
it('main', () => {
const res = main();
expect(res).to.be.deep.equal('Hello World');
});
});

21
tsconfig.json Normal file
View File

@@ -0,0 +1,21 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"sourceMap": true,
"outDir": "./out",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"strict": true
},
"include": [
"./src/**/*.ts"
],
"exclude": [
"../node_modules",
"./public"
],
"ts-node": {
"files": true
}
}