Skip to content

Commit

Permalink
Updated settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-sth committed Oct 26, 2023
1 parent b85210f commit 08112ef
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 81 deletions.
6 changes: 1 addition & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# /node_modules/* in the project root is ignored by default
# build artefacts
dist/*
coverage/*
# data definition files
**/*.d.ts
# 3rd party libs
/src/public/

# custom definition files
/src/types/
65 changes: 23 additions & 42 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,30 @@
module.exports = {
'env': {
'browser': true,
'es2021': true
env: {
browser: true,
es2021: true,
},
'extends': [
'eslint:recommended',
'plugin:@typescript-eslint/recommended'
],
'overrides': [
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
overrides: [
{
'env': {
'node': true
env: {
node: true,
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script',
},
'files': [
'.eslintrc.{js,cjs}'
],
'parserOptions': {
'sourceType': 'script'
}
}
},
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'ecmaVersion': 'latest',
'sourceType': 'module'
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
rules: {
indent: ['error', 4],
'linebreak-style': ['error', 'windows'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
},
'plugins': [
'@typescript-eslint'
],
'rules': {
'indent': [
'error',
4
],
'linebreak-style': [
'error',
'windows'
],
'quotes': [
'error',
'single'
],
'semi': [
'error',
'always'
]
}
};
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"tabWidth": 4,
"singleQuote": true
}
25 changes: 12 additions & 13 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug TypeScript",
"program": "${workspaceFolder}/path/to/your/app.ts",
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"sourceMaps": true,
"protocol": "inspector"
}
]
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug TypeScript",
"program": "${workspaceFolder}/src/index.ts",
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"sourceMaps": true
}
]
}
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// eslint-disable-next-line no-undef
module.exports = {
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', { tsconfig: 'tsconfig.json' }],
'^.+\\.(ts)$': ['ts-jest', { tsconfig: 'tsconfig.json' }],
},
moduleFileExtensions: ['ts', 'js'],
testMatch: ['**/test/**/*.test.(ts|js)'],
Expand Down
4 changes: 2 additions & 2 deletions src/api/travelModule.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios, { AxiosError } from 'axios';
import axios from 'axios';
const apiKey = 'AIzaSyD0uFBrEpD6YHbEgZC8JfbKehO8a1nMCwY';
const transportationMode: 'driving-car' | 'foot-walking' | 'transit' =
'transit';
Expand Down Expand Up @@ -62,7 +62,7 @@ async function getTravelTime(
} else {
return null;
}
} catch (error: any) {
} catch (error) {
console.error('Error fetching travel time:', error.message);
return null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/types/Group.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface Group {
_id: number;
path: string[];
studentIds: string[];
_id: number;
path: string[];
studentIds: string[];
}
14 changes: 7 additions & 7 deletions src/types/Polls.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
interface PollChoice {
_id: string;
text: string;
eventId: string;
studentIds: string[];
_id: string;
text: string;
eventId: string;
studentIds: string[];
}

interface PollQuestion {
_id: string;
text: string;
choices: PollChoice[];
_id: string;
text: string;
choices: PollChoice[];
}
export default PollQuestion;

Expand Down
8 changes: 4 additions & 4 deletions src/types/Project.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interface Project {
_id: string;
name: string;
idsThatAreRequiredForEveryone: string[];
relatedPolls: string[];
_id: string;
name: string;
idsThatAreRequiredForEveryone: string[];
relatedPolls: string[];
}
export default Project;
6 changes: 3 additions & 3 deletions src/types/Room.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interface Room {
roomNumber: number;
studentIds: string[];
gender: "m" | "f";
roomNumber: number;
studentIds: string[];
gender: 'm' | 'f';
}

export default Room;
2 changes: 1 addition & 1 deletion src/types/Student.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
interface Student {
_id: string;
_id: string;
}

export default Student;

0 comments on commit 08112ef

Please sign in to comment.