Skip to content

Commit

Permalink
ADD: ESLint
Browse files Browse the repository at this point in the history
ADD: StyleLint
FIX: All Error
  • Loading branch information
NEKOYASAN committed May 15, 2020
1 parent 466d564 commit 5aa9deb
Show file tree
Hide file tree
Showing 23 changed files with 80 additions and 79 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
functions/nuxt
node_modules/
src/static/
src/assets/
dist/
.nuxt/
26 changes: 7 additions & 19 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
module.exports = {
root: true,
env: {
browser: true,
node: true
},
parserOptions: {
parser: 'babel-eslint'
},
plugins: ['eslint-plugin-tsdoc'],
extends: [
'@nuxtjs',
'prettier',
'@nuxtjs/eslint-config-typescript',
'prettier/vue',
'plugin:prettier/recommended',
'plugin:nuxt/recommended'
'prettier',
'plugin:prettier/recommended'
],
plugins: ['prettier'],
// add your custom rules here
rules: {
'nuxt/no-cjs-in-config': 'off',
'vue/max-attributes-per-line': 'off',
'vue/html-self-closing': [
'error',
Expand All @@ -27,14 +16,13 @@ module.exports = {
}
}
],
'comma-dangle': ['error', 'never'],
'prettier/prettier': [
'error',
{
semi: false,
singleQuote: true,
trailingComma: 'none'
singleQuote: true
}
]
],
'tsdoc/syntax': 'error'
}
}
3 changes: 1 addition & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "none"
"singleQuote": true
}
3 changes: 1 addition & 2 deletions nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const colors = require('vuetify/es5/util/colors').default
const environment = process.env.NODE_ENV || 'development'

