Skip to content

Commit

Permalink
prettierの導入
Browse files Browse the repository at this point in the history
  • Loading branch information
2nofa11 committed Aug 10, 2022
1 parent 585bab6 commit a8c9bc8
Show file tree
Hide file tree
Showing 22 changed files with 464 additions and 413 deletions.
19 changes: 10 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
module.exports = {
root: true,
env: {
node: true
node: true,
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/typescript/recommended'
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/typescript/recommended",
"prettier",
],
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2020,
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
}
42 changes: 40 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test": "jest"
"test": "jest",
"format": " npx prettier -w */**/*.vue && npx prettier -w */**/*.ts"
},
"dependencies": {
"@mdi/font": "5.9.55",
Expand All @@ -28,6 +29,7 @@
"axios-jsonp": "^1.0.4",
"core-js": "^3.8.3",
"jest": "^28.1.3",
"prettier": "2.7.1",
"roboto-fontface": "*",
"ts-jest": "^28.0.7",
"vue": "^3.2.13",
Expand All @@ -42,6 +44,7 @@
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-typescript": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^9.1.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
Expand Down
14 changes: 14 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
printWidth: 80, //デフォルト
semi: false,
singleQuote: false, //デフォルト
tabWidth: 2, //デフォルト
arrowParens: "always", //デフォルト
endOfLine: "lf", //デフォルト
useTabs: false, //デフォルト
quoteProps: "as-needed", //デフォルト
jsxSingleQuote: false, //デフォルト
trailingComma: "es5", //デフォルト
bracketSpacing: true, //デフォルト
jsxBracketSameLine: false, //デフォルト
};
15 changes: 7 additions & 8 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<template>
<v-app>
<Page/>
<Page />
</v-app>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import WrapperPage from './components/pages/WrapperPage.vue'
import { defineComponent } from "vue"
import WrapperPage from "./components/pages/WrapperPage.vue"
export default defineComponent({
name: 'App',
components:{
Page:WrapperPage
}
name: "App",
components: {
Page: WrapperPage,
},
})
</script>
76 changes: 38 additions & 38 deletions src/components/atoms/DoubleIconButton.vue
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
<template>
<v-btn
color="primary"
elevation="1"
rounded
x-large
:loading="is_loading"
:disabled="is_loading"
v-on:click="loader = 'loading'"
>
<V-icon>mdi-emoticon-happy-outline</V-icon>
or
<V-icon>mdi-emoticon-cry-outline</V-icon>
</v-btn>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
data(){
return{
loader:null
}
},
props:{
is_loading:{
type:Boolean,
default:false
}
},
watch:{
loader(){
this.loader = null
}
}
})
</script>
<template>
<v-btn
color="primary"
elevation="1"
rounded
x-large
:loading="is_loading"
:disabled="is_loading"
v-on:click="loader = 'loading'"
>
<V-icon>mdi-emoticon-happy-outline</V-icon>
or
<V-icon>mdi-emoticon-cry-outline</V-icon>
</v-btn>
</template>

<script lang="ts">
import { defineComponent } from "vue"
export default defineComponent({
data() {
return {
loader: null,
}
},
props: {
is_loading: {
type: Boolean,
default: false,
},
},
watch: {
loader() {
this.loader = null
},
},
})
</script>
64 changes: 32 additions & 32 deletions src/components/atoms/NormalCard.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<template>
<v-card class="ma-1 " v-bind:color="item.color" >
<v-card-title primary-title >
{{item.title}}
</v-card-title>
<v-card-text>
{{item.description}}
</v-card-text>
</v-card>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
props:{
'item':{
type:Object,
required:true
}
}
})
</script>

<style scoped>
.v-card-title{
color: grey;
}
.v-card-text{
color: gray;
}
</style>
<template>
<v-card class="ma-1" v-bind:color="item.color">
<v-card-title primary-title>
{{ item.title }}
</v-card-title>
<v-card-text>
{{ item.description }}
</v-card-text>
</v-card>
</template>

<script lang="ts">
import { defineComponent } from "vue"
export default defineComponent({
props: {
item: {
type: Object,
required: true,
},
},
})
</script>

<style scoped>
.v-card-title {
color: grey;
}
.v-card-text {
color: gray;
}
</style>
80 changes: 40 additions & 40 deletions src/components/atoms/RoundButton.vue
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<template>
<v-btn
color="primary"
elevation="1"
rounded
x-large
:loading="is_loading"
:disabled="is_loading"
v-on:click="loader = 'loading'"
>
{{name}}
</v-btn>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
data(){
return{
loader:null
}
},
props:{
name:{
type:String,
required:true
},
is_loading:{
type:Boolean,
default:false
}
},
watch:{
loader(){
this.loader = null
}
}
})
</script>
<template>
<v-btn
color="primary"
elevation="1"
rounded
x-large
:loading="is_loading"
:disabled="is_loading"
v-on:click="loader = 'loading'"
>
{{ name }}
</v-btn>
</template>

<script lang="ts">
import { defineComponent } from "vue"
export default defineComponent({
data() {
return {
loader: null,
}
},
props: {
name: {
type: String,
required: true,
},
is_loading: {
type: Boolean,
default: false,
},
},
watch: {
loader() {
this.loader = null
},
},
})
</script>
Loading

0 comments on commit a8c9bc8

Please sign in to comment.