Skip to content

Commit

Permalink
Update all dependencies and fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ajuvonen committed Dec 16, 2024
1 parent 2280c9d commit 023e26b
Show file tree
Hide file tree
Showing 10 changed files with 4,621 additions and 3,062 deletions.
21 changes: 0 additions & 21 deletions .eslintrc.cjs

This file was deleted.

35 changes: 8 additions & 27 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
/// <reference types="cypress" />

declare global {
namespace Cypress {
interface Chainable {
getByTestId(dataTestAttribute: string, args?: any): Chainable<JQuery<HTMLElement>>;
addTraining(addWeek?: boolean): void;
toRoute(route: string): void;
}
}
}

Cypress.Commands.add('getByTestId', (selector, ...args) => {
return cy.get(`[data-test-id=${selector}]`, ...args);
Cypress.Commands.add('getByTestId', (testId: string) => {
return cy.get(`[data-test-id="${testId}"]`);
});

Cypress.Commands.add('toRoute', (route) => {
Expand All @@ -27,19 +15,12 @@ Cypress.Commands.add('addTraining', (addWeek = true) => {
cy.getByTestId('week-0-add-training-button').click();
cy.getByTestId('edit-training-activity').click();
cy.getByTestId('edit-training-activity-badminton').click();
cy.getByTestId('edit-training-title')
.type('My training')
.getByTestId('edit-training-location')
.type('Sport hall')
.getByTestId('edit-training-duration')
.find('input')
.type('.5')
.getByTestId('edit-training-instructions')
.type('Take it easy')
.getByTestId('edit-training-intensity')
.type('{leftarrow}{rightarrow}')
.getByTestId('edit-training-save-button')
.click();
cy.getByTestId('edit-training-title').type('My training');
cy.getByTestId('edit-training-location').type('Sport hall');
cy.getByTestId('edit-training-duration').find('input').type('.5');
cy.getByTestId('edit-training-instructions').type('Take it easy');
cy.getByTestId('edit-training-intensity').type('{leftarrow}{rightarrow}');
cy.getByTestId('edit-training-save-button').click();
});

export {};
9 changes: 9 additions & 0 deletions cypress/support/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// <reference types="cypress" />

declare namespace Cypress {
interface Chainable {
getByTestId(testId: string): Chainable<Subject>;
addTraining(addWeek?: boolean): void;
toRoute(route: string): void;
}
}
31 changes: 31 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import pluginVue from 'eslint-plugin-vue';
import vueTsEslintConfig from '@vue/eslint-config-typescript';
import pluginVitest from '@vitest/eslint-plugin';
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting';
import {includeIgnoreFile} from '@eslint/compat';
import pluginCypress from 'eslint-plugin-cypress/flat'
import pluginVueA11y from 'eslint-plugin-vuejs-accessibility';
import {fileURLToPath} from 'node:url';

export default [
includeIgnoreFile(fileURLToPath(new URL('./.gitignore', import.meta.url))),
{
name: 'app/files-to-lint',
files: ['**/*.{ts,mts,tsx,vue}'],
},
...pluginVueA11y.configs['flat/recommended'],
...pluginVue.configs['flat/essential'],
...vueTsEslintConfig(),
{
...pluginVitest.configs.recommended,
files: ['src/**/__tests__/*'],
},
{
...pluginCypress.configs.recommended,
files: [
'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}',
'cypress/support/**/*.{js,ts,jsx,tsx}'
],
},
skipFormatting,
];
Loading

0 comments on commit 023e26b

Please sign in to comment.