Skip to content

Commit

Permalink
chore: fix a few eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Nov 7, 2022
1 parent 6ba7da5 commit 8cd1f25
Show file tree
Hide file tree
Showing 12 changed files with 1,414 additions and 28 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Expand Up @@ -28,7 +28,9 @@
// Demote this to warning as long as we are still using cjs modules
"import/named": "warn",
// Import order is handled by prettier (which is incompatible with this rule: https://github.com/simonhaenisch/prettier-plugin-organize-imports/issues/65)
"import/order": "off"
"import/order": "off",
// Disable vue2-specific rules (until https://github.com/nuxt/eslint-config/issues/216 is fixed)
"vue/no-v-model-argument": "off"
},
"overrides": [
{
Expand Down
24 changes: 13 additions & 11 deletions examples/vite/src/App.vue
Expand Up @@ -4,17 +4,19 @@ import TheWelcome from './components/TheWelcome.vue'
</script>

<template>
<header>
<img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" />

<div class="wrapper">
<HelloWorld msg="You did it!" />
</div>
</header>

<main>
<TheWelcome />
</main>
<div>
<header>
<img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" />

<div class="wrapper">
<HelloWorld msg="You did it!" />
</div>
</header>

<main>
<TheWelcome />
</main>
</div>
</template>

<style scoped>
Expand Down
6 changes: 3 additions & 3 deletions examples/vite/src/components/Button.vue
@@ -1,13 +1,13 @@
<template>
<button type="button" :class="classes" @click="onClick" :style="style">{{ label }}</button>
<button type="button" :class="classes" :style="style" @click="onClick">{{ label }}</button>
</template>

<script>
import './button.css';
import { reactive, computed } from 'vue';
export default {
name: 'my-button',
name: 'MyButton',
props: {
label: {
Expand All @@ -21,7 +21,7 @@ export default {
size: {
type: String,
validator: function (value) {
return ['small', 'medium', 'large'].indexOf(value) !== -1;
return ['small', 'medium', 'large'].includes(value);
},
},
backgroundColor: {
Expand Down
10 changes: 5 additions & 5 deletions examples/vite/src/components/Header.vue
Expand Up @@ -21,10 +21,10 @@
<h1>Acme</h1>
</div>
<div>
<span class="welcome" v-if="user">Welcome, <b>{{ user.name }}</b>!</span>
<my-button size="small" @click="$emit('logout')" label="Log out" v-if="user" />
<my-button size="small" @click="$emit('login')" label="Log in" v-if="!user" />
<my-button primary size="small" @click="$emit('createAccount')" label="Sign up" v-if="!user" />
<span v-if="user" class="welcome">Welcome, <b>{{ user.name }}</b>!</span>
<my-button v-if="user" size="small" label="Log out" @click="$emit('logout')" />
<my-button v-if="!user" size="small" label="Log in" @click="$emit('login')" />
<my-button v-if="!user" primary size="small" label="Sign up" @click="$emit('createAccount')" />
</div>
</div>
</header>
Expand All @@ -35,7 +35,7 @@ import './header.css';
import MyButton from './Button.vue';
export default {
name: 'my-header',
name: 'MyHeader',
components: { MyButton },
Expand Down
4 changes: 2 additions & 2 deletions examples/vite/src/components/Page.vue
Expand Up @@ -46,8 +46,8 @@
<svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd">
<path
d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z"
id="a"
d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z"
fill="#999"
/>
</g>
Expand All @@ -63,7 +63,7 @@ import './page.css';
import MyHeader from './Header.vue';
export default {
name: 'my-page',
name: 'MyPage',
components: { MyHeader },
Expand Down
2 changes: 2 additions & 0 deletions examples/vite/src/components/TheWelcome.vue
Expand Up @@ -8,6 +8,7 @@ import SupportIcon from './icons/IconSupport.vue'
</script>

<template>
<div>
<WelcomeItem>
<template #icon>
<DocumentationIcon />
Expand Down Expand Up @@ -83,4 +84,5 @@ import SupportIcon from './icons/IconSupport.vue'
us by
<a href="https://vuejs.org/sponsor/" target="_blank" rel="noopener">becoming a sponsor</a>.
</WelcomeItem>
</div>
</template>
13 changes: 12 additions & 1 deletion package.json
Expand Up @@ -68,7 +68,9 @@
"build": "tsup",
"dev": "tsup --watch src",
"build:fix": "esno scripts/postbuild.ts",
"lint": "eslint .",
"lint": "pnpm lint:eslint && pnpm lint:prettier",
"lint:eslint": "eslint --ext .ts,.js,.vue --ignore-path .gitignore --report-unused-disable-directives .",
"lint:prettier": "prettier --check --ignore-path .gitignore . '!pnpm-lock.yaml'",
"play": "npm -C playground run dev",
"example:vite": "npm -C examples/vite run storybook",
"example:vite:app": "npm -C examples/vite run dev",
Expand All @@ -78,18 +80,27 @@
"consola": "^2.15.3",
"unplugin": "^0.9.6"
},
"peerDependencies": {
"vite": "^3.0.0",
"vue": "^3.2.25"
},
"devDependencies": {
"@nuxtjs/eslint-config-typescript": "^11.0.0",
"@types/node": "^18.7.23",
"eslint": "^8.24.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-unused-imports": "^2.0.0",
"esno": "^0.16.3",
"fast-glob": "^3.2.12",
"nodemon": "^2.0.20",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"rollup": "^2.79.1",
"tsup": "^6.2.3",
"typescript": "^4.8.4",
"vite": "^3.1.4",
"vitest": "^0.23.4",
"vue": "^3.2.40",
"webpack": "^5.74.0"
},
"pnpm": {
Expand Down

0 comments on commit 8cd1f25

Please sign in to comment.