// eslint-disable-next-line nuxt/no-cjs-in-config
module.exports = {
mode: 'universal',
srcDir: 'src',
Expand Down Expand Up @@ -81,7 +80,7 @@ module.exports = {
// Doc: https://github.com/nuxt-community/eslint-module
'@nuxtjs/eslint-module',
// Doc: https://github.com/nuxt-community/stylelint-module
// '@nuxtjs/stylelint-module',
'@nuxtjs/stylelint-module',
'@nuxt/typescript-build',
'@nuxtjs/vuetify'
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"husky": "^4.2.5",
"lint-staged": "^10.2.2",
"nodemon": "^2.0.3",
"prettier": "^2.0.5",
"prettier": "^1.19.1",
"rimraf": "^3.0.2",
"sass-loader": "^8.0.2",
"stylelint": "^13.3.3",
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommentButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {
align-items: center;
justify-content: center;
font-weight: bold;
background: #ffffff;
background: #fff;
border: 1px solid #bdc3c7;
box-sizing: border-box;
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15);
Expand Down
2 changes: 1 addition & 1 deletion src/components/MovieButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default {
align-items: center;
justify-content: center;
font-weight: bold;
background: #ffffff;
background: #fff;
border: 1px solid #bdc3c7;
box-sizing: border-box;
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15);
Expand Down
8 changes: 4 additions & 4 deletions src/components/StudyCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<v-card color="#338dce" class="studycard">
<div class="studycard-content">
<div class="timestr">
<v-icon size="20px" color="#ffffff">mdi-clock-outline</v-icon>
<v-icon size="20px" color="#fff">mdi-clock-outline</v-icon>
<div class="schooltime">
{{ schooltime }}<ruby>時<rt>じ</rt>間<rt>かん</rt>目<rt>め</rt></ruby>
</div>
<div class="realtime">
{{ realtime }}
</div>
<v-spacer />
<v-icon size="20px" color="#ffffff">mdi-bookshelf</v-icon>
<v-icon size="20px" color="#fff">mdi-bookshelf</v-icon>
{{ subject }}
</div>
<div class="contentstr">
Expand Down Expand Up @@ -79,7 +79,7 @@ export default {
font-family: 'Noto Sans', sans-serif;
height: 100%;
align-items: center;
color: #ffffff;
color: #fff;
margin-bottom: 10px;
display: flex;
}
Expand All @@ -97,7 +97,7 @@ export default {
line-height: 15px;
width: 100%;
height: 100%;
background-color: #ffffff;
background-color: #fff;
border-radius: 4px;
/* Inside Auto Layout */
Expand Down
2 changes: 1 addition & 1 deletion src/components/SubTextBookButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default {
align-items: center;
justify-content: center;
font-weight: bold;
background: #ffffff;
background: #fff;
border: 1px solid #bdc3c7;
box-sizing: border-box;
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15);
Expand Down
2 changes: 1 addition & 1 deletion src/components/TextBookButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default {
align-items: center;
justify-content: center;
font-weight: bold;
background: #ffffff;
background: #fff;
border: 1px solid #bdc3c7;
box-sizing: border-box;
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15);
Expand Down
21 changes: 14 additions & 7 deletions src/layouts/classes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@
</v-list>
</v-navigation-drawer>
-->
<v-app-bar fixed app dense class="bar" elevation="0">
<v-app-bar
fixed
app
dense
class="bar"
style="background-color: rgba(0, 0, 0, 0)"
elevation="0"
>
<span>
{{ schoolName }}
</span>
Expand Down Expand Up @@ -84,6 +91,12 @@
import { mapGetters, mapActions } from 'vuex'
export default {
middleware: 'checkClassData',
data() {
return {
loading: true,
menu: false
}
},
computed: {
...mapGetters('modules/class', ['schoolName', 'className', 'ViewDate']),
VuexDate: {
Expand All @@ -95,12 +108,6 @@ export default {
}
}
},
data() {
return {
loading: true,
menu: false
}
},
mounted() {
this.loading = false
this.setViewDate(this.$dayjs().format('YYYY-MM-DD'))
Expand Down
11 changes: 9 additions & 2 deletions src/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@
</v-list>
</v-navigation-drawer>
-->
<v-app-bar fixed app dense class="bar" elevation="0">
<v-app-bar
fixed
app
dense
class="bar"
style="background-color: rgba(0, 0, 0, 0)"
elevation="0"
>
<v-spacer />
おうちで時間割
<v-spacer />
Expand Down Expand Up @@ -66,7 +73,7 @@ export default {
}
.bar {
background-color: rgba(0, 0, 0, 0);
color: white;
color: #fff;
text-align: center;
}
</style>
2 changes: 1 addition & 1 deletion src/middleware/checkClassData.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function ({ store, redirect }) {
export default function({ store, redirect }) {
if (!store.getters['modules/class/isLoadedClassData']) {
return redirect('/')
}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/account/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ export default {
firebase
.auth()
.signInWithEmailAndPassword(this.email, this.password)
.then((userInfo) => {
.then(userInfo => {
this.login(userInfo)
})
.then(() => {
this.$router.push('/edit')
})
.catch((error) => {
.catch(error => {
this.loading = false
alert(error)
})
Expand All @@ -93,7 +93,7 @@ export default {
text-align: center;
}
.LoginTitle {
color: #ffffff;
color: #fff;
font-family: 'Noto Sans JP', sans-serif;
font-size: 5em;
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/account/resetPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
.then(() => {
this.$router.push('/account/signin')
})
.catch((error) => {
.catch(error => {
this.loading = false
alert(error)
})
Expand All @@ -78,7 +78,7 @@ export default {
text-align: center;
}
.SignUpTitle {
color: #ffffff;
color: #fff;
font-family: 'Noto Sans JP', sans-serif;
font-size: 5em;
}
Expand Down
24 changes: 14 additions & 10 deletions src/pages/account/signup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ export default {
firebase
.auth()
.createUserWithEmailAndPassword(this.email, this.password)
.then((userInfo) => {
.then(userInfo => {
this.login(userInfo)
this.writeUserData(userInfo.user.uid, userInfo.user.email)
})
.then(() => {
this.$router.push('/edit')
})
.catch((error) => {
.catch(error => {
this.loading = false
alert(error)
})
Expand All @@ -84,14 +84,18 @@ export default {
gotoResetPassword() {
this.$router.push('/reset-password')
},
writeUserData(userId, email) {
writeUserData(userId) {
const today = new Date()
return firebase.firestore().collection('users').doc(userId).set({
allow_access: [],
created_at: today,
updated_at: today,
last_login: today
})
return firebase
.firestore()
.collection('users')
.doc(userId)
.set({
allow_access: [],
created_at: today,
updated_at: today,
last_login: today
})
}
}
}
Expand All @@ -104,7 +108,7 @@ export default {
text-align: center;
}
.SignUpTitle {
color: #ffffff;
color: #fff;
font-family: 'Noto Sans JP', sans-serif;
font-size: 5em;
}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ export default {
errorMessages: '',
valid: true,
nameRules: [
(v) => !!v || 'クラスIDは必須です',
(v) => (v && v.length === 6) || 'クラスIDは6文字のひらがなです'
v => !!v || 'クラスIDは必須です',
v => (v && v.length === 6) || 'クラスIDは6文字のひらがなです'
]
}
},
methods: {
...mapActions('modules/class', ['loadClassData']),
checkInClass() {
this.loading = true
this.checkExistsClassData(this.classId).then((value) => {
this.checkExistsClassData(this.classId).then(value => {
if (value) {
this.loadClassData(this.classId)
this.$router.push('/classes')
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/dayjs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dayjs from 'dayjs'

export default ({ app }, inject) => {
inject('dayjs', (string) => dayjs(string))
export default (_, inject) => {
inject('dayjs', string => dayjs(string))
}
2 changes: 1 addition & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import checkExistsClassData from '`@/utils/checkExistsClassData'
import firebase from '@/plugins/firebase'
*/
export const actions = {
async nuxtServerInit({ dispatch, commit, state }, { req, res, error }) {
async nuxtServerInit({ dispatch }, { req }) {
const user = getUserFromCookie(req)
/*
const classDataSnapshot = await firebase
Expand Down
6 changes: 3 additions & 3 deletions src/store/modules/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const getters = {
ViewDate(state) {
return state.ViewDate
},
isLoadedClassData: (state) => {
isLoadedClassData: state => {
return state.classId !== ''
}
}
Expand Down Expand Up @@ -52,7 +52,7 @@ export const mutations = {
}

export const actions = {
async loadClassData({ dispatch, state }, classId) {
async loadClassData({ dispatch }, classId) {
const classDataSnapshot = await firebase
.firestore()
.collection('classData')
Expand All @@ -78,7 +78,7 @@ export const actions = {
nextDate({ commit }) {
commit('nextDate')
},
isLoadedClassData: (state) => {
isLoadedClassData: state => {
return state.classData !== {}
}
}
Loading

0 comments on commit 5aa9deb

Please sign in to comment.