Skip to content

Commit

Permalink
Re-initialize the Vue project
Browse files Browse the repository at this point in the history
  • Loading branch information
frostburn committed Nov 30, 2023
1 parent 8e0d20c commit 1bda04f
Show file tree
Hide file tree
Showing 23 changed files with 2,982 additions and 1,151 deletions.
39 changes: 17 additions & 22 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
/* eslint-env node */
require("@rushstack/eslint-patch/modern-module-resolution");
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/eslint-config-typescript/recommended",
"@vue/eslint-config-prettier",
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
],
env: {
"vue/setup-compiler-macros": true,
},
overrides: [
{
files: ["cypress/integration/**.spec.{js,ts,jsx,tsx}"],
extends: ["plugin:cypress/recommended"],
},
files: [
'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}'
],
'extends': [
'plugin:cypress/recommended'
]
}
],
rules: {
"no-empty": 0,
"no-constant-condition": 0,
"@typescript-eslint/no-empty-function": 0,
"no-case-declarations": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/ban-ts-comment": 0,
},
};
parserOptions: {
ecmaVersion: 'latest'
}
}
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
8 changes: 7 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin", "ZixuanChen.vitest-explorer"]
"recommendations": [
"Vue.volar",
"Vue.vscode-typescript-vue-plugin",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"ZixuanChen.vitest-explorer"
]
}
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,18 @@ npm run test:unit
### Run End-to-End Tests with [Cypress](https://www.cypress.io/)

```sh
npm run build
npm run test:e2e # or `npm run test:e2e:ci` for headless testing
npm run test:e2e:dev
```

Please note that `cypress` expects the base URL to be `"/"`. Modify your local `vite.config.ts` accordingly before running e2e tests.
This runs the end-to-end tests against the Vite development server.
It is much faster than the production build.

But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments):

```sh
npm run build
npm run test:e2e
```

### Lint with [ESLint](https://eslint.org/)

Expand Down
8 changes: 8 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from 'cypress'

export default defineConfig({
e2e: {
specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}',
baseUrl: 'http://localhost:4173'
}
})
3 changes: 0 additions & 3 deletions cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://docs.cypress.io/api/introduction/api.html
// https://on.cypress.io/api

describe("Basic test", () => {
it("visits the app root url", () => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/tsconfig.json → cypress/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "@vue/tsconfig/tsconfig.web.json",
"include": ["./integration/**/*", "./support/**/*"],
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["./**/*", "../support/**/*"],
"compilerOptions": {
"isolatedModules": false,
"target": "es5",
Expand Down
19 changes: 0 additions & 19 deletions cypress/plugins/index.ts

This file was deleted.

9 changes: 0 additions & 9 deletions cypress/plugins/tsconfig.json

This file was deleted.

16 changes: 15 additions & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.js shows you how to
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
Expand All @@ -23,3 +24,16 @@
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }

export {}
2 changes: 1 addition & 1 deletion cypress/support/index.ts → cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import "./commands";
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading

0 comments on commit 1bda04f

Please sign in to comment.