-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rsbuild-vue3-eslint example (#31)
- Loading branch information
1 parent
210de64
commit 4f97a24
Showing
12 changed files
with
159 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2021: true }, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:vue/vue3-recommended", | ||
], | ||
ignorePatterns: ["dist", ".eslintrc.cjs"], | ||
parser: "vue-eslint-parser", | ||
parserOptions: { | ||
parser: "@typescript-eslint/parser", | ||
sourceType: "module", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Local | ||
.DS_Store | ||
*.local | ||
*.log* | ||
|
||
# Dist | ||
node_modules | ||
dist/ | ||
|
||
# IDE | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Rsbuild Project | ||
|
||
## Setup | ||
|
||
Install the dependencies: | ||
|
||
```bash | ||
pnpm install | ||
``` | ||
|
||
## Get Started | ||
|
||
Start the dev server: | ||
|
||
```bash | ||
pnpm dev | ||
``` | ||
|
||
Build the app for production: | ||
|
||
```bash | ||
pnpm build | ||
``` | ||
|
||
Preview the production build locally: | ||
|
||
```bash | ||
pnpm preview | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "rsbuild-vue3-eslint", | ||
"private": true, | ||
"version": "1.0.0", | ||
"scripts": { | ||
"dev": "rsbuild dev --open", | ||
"build": "rsbuild build", | ||
"preview": "rsbuild preview" | ||
}, | ||
"dependencies": { | ||
"vue": "^3.4.19" | ||
}, | ||
"devDependencies": { | ||
"@rsbuild/core": "^0.4.8", | ||
"@rsbuild/plugin-eslint": "^0.4.8", | ||
"@rsbuild/plugin-vue": "^0.4.8", | ||
"@typescript-eslint/eslint-plugin": "^7.1.0", | ||
"@typescript-eslint/parser": "^7.1.0", | ||
"eslint": "^8.57.0", | ||
"eslint-plugin-vue": "^9.22.0", | ||
"typescript": "^5.3.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { defineConfig } from "@rsbuild/core"; | ||
import { pluginVue } from "@rsbuild/plugin-vue"; | ||
import { pluginEslint } from "@rsbuild/plugin-eslint"; | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
pluginVue(), | ||
pluginEslint({ | ||
eslintPluginOptions: { | ||
extensions: [".js", ".jsx", ".ts", ".tsx", ".vue"], | ||
}, | ||
}), | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<div class="content"> | ||
<h1>Rsbuild with Vue</h1> | ||
<p>Start building amazing things with Rsbuild.</p> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.content { | ||
display: flex; | ||
min-height: 100vh; | ||
line-height: 1.1; | ||
text-align: center; | ||
flex-direction: column; | ||
justify-content: center; | ||
} | ||
.content h1 { | ||
font-size: 3.6rem; | ||
font-weight: 700; | ||
} | ||
.content p { | ||
font-size: 1.2rem; | ||
font-weight: 400; | ||
opacity: 0.5; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/// <reference types="@rsbuild/core/types" /> | ||
|
||
declare module '*.vue' { | ||
import type { DefineComponent } from 'vue'; | ||
|
||
// eslint-disable-next-line | ||
const component: DefineComponent<{}, {}, any>; | ||
export default component; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
body { | ||
margin: 0; | ||
color: #fff; | ||
font-family: Inter, Avenir, Helvetica, Arial, sans-serif; | ||
background-image: linear-gradient(to bottom, #020917, #101725); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import './index.css'; | ||
import { createApp } from 'vue'; | ||
import App from './App.vue'; | ||
|
||
createApp(App).mount('#root'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"lib": ["DOM", "ES2020"], | ||
"module": "ESNext", | ||
"jsx": "react-jsx", | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"isolatedModules": true, | ||
"resolveJsonModule": true, | ||
"moduleResolution": "bundler", | ||
"useDefineForClassFields": true | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters