diff --git a/frontend/.prettierrc.js b/frontend/.prettierrc.js new file mode 100644 index 000000000..96d583c9d --- /dev/null +++ b/frontend/.prettierrc.js @@ -0,0 +1,8 @@ +module.exports = { + "importOrder": ["^@/(.*)$", "^[./]" ], + "importOrderSeparation": true, + "importOrderSortSpecifiers": true , + "semi": false, + "singleQuote": true, + "plugins": ["@trivago/prettier-plugin-sort-imports"] +} diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 639e49d02..8cccec445 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -75,6 +75,7 @@ "@storybook/vue3": "^8.2.2", "@storybook/vue3-vite": "^8.1.5", "@testing-library/vue": "^8.1.0", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@types/jquery": "^3.5.29", "@types/node": "^20.14.10", "@vitejs/plugin-vue": "^5.1.1", @@ -103,7 +104,7 @@ "ndb": "^1.1.5", "node-fetch": "^3.3.2", "npm-check-updates": "^16.14.20", - "prettier": "3.3.2", + "prettier": "^3.3.2", "react": "^18.3.1", "react-dom": "^18.2.0", "sass": "^1.77.6", @@ -6840,6 +6841,122 @@ "node": ">= 10" } }, + "node_modules/@trivago/prettier-plugin-sort-imports": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", + "integrity": "sha512-r3n0onD3BTOVUNPhR4lhVK4/pABGpbA7bW3eumZnYdKaHkf1qEC+Mag6DPbGNuuh0eG8AaYj+YqmVHSiGslaTQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@babel/generator": "7.17.7", + "@babel/parser": "^7.20.5", + "@babel/traverse": "7.23.2", + "@babel/types": "7.17.0", + "javascript-natural-sort": "0.7.1", + "lodash": "^4.17.21" + }, + "peerDependencies": { + "@vue/compiler-sfc": "3.x", + "prettier": "2.x - 3.x" + }, + "peerDependenciesMeta": { + "@vue/compiler-sfc": { + "optional": true + } + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/generator": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", + "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/traverse": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/traverse/node_modules/@babel/generator": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.0.tgz", + "integrity": "sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.25.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/traverse/node_modules/@babel/types": { + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", + "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@tufjs/canonical-json": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-1.0.0.tgz", @@ -15377,6 +15494,13 @@ "node": ">=8" } }, + "node_modules/javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", + "dev": true, + "license": "MIT" + }, "node_modules/javascript-time-ago": { "version": "2.5.10", "resolved": "https://registry.npmjs.org/javascript-time-ago/-/javascript-time-ago-2.5.10.tgz", @@ -20255,6 +20379,7 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/frontend/package.json b/frontend/package.json index b703d3e8f..023f0b969 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -83,6 +83,7 @@ "@storybook/vue3": "^8.2.2", "@storybook/vue3-vite": "^8.1.5", "@testing-library/vue": "^8.1.0", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@types/jquery": "^3.5.29", "@types/node": "^20.14.10", "@vitejs/plugin-vue": "^5.1.1", @@ -111,7 +112,7 @@ "ndb": "^1.1.5", "node-fetch": "^3.3.2", "npm-check-updates": "^16.14.20", - "prettier": "3.3.2", + "prettier": "^3.3.2", "react": "^18.3.1", "react-dom": "^18.2.0", "sass": "^1.77.6", diff --git a/frontend/prettier.config.js b/frontend/prettier.config.js deleted file mode 100644 index 35fcafaf2..000000000 --- a/frontend/prettier.config.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - semi: false, - singleQuote: true, -} diff --git a/frontend/src/cases/common.js b/frontend/src/cases/common.js index 171df8a10..e56c71306 100644 --- a/frontend/src/cases/common.js +++ b/frontend/src/cases/common.js @@ -1,7 +1,8 @@ +import { computed } from 'vue' + import { useCaseDetailsStore } from '@/cases/stores/caseDetails' import { useCaseListStore } from '@/cases/stores/caseList' import { State } from '@/varfish/storeUtils' -import { computed } from 'vue' export const overlayShow = computed(() => { const caseListStore = useCaseListStore() diff --git a/frontend/src/cases/common.ts b/frontend/src/cases/common.ts index cbb9ae735..854b47a88 100644 --- a/frontend/src/cases/common.ts +++ b/frontend/src/cases/common.ts @@ -1,10 +1,11 @@ +import { computed } from 'vue' + import { - useCaseDetailsStore, CaseVariantStatsEntry, + useCaseDetailsStore, } from '@/cases/stores/caseDetails' import { useCaseListStore } from '@/cases/stores/caseList' import { State } from '@/varfish/storeUtils' -import { computed } from 'vue' export const overlayShow = computed(() => { const caseListStore = useCaseListStore() diff --git a/frontend/src/cases/components/CaseDetail/CardAlignmentQc.vue b/frontend/src/cases/components/CaseDetail/CardAlignmentQc.vue index c1a7d65d0..bd3c03ce0 100644 --- a/frontend/src/cases/components/CaseDetail/CardAlignmentQc.vue +++ b/frontend/src/cases/components/CaseDetail/CardAlignmentQc.vue @@ -2,8 +2,8 @@ import { computed } from 'vue' import { useCaseDetailsStore } from '@/cases/stores/caseDetails' -import { State } from '@/varfish/storeUtils' import { displayName, formatLargeInt } from '@/varfish/helpers' +import { State } from '@/varfish/storeUtils' // Store-related. diff --git a/frontend/src/cases/components/CaseDetail/CardAnnotations.vue b/frontend/src/cases/components/CaseDetail/CardAnnotations.vue index e6fdab0ae..00ea44901 100644 --- a/frontend/src/cases/components/CaseDetail/CardAnnotations.vue +++ b/frontend/src/cases/components/CaseDetail/CardAnnotations.vue @@ -1,11 +1,11 @@