Files
bookorbit/client/eslint.config.ts
T
neon 6f673e2e59 feat(metadata): merge search and compare into one match sheet
Search and Compare Metadata become one two-pane sheet, shared with the Book Dock. Results are
ranked by match strength beside a field-by-field comparison with Keep/Use per row, word-level
diffs, other sources inline, a cover strip, and picks that survive switching results.
The search runs on open and a single source can be retried. No API change.
2026-09-29 04:53:34 +00:00

74 lines
2.8 KiB
TypeScript

import { globalIgnores } from 'eslint/config'
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
import pluginVue from 'eslint-plugin-vue'
import pluginVitest from '@vitest/eslint-plugin'
import pluginOxlint from 'eslint-plugin-oxlint'
import skipFormatting from 'eslint-config-prettier/flat'
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
// import { configureVueProject } from '@vue/eslint-config-typescript'
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
export default defineConfigWithVueTs(
{
name: 'app/files-to-lint',
files: ['**/*.{vue,ts,mts,tsx}'],
},
globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**', 'public/**', '**/dev-dist/**']),
...pluginVue.configs['flat/essential'],
vueTsConfigs.recommended,
{
...pluginVitest.configs.recommended,
// Specs are colocated as `*.spec.ts`; `__tests__/` remains only in features not yet converted.
files: ['src/**/__tests__/*', 'src/**/*.spec.ts', 'src/**/*.test.ts'],
},
// Named handlers only: an inline arrow in a template cannot be named, reused or tested, and the
// podcast feature was swept clean of them. The rest of the app still carries several hundred, so
// widening this is its own task rather than a side effect of one feature's refactor.
{
files: [
'src/features/podcast/**/*.vue',
'src/components/FormSheet.vue',
'src/features/collection/components/CollectionMembershipList.vue',
'src/features/book/components/metadata-match/*.vue',
],
rules: { 'vue/v-on-handler-style': ['error', ['method', 'inline']] },
},
{
files: ['src/components/ui/**/*.vue'],
rules: {
'vue/multi-word-component-names': 'off',
},
},
{
files: ['src/**/*.{vue,ts,mts,tsx}'],
ignores: ['src/lib/clipboard.ts'],
rules: {
'no-restricted-syntax': [
'error',
{
selector:
"MemberExpression[property.name='clipboard'][object.name='navigator'], MemberExpression[property.value='clipboard'][object.name='navigator'], MemberExpression[property.name='clipboard'][object.property.name='navigator'], MemberExpression[property.value='clipboard'][object.property.name='navigator']",
message: "Use copyToClipboard from '@/lib/clipboard' so copy actions work on HTTP/self-hosted origins.",
},
{
selector:
"CallExpression[callee.property.name='execCommand'][arguments.0.value='copy'], CallExpression[callee.property.value='execCommand'][arguments.0.value='copy']",
message: "Use copyToClipboard from '@/lib/clipboard' instead of adding another copy fallback.",
},
],
},
},
...pluginOxlint.buildFromOxlintConfigFile('.oxlintrc.json'),
skipFormatting,
)