Skip to content

Commit

Permalink
chore: prettify codebase (#3422)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed May 28, 2021
1 parent f4c4378 commit 59821b0
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 107 deletions.
28 changes: 15 additions & 13 deletions tests/integration/fixtures/vue-jsx/Jsx.vue
@@ -1,36 +1,38 @@
<script lang="tsx">
import Vue from 'vue'
import { mapMutations } from 'vuex'
import { Component } from 'vue-property-decorator'
import Vue from 'vue';
import { mapMutations } from 'vuex';
import { Component } from 'vue-property-decorator';
@Component({
created () {
this.toggleHeader(false)
created() {
this.toggleHeader(false);
},
methods: {
...mapMutations('APP_SCOPE_NAME', ['toggleHeader'])
}
...mapMutations('APP_SCOPE_NAME', ['toggleHeader']),
},
})
export default class Jsx extends Vue {
render (): JSX.Element {
render(): JSX.Element {
// expected error - no-explicit-any
const path: any = '/';
return (
// An error occurred in the next line: "Parsing error: '>' expected.eslint"
<div class="mg-notFound">
<div class="fixed-center text-center">
<p>
img goes here
<p>img goes here</p>
<p class="text-faded">
Sorry, nothing here...<strong>(404)</strong>
</p>
<p class="text-faded">Sorry, nothing here...<strong>(404)</strong></p>
<q-btn
color="secondary"
style="width:200px;"
onClick={() => console.log(path)}
>Go back</q-btn>
>
Go back
</q-btn>
</div>
</div>
)
);
}
}
</script>
36 changes: 19 additions & 17 deletions tests/integration/fixtures/vue-jsx/test.js.snap
Expand Up @@ -23,8 +23,8 @@ Array [
"desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.",
"fix": Object {
"range": Array [
390,
393,
394,
397,
],
"text": "unknown",
},
Expand All @@ -34,8 +34,8 @@ Array [
"desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",
"fix": Object {
"range": Array [
390,
393,
394,
397,
],
"text": "never",
},
Expand All @@ -45,38 +45,40 @@ Array [
},
],
"source": "<script lang=\\"tsx\\">
import Vue from 'vue'
import { mapMutations } from 'vuex'
import { Component } from 'vue-property-decorator'
import Vue from 'vue';
import { mapMutations } from 'vuex';
import { Component } from 'vue-property-decorator';
@Component({
created () {
this.toggleHeader(false)
created() {
this.toggleHeader(false);
},
methods: {
...mapMutations('APP_SCOPE_NAME', ['toggleHeader'])
}
...mapMutations('APP_SCOPE_NAME', ['toggleHeader']),
},
})
export default class Jsx extends Vue {
render (): JSX.Element {
render(): JSX.Element {
// expected error - no-explicit-any
const path: any = '/';
return (
// An error occurred in the next line: \\"Parsing error: '>' expected.eslint\\"
<div class=\\"mg-notFound\\">
<div class=\\"fixed-center text-center\\">
<p>
img goes here
<p>img goes here</p>
<p class=\\"text-faded\\">
Sorry, nothing here...<strong>(404)</strong>
</p>
<p class=\\"text-faded\\">Sorry, nothing here...<strong>(404)</strong></p>
<q-btn
color=\\"secondary\\"
style=\\"width:200px;\\"
onClick={() => console.log(path)}
>Go back</q-btn>
>
Go back
</q-btn>
</div>
</div>
)
);
}
}
</script>
Expand Down
51 changes: 27 additions & 24 deletions tests/integration/fixtures/vue-sfc/Hello.vue
@@ -1,36 +1,39 @@
<!-- Hello.vue -->
<template>
<div>
<div>
<div>
<!-- !!!!! expected error !!!!! -->
Hello {{ (name as any) }}{{exclamationMarks}}
</div>
<button @click="decrement">-</button>
<button @click="increment">+</button>
<!-- !!!!! expected error !!!!! -->
Hello {{ (name as any) }}{{ exclamationMarks }}
</div>
<button @click="decrement">-</button>
<button @click="increment">+</button>
</div>
</template>

<script lang="ts">
import Vue from "vue";
import Vue from 'vue';
export default Vue.extend({
props: ['name', 'initialEnthusiasm'],
data() {
return {
enthusiasm: this.initialEnthusiasm,
}
props: ['name', 'initialEnthusiasm'],
data() {
return {
enthusiasm: this.initialEnthusiasm,
};
},
methods: {
increment() {
this.enthusiasm++;
},
methods: {
increment() { this.enthusiasm++; },
decrement() {
if (this.enthusiasm > 1) {
this.enthusiasm--;
}
},
decrement() {
if (this.enthusiasm > 1) {
this.enthusiasm--;
}
},
computed: {
exclamationMarks(): any { // !!!!! expected error !!!!!
return Array(this.enthusiasm + 1).join('!');
}
}
},
computed: {
exclamationMarks(): any {
// !!!!! expected error !!!!!
return Array(this.enthusiasm + 1).join('!');
},
},
});
</script>
42 changes: 22 additions & 20 deletions tests/integration/fixtures/vue-sfc/World.vue
@@ -1,30 +1,32 @@
<!-- World.vue -->
<template>
<div>
<div :id="name">
{{ enthusiasm }}
</div>
<button @click="decrement">-</button>
<button @click="increment">+</button>
<div>
<div :id="name">
{{ enthusiasm }}
</div>
<button @click="decrement">-</button>
<button @click="increment">+</button>
</div>
</template>

<script lang="ts">
import Vue from "vue";
import Vue from 'vue';
export default Vue.extend({
props: ['name', 'initialEnthusiasm'],
data() {
return {
enthusiasm: this.initialEnthusiasm,
}
props: ['name', 'initialEnthusiasm'],
data() {
return {
enthusiasm: this.initialEnthusiasm,
};
},
methods: {
increment() {
this.enthusiasm++;
},
methods: {
increment() { this.enthusiasm++; },
decrement() {
if (this.enthusiasm > 1) {
this.enthusiasm--;
}
},
}
decrement() {
if (this.enthusiasm > 1) {
this.enthusiasm--;
}
},
},
});
</script>
67 changes: 35 additions & 32 deletions tests/integration/fixtures/vue-sfc/test.js.snap
Expand Up @@ -9,10 +9,10 @@ Array [
"fixableWarningCount": 0,
"messages": Array [
Object {
"column": 29,
"endColumn": 32,
"endLine": 31,
"line": 31,
"column": 25,
"endColumn": 28,
"endLine": 33,
"line": 33,
"message": "Unexpected any. Specify a different type.",
"messageId": "unexpectedAny",
"nodeType": "TSAnyKeyword",
Expand All @@ -23,8 +23,8 @@ Array [
"desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.",
"fix": Object {
"range": Array [
708,
711,
648,
651,
],
"text": "unknown",
},
Expand All @@ -34,8 +34,8 @@ Array [
"desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",
"fix": Object {
"range": Array [
708,
711,
648,
651,
],
"text": "never",
},
Expand All @@ -46,38 +46,41 @@ Array [
],
"source": "<!-- Hello.vue -->
<template>
<div>
<div>
<div>
<!-- !!!!! expected error !!!!! -->
Hello {{ (name as any) }}{{exclamationMarks}}
</div>
<button @click=\\"decrement\\">-</button>
<button @click=\\"increment\\">+</button>
<!-- !!!!! expected error !!!!! -->
Hello {{ (name as any) }}{{ exclamationMarks }}
</div>
<button @click=\\"decrement\\">-</button>
<button @click=\\"increment\\">+</button>
</div>
</template>
<script lang=\\"ts\\">
import Vue from \\"vue\\";
import Vue from 'vue';
export default Vue.extend({
props: ['name', 'initialEnthusiasm'],
data() {
return {
enthusiasm: this.initialEnthusiasm,
}
props: ['name', 'initialEnthusiasm'],
data() {
return {
enthusiasm: this.initialEnthusiasm,
};
},
methods: {
increment() {
this.enthusiasm++;
},
decrement() {
if (this.enthusiasm > 1) {
this.enthusiasm--;
}
},
methods: {
increment() { this.enthusiasm++; },
decrement() {
if (this.enthusiasm > 1) {
this.enthusiasm--;
}
},
},
computed: {
exclamationMarks(): any {
// !!!!! expected error !!!!!
return Array(this.enthusiasm + 1).join('!');
},
computed: {
exclamationMarks(): any { // !!!!! expected error !!!!!
return Array(this.enthusiasm + 1).join('!');
}
}
},
});
</script>
",
Expand Down
2 changes: 1 addition & 1 deletion tests/performance/docker-compose.yml
Expand Up @@ -3,7 +3,7 @@ version: '3'
services:
lint-real-repo:
build: ./fixtures/lint-real-repo
container_name: "lint-real-repo"
container_name: 'lint-real-repo'
volumes:
# Runtime link to the relevant built @typescript-eslint packages and test utils,
# but apply an empty volume for the package tests, we don't need those.
Expand Down

0 comments on commit 59821b0

Please sign in to comment.