Skip to content
Open
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
35 changes: 35 additions & 0 deletions code/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
extends: 'airbnb-typescript/base',
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended', // Makes ESLint and Prettier play nicely together
'plugin:import/recommended',
'plugin:import/typescript',
],
ignorePatterns: ['**/dist/*'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.eslint.json',
},
plugins: ['prettier', 'unused-imports', 'import', 'simple-import-sort', 'sort-keys-fix'],
root: true,
rules: {
'import/first': 'error', // Ensures all imports are at the top of the file
'import/newline-after-import': 'error', // Ensures there’s a newline after the imports
'import/no-duplicates': 'error', // Merges import statements from the same file
'import/order': 'off', // Not compatible with simple-import-sort
'no-unused-vars': 'off', // Handled by @typescript-eslint/no-unused-vars
'simple-import-sort/exports': 'error', // Auto-formats exports
'simple-import-sort/imports': 'error', // Auto-formats imports
'sort-imports': 'off', // Not compatible with simple-import-sort
'sort-keys-fix/sort-keys-fix': ['error', 'asc', { natural: true }], // Sorts long object key lists alphabetically
'unused-imports/no-unused-imports': 'error', // Removes unused imports automatically,
'@typescript-eslint/no-explicit-any': 'warn', // Allows any type with a warning
},
overrides:[{
"files": ["**/*.test.ts"],
"rules": {
'simple-import-sort/imports': 'off', // for test files we would want to load the mocked up modules later so on sorting the mocking mechanism will not work
}
}]
};
39 changes: 39 additions & 0 deletions code/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# Testing
coverage/

# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# System Files
.DS_Store
Thumbs.db

deps.json
results.json
before-run-data.json

# packaged app
*.tar.gz
1 change: 1 addition & 0 deletions code/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact=true
4 changes: 4 additions & 0 deletions code/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Add files here to ignore them from prettier formatting

/dist

15 changes: 15 additions & 0 deletions code/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxSingleQuote": false,
"arrowParens": "always",
"proseWrap": "never",
"htmlWhitespaceSensitivity": "strict",
"endOfLine": "lf",
"organizeImportsSkipDestructiveCodeActions": true
}
3 changes: 3 additions & 0 deletions code/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
};
12 changes: 12 additions & 0 deletions code/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
collectCoverage: true,
coverageDirectory: 'coverage',
coverageThreshold: {
"**/*": {
branches: 60
}
},
coverageReporters: ['text'],
preset: 'ts-jest',
testEnvironment: 'node'
};
5 changes: 5 additions & 0 deletions code/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"execMap": {
"ts": "ts-node"
}
}
Loading