Skip to content

Commit 98f56ad

Browse files
authored
fix: proper support for extends field, fixes #136 (#143)
1 parent 9a1ed8a commit 98f56ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1290
-84
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
2+
charset = utf-8
3+
indent_size = 2
4+
indent_style = space
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
.DS_Store
12+
dist
13+
dist-ssr
14+
coverage
15+
*.local
16+
17+
/cypress/videos/
18+
/cypress/screenshots/
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/extensions.json
23+
.idea
24+
*.suo
25+
*.ntvs*
26+
*.njsproj
27+
*.sln
28+
*.sw?
29+
30+
*.tsbuildinfo
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
{
3+
"$schema": "https://json.schemastore.org/prettierrc",
4+
"semi": false,
5+
"singleQuote": true,
6+
"arrowParens": "avoid"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"Vue.volar",
4+
"vitest.explorer",
5+
"dbaeumer.vscode-eslint",
6+
"esbenp.prettier-vscode"
7+
]
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# disable-type-checked-for-yml
2+
3+
This template should help get you started developing with Vue 3 in Vite.
4+
5+
## Recommended IDE Setup
6+
7+
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
8+
9+
## Type Support for `.vue` Imports in TS
10+
11+
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
12+
13+
## Customize configuration
14+
15+
See [Vite Configuration Reference](https://vite.dev/config/).
16+
17+
## Project Setup
18+
19+
```sh
20+
npm install
21+
```
22+
23+
### Compile and Hot-Reload for Development
24+
25+
```sh
26+
npm run dev
27+
```
28+
29+
### Type-Check, Compile and Minify for Production
30+
31+
```sh
32+
npm run build
33+
```
34+
35+
### Run Unit Tests with [Vitest](https://vitest.dev/)
36+
37+
```sh
38+
npm run test:unit
39+
```
40+
41+
### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
42+
43+
```sh
44+
npm run test:e2e:dev
45+
```
46+
47+
This runs the end-to-end tests against the Vite development server.
48+
It is much faster than the production build.
49+
50+
But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments):
51+
52+
```sh
53+
npm run build
54+
npm run test:e2e
55+
```
56+
57+
### Lint with [ESLint](https://eslint.org/)
58+
59+
```sh
60+
npm run lint
61+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from 'cypress'
2+
3+
export default defineConfig({
4+
e2e: {
5+
specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}',
6+
baseUrl: 'http://localhost:4173'
7+
}
8+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// https://on.cypress.io/api
2+
3+
describe('My First Test', () => {
4+
it('visits the app root url', () => {
5+
cy.visit('/')
6+
cy.contains('h1', 'You did it!')
7+
})
8+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/// <reference types="cypress" />
2+
// ***********************************************
3+
// This example commands.ts shows you how to
4+
// create various custom commands and overwrite
5+
// existing commands.
6+
//
7+
// For more comprehensive examples of custom
8+
// commands please read more here:
9+
// https://on.cypress.io/custom-commands
10+
// ***********************************************
11+
//
12+
//
13+
// -- This is a parent command --
14+
// Cypress.Commands.add('login', (email, password) => { ... })
15+
//
16+
//
17+
// -- This is a child command --
18+
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
19+
//
20+
//
21+
// -- This is a dual command --
22+
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
23+
//
24+
//
25+
// -- This will overwrite an existing command --
26+
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
27+
//
28+
// declare global {
29+
// namespace Cypress {
30+
// interface Chainable {
31+
// login(email: string, password: string): Chainable<void>
32+
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
33+
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
34+
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
35+
// }
36+
// }
37+
// }
38+
39+
export {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// ***********************************************************
2+
// This example support/index.js is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands'
18+
19+
// Alternatively you can use CommonJS syntax:
20+
// require('./commands')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "@vue/tsconfig/tsconfig.dom.json",
3+
"include": ["./e2e/**/*", "./support/**/*"],
4+
"compilerOptions": {
5+
"isolatedModules": false,
6+
"types": ["cypress"]
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import pluginVue from 'eslint-plugin-vue'
2+
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
3+
import pluginVitest from '@vitest/eslint-plugin'
4+
import pluginCypress from 'eslint-plugin-cypress/flat'
5+
import pluginYml from 'eslint-plugin-yml';
6+
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
7+
8+
export default defineConfigWithVueTs(
9+
{
10+
name: 'app/files-to-lint',
11+
files: ['**/*.{ts,mts,tsx,vue,yml,yaml}'],
12+
},
13+
14+
{
15+
name: 'app/files-to-ignore',
16+
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
17+
},
18+
19+
pluginVue.configs['flat/essential'],
20+
vueTsConfigs.recommendedTypeChecked,
21+
22+
{
23+
...pluginVitest.configs.recommended,
24+
files: ['src/**/__tests__/*'],
25+
},
26+
27+
{
28+
...pluginCypress.configs.recommended,
29+
files: [
30+
'cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}',
31+
'cypress/support/**/*.{js,ts,jsx,tsx}',
32+
],
33+
},
34+
skipFormatting,
35+
36+
...pluginYml.configs['flat/recommended'],
37+
38+
{
39+
files: ["**/*.yml", "**/*.yaml"],
40+
extends: [vueTsConfigs.disableTypeChecked],
41+
},
42+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<link rel="icon" href="/favicon.ico">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "disable-type-checked-for-yml",
3+
"version": "0.0.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "run-p type-check \"build-only {@}\" --",
9+
"preview": "vite preview",
10+
"test:unit": "vitest",
11+
"test:e2e": "start-server-and-test preview http://localhost:4173 'cypress run --e2e'",
12+
"test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'",
13+
"build-only": "vite build",
14+
"type-check": "vue-tsc --build --force",
15+
"lint": "eslint . --fix",
16+
"format": "prettier --write src/"
17+
},
18+
"dependencies": {
19+
"pinia": "^2.3.1",
20+
"vue": "^3.5.13",
21+
"vue-router": "^4.5.0"
22+
},
23+
"devDependencies": {
24+
"@tsconfig/node20": "^20.1.4",
25+
"@types/jsdom": "^21.1.7",
26+
"@types/node": "^20.17.14",
27+
"@vitejs/plugin-vue": "^5.2.1",
28+
"@vitejs/plugin-vue-jsx": "^4.1.1",
29+
"@vitest/eslint-plugin": "^1.1.25",
30+
"@vue/eslint-config-prettier": "^10.2.0",
31+
"@vue/eslint-config-typescript": "workspace:*",
32+
"@vue/test-utils": "^2.4.6",
33+
"@vue/tsconfig": "^0.7.0",
34+
"cypress": "^14.0.0",
35+
"eslint": "^9.18.0",
36+
"eslint-plugin-cypress": "^4.1.0",
37+
"eslint-plugin-vue": "^9.32.0",
38+
"eslint-plugin-yml": "^1.16.0",
39+
"jsdom": "^26.0.0",
40+
"npm-run-all2": "^7.0.2",
41+
"prettier": "^3.4.2",
42+
"start-server-and-test": "^2.0.10",
43+
"typescript": "~5.7.3",
44+
"vite": "^6.0.10",
45+
"vite-plugin-vue-devtools": "^7.7.0",
46+
"vitest": "^3.0.2",
47+
"vue-tsc": "^2.2.0"
48+
}
49+
}
Binary file not shown.

0 commit comments

Comments
 (0)