Skip to content

Commit ddf4712

Browse files
author
langen qu
committed
chore:运行lint添加pug并修改Home.vue为pug
1 parent 029ab68 commit ddf4712

File tree

6 files changed

+346
-38
lines changed

6 files changed

+346
-38
lines changed

.eslintrc.js

+14-17
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
11
module.exports = {
22
root: true,
33
env: {
4-
node: true
4+
node: true,
55
},
66
extends: [
7-
"plugin:vue/vue3-essential",
8-
"eslint:recommended",
9-
"@vue/typescript/recommended",
10-
"@vue/prettier",
11-
"@vue/prettier/@typescript-eslint"
7+
'plugin:vue/vue3-essential',
8+
'eslint:recommended',
9+
'@vue/typescript/recommended',
10+
'@vue/prettier',
11+
'@vue/prettier/@typescript-eslint',
1212
],
1313
parserOptions: {
14-
ecmaVersion: 2020
14+
ecmaVersion: 2020,
1515
},
1616
rules: {
17-
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
18-
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
17+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
18+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
1919
},
2020
overrides: [
2121
{
22-
files: [
23-
"**/__tests__/*.{j,t}s?(x)",
24-
"**/tests/unit/**/*.spec.{j,t}s?(x)"
25-
],
22+
files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'],
2623
env: {
27-
jest: true
28-
}
29-
}
30-
]
24+
jest: true,
25+
},
26+
},
27+
],
3128
};

jest.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
2-
preset: "@vue/cli-plugin-unit-jest/presets/typescript",
2+
preset: '@vue/cli-plugin-unit-jest/presets/typescript',
33
transform: {
4-
"^.+\\.vue$": "vue-jest"
5-
}
4+
'^.+\\.vue$': 'vue-jest',
5+
},
66
};

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"lint-staged": "^9.5.0",
3636
"prettier": "^1.19.1",
3737
"typescript": "~3.9.3",
38+
"vue-cli-plugin-pug": "^1.0.7",
3839
"vue-jest": "^5.0.0-0"
3940
},
4041
"gitHooks": {

src/views/Home.vue

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
<template>
2-
<div class="home">
3-
<img alt="Vue logo" src="../assets/logo.png" />
4-
<HelloWorld msg="Welcome to Your Vue.js + TypeScript App" />
5-
</div>
1+
<template lang="pug">
2+
.home
3+
img(alt="Vue logo" src="../assets/logo.png")
4+
HelloWorld(msg="Welcome to Your Vue.js + TypeScript App")
65
</template>
76

87
<script lang="ts">

tests/unit/example.spec.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { shallowMount } from "@vue/test-utils";
2-
import HelloWorld from "@/components/HelloWorld.vue";
1+
import { shallowMount } from '@vue/test-utils';
2+
import HelloWorld from '@/components/HelloWorld.vue';
33

4-
describe("HelloWorld.vue", () => {
5-
it("renders props.msg when passed", () => {
6-
const msg = "new message";
4+
describe('HelloWorld.vue', () => {
5+
it('renders props.msg when passed', () => {
6+
const msg = 'new message';
77
const wrapper = shallowMount(HelloWorld, {
8-
props: { msg }
8+
props: { msg },
99
});
1010
expect(wrapper.text()).toMatch(msg);
1111
});

0 commit comments

Comments
 (0)