Skip to content

Commit 31d1ca4

Browse files
committed
feat: fixes and a few more examples
1 parent f1d244f commit 31d1ca4

File tree

310 files changed

+14521
-680
lines changed

Some content is hidden

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

310 files changed

+14521
-680
lines changed

Diff for: .eslintrc.js

-21
This file was deleted.

Diff for: README.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ A part of its design is that this config may implicitly depend on
1212
other parts of `create-vue` setups, such as `eslint-plugin-vue` being
1313
extended in the same resulting config.
1414

15-
> Note: the current version doesn't support the legacy `.eslintrc*` configuraion format. For that you need to use version 9 or earlier. See the [corresponding README](https://www.npmjs.com/package/@vue/eslint-config-typescript/v/legacy-eslintrc) for more usage instructions.
15+
> [!NOTE]
16+
> The current version doesn't support the legacy `.eslintrc*` configuraion format. For that you need to use version 9 or earlier. See the [corresponding README](https://www.npmjs.com/package/@vue/eslint-config-typescript/v/legacy-eslintrc) for more usage instructions.
1617
1718
## Installation
1819

@@ -36,7 +37,7 @@ import vueTsEslintConfig from "@vue/eslint-config-typescript";
3637
export default [
3738
...pluginVue.configs["flat/essential"],
3839
...vueTsEslintConfig(),
39-
}]
40+
]
4041
```
4142

4243
The above configuration enables [the essential rules for Vue 3](https://eslint.vuejs.org/rules/#priority-a-essential-error-prevention) and [the recommended rules for TypeScript](https://typescript-eslint.io/rules/?=recommended).
@@ -54,14 +55,15 @@ export default [
5455
...pluginVue.configs["flat/essential"],
5556

5657
...vueTsEslintConfig({
57-
// Supports all the recommended configurations in https://typescript-eslint.io/users/configs#recommended-configurations
58+
// Optional: extend additional configurations from `typescript-eslint`.
59+
// Supports all the configurations in https://typescript-eslint.io/users/configs#recommended-configurations
5860
extends: [
5961
// By default, only the recommended rules are enabled.
6062
"recommended",
6163
// You can also manually enable the stylistic rules.
6264
// "stylistic",
6365

64-
// The ones with `-type-checked` are not yet tested.
66+
// [!NOTE] The ones with `-type-checked` are not yet tested.
6567

6668
// Other utility configurations, such as `eslint-recommended`,
6769
// are also extendable here. But we don't recommend using them directly.
@@ -72,24 +74,24 @@ export default [
7274
supportedScriptLangs: {
7375
ts: true,
7476

75-
// [Discouraged]
77+
// [!DISCOURAGED]
7678
// Set to `true` to allow plain `<script>` or `<script setup>` blocks.
7779
// This might result-in false positive or negatives in some rules for `.vue` files.
7880
// Note you also need to configure `allowJs: true` in corresponding `tsconfig.json` files.
7981
js: false,
8082

81-
// [Strongly discouraged]
83+
// [!STRONGLY DISCOURAGED]
8284
// Set to `true` to allow `<script lang="tsx">` blocks.
8385
// This would be in conflict with all type-aware rules.
8486
tsx: false,
8587

86-
// [Strongly discouraged]
88+
// [!STRONGLY DISCOURAGED]
8789
// Set to `true` to allow `<script lang="jsx">` blocks.
8890
// This would be in conflict with all type-aware rules and may result in false positives.
8991
jsx: false,
9092
},
9193

92-
// [Not yet implemented]
94+
// [!NOT YET IMPLEMENTED]
9395
// <https://github.com/vuejs/eslint-plugin-vue/issues/1910#issuecomment-1819993961>
9496
// Optional: the root directory to resolve the `.vue` files, defaults to `process.cwd()`.
9597
//

Diff for: examples/allow-js/.gitignore

+30
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

Diff for: examples/allow-js/.vscode/extensions.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"Vue.volar",
4+
"dbaeumer.vscode-eslint"
5+
]
6+
}

Diff for: examples/allow-js/README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# allow-js
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://vitejs.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+
### Lint with [ESLint](https://eslint.org/)
36+
37+
```sh
38+
npm run lint
39+
```

Diff for: examples/allow-js/env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

Diff for: examples/allow-js/eslint.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import pluginVue from "eslint-plugin-vue";
2+
import vueTsEslintConfig from "@vue/eslint-config-typescript";
3+
4+
export default [
5+
...pluginVue.configs["flat/essential"],
6+
...vueTsEslintConfig({
7+
supportedScriptLangs: {
8+
ts: true,
9+
js: true
10+
}
11+
}),
12+
]

Diff for: examples/allow-js/index.html

+13
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>

Diff for: examples/allow-js/package.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "allow-js",
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+
"build-only": "vite build",
11+
"type-check": "vue-tsc --build --force",
12+
"lint": "eslint . --fix"
13+
},
14+
"dependencies": {
15+
"vue": "^3.5.6"
16+
},
17+
"devDependencies": {
18+
"@tsconfig/node20": "^20.1.4",
19+
"@types/node": "^20.16.5",
20+
"@vitejs/plugin-vue": "^5.1.4",
21+
"@vue/eslint-config-typescript": "workspace:*",
22+
"@vue/tsconfig": "^0.5.1",
23+
"eslint": "^9.10.0",
24+
"eslint-plugin-vue": "^9.28.0",
25+
"npm-run-all2": "^6.2.3",
26+
"typescript": "~5.5.4",
27+
"vite": "^5.4.6",
28+
"vue-tsc": "^2.1.6"
29+
}
30+
}

Diff for: examples/allow-js/public/favicon.ico

4.19 KB
Binary file not shown.

Diff for: examples/allow-js/src/App.vue

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<script setup>
2+
import HelloWorld from './components/HelloWorld.vue'
3+
import TheWelcome from './components/TheWelcome.vue'
4+
</script>
5+
6+
<template>
7+
<header>
8+
<img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" />
9+
10+
<div class="wrapper">
11+
<HelloWorld msg="You did it!" />
12+
</div>
13+
</header>
14+
15+
<main>
16+
<TheWelcome />
17+
</main>
18+
</template>
19+
20+
<style scoped>
21+
header {
22+
line-height: 1.5;
23+
}
24+
25+
.logo {
26+
display: block;
27+
margin: 0 auto 2rem;
28+
}
29+
30+
@media (min-width: 1024px) {
31+
header {
32+
display: flex;
33+
place-items: center;
34+
padding-right: calc(var(--section-gap) / 2);
35+
}
36+
37+
.logo {
38+
margin: 0 2rem 0 0;
39+
}
40+
41+
header .wrapper {
42+
display: flex;
43+
place-items: flex-start;
44+
flex-wrap: wrap;
45+
}
46+
}
47+
</style>

Diff for: examples/allow-js/src/assets/base.css

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/* color palette from <https://github.com/vuejs/theme> */
2+
:root {
3+
--vt-c-white: #ffffff;
4+
--vt-c-white-soft: #f8f8f8;
5+
--vt-c-white-mute: #f2f2f2;
6+
7+
--vt-c-black: #181818;
8+
--vt-c-black-soft: #222222;
9+
--vt-c-black-mute: #282828;
10+
11+
--vt-c-indigo: #2c3e50;
12+
13+
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
14+
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
15+
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
16+
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
17+
18+
--vt-c-text-light-1: var(--vt-c-indigo);
19+
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
20+
--vt-c-text-dark-1: var(--vt-c-white);
21+
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
22+
}
23+
24+
/* semantic color variables for this project */
25+
:root {
26+
--color-background: var(--vt-c-white);
27+
--color-background-soft: var(--vt-c-white-soft);
28+
--color-background-mute: var(--vt-c-white-mute);
29+
30+
--color-border: var(--vt-c-divider-light-2);
31+
--color-border-hover: var(--vt-c-divider-light-1);
32+
33+
--color-heading: var(--vt-c-text-light-1);
34+
--color-text: var(--vt-c-text-light-1);
35+
36+
--section-gap: 160px;
37+
}
38+
39+
@media (prefers-color-scheme: dark) {
40+
:root {
41+
--color-background: var(--vt-c-black);
42+
--color-background-soft: var(--vt-c-black-soft);
43+
--color-background-mute: var(--vt-c-black-mute);
44+
45+
--color-border: var(--vt-c-divider-dark-2);
46+
--color-border-hover: var(--vt-c-divider-dark-1);
47+
48+
--color-heading: var(--vt-c-text-dark-1);
49+
--color-text: var(--vt-c-text-dark-2);
50+
}
51+
}
52+
53+
*,
54+
*::before,
55+
*::after {
56+
box-sizing: border-box;
57+
margin: 0;
58+
font-weight: normal;
59+
}
60+
61+
body {
62+
min-height: 100vh;
63+
color: var(--color-text);
64+
background: var(--color-background);
65+
transition:
66+
color 0.5s,
67+
background-color 0.5s;
68+
line-height: 1.6;
69+
font-family:
70+
Inter,
71+
-apple-system,
72+
BlinkMacSystemFont,
73+
'Segoe UI',
74+
Roboto,
75+
Oxygen,
76+
Ubuntu,
77+
Cantarell,
78+
'Fira Sans',
79+
'Droid Sans',
80+
'Helvetica Neue',
81+
sans-serif;
82+
font-size: 15px;
83+
text-rendering: optimizeLegibility;
84+
-webkit-font-smoothing: antialiased;
85+
-moz-osx-font-smoothing: grayscale;
86+
}

Diff for: examples/allow-js/src/assets/logo.svg

+1
Loading

Diff for: examples/allow-js/src/assets/main.css

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@import './base.css';
2+
3+
#app {
4+
max-width: 1280px;
5+
margin: 0 auto;
6+
padding: 2rem;
7+
font-weight: normal;
8+
}
9+
10+
a,
11+
.green {
12+
text-decoration: none;
13+
color: hsla(160, 100%, 37%, 1);
14+
transition: 0.4s;
15+
padding: 3px;
16+
}
17+
18+
@media (hover: hover) {
19+
a:hover {
20+
background-color: hsla(160, 100%, 37%, 0.2);
21+
}
22+
}
23+
24+
@media (min-width: 1024px) {
25+
body {
26+
display: flex;
27+
place-items: center;
28+
}
29+
30+
#app {
31+
display: grid;
32+
grid-template-columns: 1fr 1fr;
33+
padding: 0 2rem;
34+
}
35+
}

0 commit comments

Comments
 (0)