Skip to content
This repository was archived by the owner on Jul 10, 2019. It is now read-only.

Commit 3c49c73

Browse files
committed
lintfix
1 parent f60237d commit 3c49c73

File tree

12 files changed

+38
-30
lines changed

12 files changed

+38
-30
lines changed

nuxt.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ module.exports = {
102102
/*
103103
** You can extend webpack config here
104104
*/
105-
extend(config: Configuration, ctx: Context) {
105+
extend(config: Configuration, ctx: Context): void {
106106
// Run ESLint on save
107107
if (ctx.isDev && process.client) {
108108
if (config.module) {
@@ -116,7 +116,7 @@ module.exports = {
116116
}
117117

118118
const vueLoader: any = config.module!.rules.find(
119-
rule => rule.loader === 'vue-loader'
119+
(rule): boolean => rule.loader === 'vue-loader'
120120
)
121121
vueLoader.options.transformAssetUrls = {
122122
video: ['src', 'poster'],
@@ -134,7 +134,7 @@ module.exports = {
134134
// ログインの必要のない画面でも middleware が実行されるので注意が必要
135135
// middleware: 'check-auth',
136136

137-
extendRoutes(routes: any, resolve: any) {
137+
extendRoutes(routes: any, resolve: any): void {
138138
// https://ja.nuxtjs.org/api/configuration-router/#extendroutes
139139
if (routers && routers.length > 0) {
140140
for (const fn of routers) {

src/plugins/constants-inject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ import * as C from '@/common/constants/'
1515
// Vue.prototype.$C = C
1616

1717
// @ts-ignore
18-
export default (context: Context, inject: any) => {
18+
export default (context: Context, inject: any): void => {
1919
inject('C', C)
2020
}

src/plugins/env-inject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Context } from '@nuxt/vue-app'
22

3-
export default (context: Context) => {
3+
export default (context: Context): void => {
44
for (const k in context.app.$env) {
55
console.log('env-inject:', k, context.app.$env[k])
66
if (!process.env[k]) {

src/store/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export const state = (): StateInterface => ({
2323
* getters
2424
*/
2525
export const getters = {
26-
isServerInitCalled(state: StateInterface) {
26+
isServerInitCalled(state: StateInterface): boolean {
2727
return state.isServerInitCalled
2828
},
29-
isClientInitCalled(state: StateInterface) {
29+
isClientInitCalled(state: StateInterface): boolean {
3030
return state.isClientInitCalled
3131
}
3232
}

src/store/todos.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ export const state = (): StateInterface => ({
1515
let counter = 0
1616

1717
export const mutations = {
18-
add(state: StateInterface, text: string) {
18+
add(state: StateInterface, text: string): void {
1919
state.list.push({
2020
id: counter++,
2121
text: text,
2222
done: false
2323
})
2424
},
25-
remove(state: StateInterface, { todo }: { todo: TodoInterface }) {
25+
remove(state: StateInterface, { todo }: { todo: TodoInterface }): void {
2626
state.list.splice(state.list.indexOf(todo), 1)
2727
},
2828
// @ts-ignore
29-
toggle(state: StateInterface, todo: TodoInterface) {
29+
toggle(state: StateInterface, todo: TodoInterface): void {
3030
todo.done = !todo.done
3131
}
3232
}

src/store/type-safe-vuex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const state = (): IState => ({
2626
* getters
2727
*/
2828
export const getters = {
29-
typeSafeGetter(state: IState) {
29+
typeSafeGetter(state: IState): string {
3030
return state.typeSafeState + ' getter'
3131
}
3232
}

src/test/Logo.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { mount } from '@vue/test-utils'
22
import Logo from '@/components/Logo.vue'
33

4-
describe('Logo', () => {
5-
test('is a Vue instance', () => {
4+
describe('Logo', (): void => {
5+
test('is a Vue instance', (): void => {
66
const wrapper = mount(Logo)
77
expect(wrapper.isVueInstance()).toBeTruthy()
88
})

src/utilities/VuexDecorator.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/**
22
* @file 最低限の定義でVuexの型をType-safeに定義するライブラリ
33
*/
4-
/* tslint:disable interface-name */
4+
/* eslint-disable interface-name */
5+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
56

67
import {
78
ActionContext as BaseActionContext,
@@ -18,7 +19,7 @@ declare type IfNotNever<T, R> = { T: {}; F: R }[IsNever<T>]
1819

1920
// Storeモジュールのペイロード部分(第2引数)を返すユーティリティ
2021
declare type ModulePayload<F extends Function> = F extends (
21-
ctx: any,
22+
ctx,
2223
payload: infer A
2324
) => any
2425
? A
@@ -107,10 +108,10 @@ export const Action = cvd('methods', mapActions) as IAction
107108
// Namespaceを定義する関数
108109
export function namespace(n?: string): any {
109110
return {
110-
State: (k: any) => State(k, n),
111-
Mutation: (k: any) => Mutation(k, n),
112-
Getter: (k: any) => Getter(k, n),
113-
Action: (k: any) => Action(k, n)
111+
State: k => State(k, n),
112+
Mutation: k => Mutation(k, n),
113+
Getter: k => Getter(k, n),
114+
Action: k => Action(k, n)
114115
}
115116
}
116117

src/utilities/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const getTokenFromCookie = (req?: any): string | undefined => {
1515
console.log('req.headers.cookie:', req.headers.cookie)
1616
const cookie: string = req.headers.cookie
1717
.split(';')
18-
.find((c: string) => c.trim().startsWith('token='))
18+
.find((c: string): boolean => c.trim().startsWith('token='))
1919

2020
if (!cookie) {
2121
return undefined

src/utilities/cancelToken.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ export class CancelTokenMap {
5555
* @param message キャンセルメッセージ
5656
*/
5757
public cancelAll(keys: any[], message?: string): void {
58-
keys.forEach(key => {
59-
this.cancel(key, message)
60-
})
58+
keys.forEach(
59+
(key): void => {
60+
this.cancel(key, message)
61+
}
62+
)
6163
}
6264
}
6365

0 commit comments

Comments
 (0)