Skip to content

chore: prettify codebase #3422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions tests/integration/fixtures/vue-jsx/Jsx.vue
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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