diff --git a/.eslintrc.js b/.eslintrc.js
index e60344d7..91cf0546 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -5,10 +5,11 @@ module.exports = {
node: true
},
parserOptions: {
- parser: 'babel-eslint'
+ parser: '@typescript-eslint/parser'
},
extends: [
'plugin:vue/essential',
+ '@nuxtjs/eslint-config-typescript'
],
plugins: [
'vue',
diff --git a/components/NewsList.vue b/components/NewsList.vue
index 4f63dacc..92cddfb3 100644
--- a/components/NewsList.vue
+++ b/components/NewsList.vue
@@ -1,6 +1,6 @@
-
+
@@ -13,9 +13,10 @@
target="_blank"
rel="noopener"
>
-
- {{ unix2ymd (list.attachments[0].ts) }}
-
+ {{ unix2ymd (list.attachments[0].ts) }}
{{ emoji(textRender(list.attachments[0].text)) }}
@@ -26,9 +27,10 @@
target="_blank"
rel="noopener"
>
-
- {{ unix2ymd (list.attachments[0].ts) }}
-
+ {{ unix2ymd (list.attachments[0].ts) }}
{{ emoji(list.attachments[0].title) }}
@@ -38,48 +40,56 @@
-
diff --git a/nuxt.config.js b/nuxt.config.ts
similarity index 50%
rename from nuxt.config.js
rename to nuxt.config.ts
index 06660e30..900bd13e 100644
--- a/nuxt.config.js
+++ b/nuxt.config.ts
@@ -1,4 +1,7 @@
-module.exports = {
+import { Configuration } from '@nuxt/types'
+
+const nuxtConfig: Configuration = {
+ mode: 'universal',
head: {
title: 'READING...',
htmlAttrs: {
@@ -7,19 +10,24 @@ module.exports = {
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
- { hid: 'description', name: 'description', content: '@yamanoku Reading News List' },
- { hid: 'og:image', name: 'og:image', content: 'https://yamanoku.net/reading/icon.png' },
+ {
+ hid: 'description',
+ name: 'description',
+ content: '@yamanoku Reading News List'
+ },
+ {
+ hid: 'og:image',
+ name: 'og:image',
+ content: 'https://yamanoku.net/reading/icon.png'
+ }
],
- link: [
- { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
- ]
+ link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
},
- css: [
- 'modern-normalize'
- ],
+ css: ['modern-normalize'],
build: {
- extend (config, { isDev }) {
- if (isDev && process.client) {
+ extend (config, ctx) {
+ if (ctx.isDev && ctx.isClient) {
+ if (!config.module) { return }
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
@@ -28,14 +36,21 @@ module.exports = {
})
}
},
- quiet: false,
+ quiet: false
},
- plugins: ['~/plugins/vue-paginate'],
- modules: [
- '@nuxtjs/pwa',
+ buildModules: [
+ [
+ '@nuxt/typescript-build',
+ {
+ typeCheck: true,
+ ignoreNotFoundWarnings: true
+ }
+ ]
],
+ plugins: ['~/plugins/vue-paginate'],
+ modules: ['@nuxtjs/pwa'],
workbox: {
- dev: true,
+ dev: true
},
manifest: {
name: 'READING...',
@@ -47,5 +62,7 @@ module.exports = {
lang: 'en',
theme_color: '#f9f9f9',
background_color: '#f9f9f9'
- },
+ }
}
+
+module.exports = nuxtConfig
diff --git a/package.json b/package.json
index 8742b7b1..98f61db8 100644
--- a/package.json
+++ b/package.json
@@ -3,20 +3,26 @@
"author": "yamanoku <0910yama@gmail.com>",
"private": true,
"scripts": {
- "dev": "nuxt",
- "build": "nuxt build",
- "start": "nuxt start",
- "generate": "nuxt generate",
- "lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
+ "dev": "nuxt-ts",
+ "build": "nuxt-ts build",
+ "start": "nuxt-ts start",
+ "generate": "nuxt-ts generate",
+ "lint": "eslint --ext .ts,.js,.vue --ignore-path .gitignore .",
"precommit": "npm run lint",
"deploy:gh-pages": "gh-pages -d dist -m 'chore: update [skip ci]' -t"
},
"dependencies": {
+ "@nuxt/typescript-build": "0.1.11",
+ "@nuxt/typescript-runtime": "0.1.3",
+ "@nuxt/vue-app": "2.9.0",
+ "@nuxtjs/eslint-config-typescript": "0.1.2",
"@nuxtjs/pwa": "2.6.0",
"nuxt": "2.9.2",
"vue": "2.6.10"
},
"devDependencies": {
+ "@types/node-emoji": "1.8.1",
+ "@typescript-eslint/parser": "2.0.0",
"axios": "0.19.0",
"babel-eslint": "10.0.3",
"eslint": "6.2.2",
diff --git a/pages/index.vue b/pages/index.vue
index 42470169..3d17dc64 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -1,29 +1,34 @@
-
+
-