- Replace placeholder with OpenCV.js WASM perspective correction: pick highest-confidence rectangle, compute homography, fold weighted scale corrections from secondary datums, single warpPerspective - All units now mm throughout (no cm conversion) - Simplified datum creation: two buttons (+ Rectangle / + Line) with preset chips, auto-numbered labels (Line 1, Rectangle 2, etc.) - Dimensions default to 0, user must input manually; Next button disabled until all datums have valid dimensions with tooltip hint - Fix image preview (keep object URL alive), fix canvas disappearing on breakpoint switch (single instance + ResizeObserver re-fit) - Mobile responsive: bottom sheet for datum panel, full-width canvas - Spinner on result screen during processing - Stricter ESLint config, updated Prettier to 4-space/no-semicolons Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
86 lines
2.7 KiB
TypeScript
86 lines
2.7 KiB
TypeScript
import tseslint from "typescript-eslint"
|
|
import pluginVue from "eslint-plugin-vue"
|
|
import vueParser from "vue-eslint-parser"
|
|
import prettierConfig from "eslint-config-prettier"
|
|
import type { Linter } from "eslint"
|
|
|
|
export default tseslint.config(
|
|
{ ignores: ["dist/**", "*.config.ts"] },
|
|
|
|
// TypeScript strict type-checked rules for .ts and .vue files
|
|
{
|
|
files: ["**/*.{ts,vue}"],
|
|
extends: [...tseslint.configs.strictTypeChecked],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
projectService: true,
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
rules: {
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error",
|
|
{ argsIgnorePattern: "^_" },
|
|
],
|
|
},
|
|
},
|
|
|
|
// Vue strongly recommended
|
|
...(pluginVue.configs["flat/strongly-recommended"] as Linter.Config[]),
|
|
|
|
// Vue parser + additional strict rules
|
|
{
|
|
files: ["**/*.vue"],
|
|
languageOptions: {
|
|
parser: vueParser,
|
|
parserOptions: {
|
|
parser: tseslint.parser,
|
|
ecmaVersion: "latest",
|
|
sourceType: "module",
|
|
extraFileExtensions: [".vue"],
|
|
projectService: true,
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
rules: {
|
|
"vue/block-order": [
|
|
"error",
|
|
{ order: ["script", "template", "style"] },
|
|
],
|
|
"vue/component-api-style": ["error", ["script-setup"]],
|
|
"vue/define-macros-order": [
|
|
"error",
|
|
{
|
|
order: [
|
|
"defineProps",
|
|
"defineEmits",
|
|
"defineSlots",
|
|
],
|
|
},
|
|
],
|
|
"vue/no-empty-component-block": "error",
|
|
"vue/no-ref-object-reactivity-loss": "error",
|
|
"vue/no-unused-refs": "error",
|
|
"vue/no-useless-mustaches": "error",
|
|
"vue/no-useless-v-bind": "error",
|
|
"vue/prefer-separate-static-class": "error",
|
|
"vue/prefer-true-attribute-shorthand": "error",
|
|
},
|
|
},
|
|
|
|
// Relax rules for generated shadcn-vue UI components
|
|
{
|
|
files: ["src/components/ui/**/*.{ts,vue}"],
|
|
rules: {
|
|
"vue/multi-word-component-names": "off",
|
|
"vue/require-default-prop": "off",
|
|
"vue/define-macros-order": "off",
|
|
"vue/no-template-shadow": "off",
|
|
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
"@typescript-eslint/no-unsafe-call": "off",
|
|
},
|
|
},
|
|
|
|
prettierConfig as Linter.Config,
|
|
)
|