10000 Fix linting errors · Cyclonecode/nuxt-cision-block@edfd150 · GitHub
[go: up one dir, main page]

Skip to content

Commit edfd150

Browse files
committed
Fix linting errors
1 parent 76e9ed0 commit edfd150

File tree

6 files changed

+168
-15
lines changed

6 files changed

+168
-15
lines changed

.eslintrc.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
module.exports = {
2-
parser: "@typescript-eslint/parser",
2+
parser: "vue-eslint-parser",
33
parserOptions: {
4+
parser: "@typescript-eslint/parser",
45
ecmaVersion: 2018,
56
sourceType: "module"
67
},
78
extends: [
9+
"plugin:vue/vue3-recommended",
810
"plugin:@typescript-eslint/recommended",
911
"plugin:prettier/recommended"
1012
],
1113
rules: {
12-
"@typescript-eslint/no-explicit-any": "off"
14+
"@typescript-eslint/no-explicit-any": "off",
15+
"vue/require-default-prop": "off",
16+
"vue/no-v-html": "off",
17+
"vue/multi-word-component-names": "off",
18+
"@typescript-eslint/ban-ts-comment": "off"
1319
}
1420
};

package-lock.json

Lines changed: 145 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"postversion": "git push && git push --tags",
2424
"postbuild": "cp -R src/*.vue src/pages lib/.",
2525
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.vue\"",
26-
"lint": "eslint ./src --ext .ts"
26+
"lint": "eslint --ext .ts,.vue ./src"
2727
},
2828
"author": "Krister Andersson <cyclonecode@gmail.com>",
2929
"repository": {
@@ -46,6 +46,7 @@
4646
"eslint": "^8.6.0",
4747
"eslint-config-prettier": "^8.3.0",
4848
"eslint-plugin-prettier": "^4.0.0",
49+
"eslint-plugin-vue": "^8.3.0",
4950
"jest": "^27.4.7",
5051
"prettier": "^2.5.1",
5152
"ts-jest": "^27.1.3",

src/PressFeed.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ export default {
108108
page: 0,
109109
}
110110
},
111+
async fetch() {
112+
await this.fetchFeed()
113+
},
111114
computed: {
112115
numPages() {
113116
if (this.itemsPerPage > 0) {
@@ -129,13 +132,11 @@ export default {
129132
},
130133
},
131134
watch: {
135+
/* eslint-disable @typescript-eslint/no-unused-vars */
132136
$route(to, from) {
133137
this.fetchFeed()
134138
},
135139
},
136-
async fetch() {
137-
await this.fetchFeed()
138-
},
139140
methods: {
140141
async fetchFeed() {
141142
this.releases = (

src/PressReleaseCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div v-if="showMedia && item.image" class="cision-feed-item-media">
99
<img :src="item.image" :alt="item.title" />
1010
</div>
11-
<p class="intro" v-if="showIntro">{{ item.intro }}</p>
11+
<p v-if="showIntro" class="intro">{{ item.intro }}</p>
1212
<p v-if="showBody">{{ item.body }}</p>
1313
<nuxt-link :to="link">
1414
{{ linkText }}

src/pages/Article.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<div v-if="showFiles && files.length" class="cision-block-files">
77
<a
88
v-for="(file, index) in files"
9-
:href="file.url"
109
:key="'file-' + index"
10+
:href="file.url"
1111
>{{ file.title }}</a
1212
>
1313
</div>
@@ -31,6 +31,13 @@ export default {
3131
release: {},
3232
}
3333
},
34+
async fetch() {
35+
if (this.item) {
36+
this.release = this.item
37+
return
38+
}
39+
this.release = await this.$cision.fetch(this.id || this.$route.params.id)
40+
},
3441
computed: {
3542
files() {
3643
return this.release.files || []
@@ -48,12 +55,5 @@ export default {
4855
return this.$cision.options.articleShowFiles
4956
},
5057
},
51-
async fetch() {
52-
if (this.item) {
53-
this.release = this.item
54-
return
55-
}
56-
this.release = await this.$cision.fetch(this.id || this.$route.params.id)
57-
},
5858
}
5959
</script>

0 commit comments

Comments
 (0)
0