Burt 2 rokov pred
rodič
commit
c51e7181f8

.eslintrc.js → .eslintrc.cjs


.prettierrc.js → .prettierrc.cjs


+ 2 - 0
src/pages/index/index.vue

@@ -9,7 +9,9 @@
 
 <script setup lang="ts">
 import { ref } from 'vue'
+import { fun } from '../../test/import-sort'
 const title = ref('Hello')
+fun()
 </script>
 
 <style>

+ 3 - 0
src/test/import-sort.ts

@@ -0,0 +1,3 @@
+export function fun() {
+  console.log('import sort')
+}

+ 1 - 0
src/test/index.ts

@@ -0,0 +1 @@
+import './trailing-comma'

+ 6 - 0
src/test/trailing-comma.ts

@@ -0,0 +1,6 @@
+// 发现配置了 trailingcomma: "all" 也不会有函数的尾逗号,
+// 与prettier官网描述的不一致。 @see https://prettier.io/docs/en/options#trailing-commas
+export function fn(a: number, b: number) {
+  console.log(a, b)
+}
+fn(12, 2)