Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoutV committed Apr 2, 2024
1 parent f8c61cc commit 9ca6088
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 61 deletions.
68 changes: 34 additions & 34 deletions frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
module.exports = {
"env": {
"browser": true,
"es2021": true
'env': {
'browser': true,
'es2021': true
},
"extends": [
"standard-with-typescript",
"plugin:vue/vue3-essential",
"plugin:prettier/recommended"
'extends': [
'standard-with-typescript',
'plugin:vue/vue3-essential',
'plugin:prettier/recommended'
],
"overrides": [
'overrides': [
{
"env": {
"node": true
'env': {
'node': true
},
"files": [
".eslintrc.{js,cjs}"
'files': [
'.eslintrc.{js,cjs}'
],
"parserOptions": {
"sourceType": "script",
},
'parserOptions': {
'sourceType': 'script'
}
}
],
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser" ,
"ecmaVersion": "latest",
"sourceType": "module",
"project": ["./tsconfig.json"],
"extraFileExtensions": [".vue"]
'parser': 'vue-eslint-parser',
'parserOptions': {
'parser': '@typescript-eslint/parser',
'ecmaVersion': 'latest',
'sourceType': 'module',
'project': ['./tsconfig.json'],
'extraFileExtensions': ['.vue']
},
"plugins": [
"vue",
"prettier"
'plugins': [
'vue',
'prettier'
],
"rules": {
"vue/multi-word-component-names": "off", // Disable rule that requires multi-word component names in Vue files
"@typescript-eslint/no-floating-promises": "off", // Disable rule that flags floating promises in .ts files
"@typescript-eslint/no-extraneous-class": "off", // Disable rule that flags usage of unnecessary classes in the codebase
"@typescript-eslint/unbound-method": "off", // Disable rule that refuses unbound methods that could scope `this`
"prettier/prettier": "error",
"function-paren-newline": "off",
"function-call-argument-newline": "off"
'rules': {
'vue/multi-word-component-names': 'off', // Disable rule that requires multi-word component names in Vue files
'@typescript-eslint/no-floating-promises': 'off', // Disable rule that flags floating promises in .ts files
'@typescript-eslint/no-extraneous-class': 'off', // Disable rule that flags usage of unnecessary classes in the codebase
'@typescript-eslint/unbound-method': 'off', // Disable rule that refuses unbound methods that could scope `this`
'prettier/prettier': "error",
'function-paren-newline': 'off',
'function-call-argument-newline': 'off'
}
}
};
1 change: 1 addition & 0 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"singleQuote": true,
"arrowParens": "always",
"wrapParens": "avoid",
"endOfLine": "auto",
"jsxBracketSameLine": true,
"bracketSameLine": true
}
4 changes: 2 additions & 2 deletions frontend/src/components/YearSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const props = defineProps<{ years: number[] }>();
const years = computed(() =>
props.years.map((year) => ({
label: `${year} - ${year + 1}`,
value: year
}))
value: year,
})),
);
/* Models */
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types/users/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class User {
* @param date
* @returns number
*/
public getAcademicYear(date: Date = new Date): number {
public getAcademicYear(date: Date = new Date()): number {
const year = date.getFullYear();

if (date.getMonth() >= 9) {
Expand Down
10 changes: 3 additions & 7 deletions frontend/src/views/courses/roles/StudentCourseView.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<script setup lang="ts">
</script>
<script setup lang="ts"></script>

<template>

<div/>
</template>

<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>
7 changes: 2 additions & 5 deletions frontend/src/views/courses/roles/TeacherCourseView.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<script setup lang="ts">
</script>

<template>

<div/>
</template>

<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>
18 changes: 6 additions & 12 deletions frontend/src/views/dashboard/roles/StudentDashboardView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import ButtonGroup from 'primevue/buttongroup';
import Button from 'primevue/button';
import Title from '@/components/layout/Title.vue';
import YearSelector from '@/components/YearSelector.vue';
import CourseList from '@/components/courses/CourseList.vue'
import CourseList from '@/components/courses/CourseList.vue';
import ProjectList from '@/components/projects/ProjectList.vue';
import { Student } from '@/types/users/Student.ts';
import { type Student } from '@/types/users/Student.ts';
import { PrimeIcons } from 'primevue/api';
import { useI18n } from 'vue-i18n';
import { computed, ref, watch } from 'vue';
Expand All @@ -23,11 +23,7 @@ const { courses, getCoursesByStudent } = useCourses();
/* State */
const selectedYear = ref<number>(props.student.getAcademicYear());
const filteredCourses = computed(() =>
courses.value?.filter((course) =>
course.academic_startyear === selectedYear.value
) ?? []
);
const filteredCourses = computed(() => courses.value?.filter((course) => course.academic_startyear === selectedYear.value) ?? []);
/* Watchers */
watch(
Expand All @@ -37,7 +33,7 @@ watch(
},
{
immediate: true,
}
},
);
</script>

Expand All @@ -50,7 +46,7 @@ watch(
<ButtonGroup class="flex align-items-center">
<YearSelector :years="student.academic_years" v-model="selectedYear" />
<RouterLink :to="{ name: 'courses' }">
<Button :icon="PrimeIcons.PLUS" icon-pos="right" class="custom-button" style="height:51px; width: 51px;" />
<Button :icon="PrimeIcons.PLUS" icon-pos="right" class="custom-button" style="height: 51px; width: 51px" />
</RouterLink>
</ButtonGroup>
</div>
Expand All @@ -69,6 +65,4 @@ watch(
<ProjectList :courses="filteredCourses" />
</template>

<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>

0 comments on commit 9ca6088

Please sign in to comment.