Files
moeka-project/eslint.config.ts
T
nanakura dc26878386
CI / Lint (push) Canceled after 0s
CI / Build Test (stage-web) (push) Canceled after 0s
CI / Build Test (ui-loading-screens) (push) Canceled after 0s
CI / Build Test (ui-transitions) (push) Canceled after 0s
CI / Unit Test (push) Canceled after 0s
CI / Type Check (push) Canceled after 0s
CI / Check Provenance (push) Canceled after 0s
Sync Labels / sync-labels (push) Successful in 1m43s
chore: prune unused apps and services for the moeka fork
- Remove stage-tamagotchi, stage-pocket, server, and engine workspaces with their workflows, addons, and docs
- Switch the toolchain from pnpm to bun, replace lockfiles with bun.lock
- Rewrite remaining product references to Moeka
2026-09-14 16:40:49 +07:00

105 lines
3.7 KiB
TypeScript

import { defineConfig } from '@moeru/eslint-config'
export default defineConfig({
masknet: false,
perfectionist: false,
preferArrow: false,
sonarjs: false,
sortPackageJsonScripts: false,
typescript: true,
unocss: true,
vue: true,
}, {
ignores: [
'cspell.config.yaml',
'cspell.config.yml',
'crowdin.yaml',
'crowdin.yml',
'**/assets/js/**',
'**/assets/live2d/models/**',
'**/flatpak/**',
'**/flatpak-repo/**',
'**/drizzle/**',
'**/.astro/**',
'docs/superpowers/**',
'.agents/**',
'.github/**',
'CLAUDE.md', // Skip the symbolic link
],
}, {
rules: {
'antfu/import-dedupe': 'error',
// TODO: remove this
'depend/ban-dependencies': 'warn',
'import/order': 'off',
'markdown/require-alt-text': 'off',
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
// Catches the manual `error instanceof Error ? error.message : ...`
// pattern AGENTS.md forbids. The selector matches a ConditionalExpression
// whose test is `<x> instanceof Error` and whose consequent is `<x>.message`,
// so it does NOT false-positive on `error instanceof Error ? error : new Error(...)`
// (where the consequent is the error itself, not its `.message`). Antfu's
// default no-restricted-syntax patterns are preserved alongside.
'no-restricted-syntax': [
'error',
{
message: 'Avoid `error instanceof Error ? error.message : ...`. Use `errorMessageFrom(error)` from \'@moeru/std\' (or `errorMessageFromUnknown(error, fallback)` from \'@proj-airi/stage-shared\'). Pair with `?? \'fallback\'` when a default is needed.',
selector: 'ConditionalExpression[test.type=\'BinaryExpression\'][test.operator=\'instanceof\'][test.right.name=\'Error\'][consequent.type=\'MemberExpression\'][consequent.property.name=\'message\']',
},
{
message: 'Omit TypeScript and JavaScript source extensions from relative imports, dynamic imports, and re-exports.',
selector: [
'ImportDeclaration[source.value=/^\\.{1,2}\\/.*\\.[cm]?[jt]sx?$/]',
'ExportNamedDeclaration[source.value=/^\\.{1,2}\\/.*\\.[cm]?[jt]sx?$/]',
'ExportAllDeclaration[source.value=/^\\.{1,2}\\/.*\\.[cm]?[jt]sx?$/]',
'ImportExpression[source.value=/^\\.{1,2}\\/.*\\.[cm]?[jt]sx?$/]',
].join(', '),
},
'TSEnumDeclaration[const=true]',
'TSExportAssignment',
],
'pnpm/json-enforce-catalog': 'off',
'pnpm/json-valid-catalog': 'off',
'pnpm/yaml-enforce-settings': 'off',
// 'sonarjs/cognitive-complexity': 'off',
// 'sonarjs/no-commented-code': 'off',
// 'sonarjs/pseudo-random': 'off',
'style/padding-line-between-statements': 'error',
'vue/prefer-separate-static-class': 'off',
'yaml/plain-scalar': 'off',
},
}, {
ignores: [
'**/*.md',
],
rules: {
'perfectionist/sort-imports': [
'error',
{
groups: [
'type-builtin',
'type-import',
'type-internal',
['type-parent', 'type-sibling', 'type-index'],
'default-value-builtin',
'named-value-builtin',
'value-builtin',
'default-value-external',
'named-value-external',
'value-external',
'default-value-internal',
'named-value-internal',
'value-internal',
['default-value-parent', 'default-value-sibling', 'default-value-index'],
['named-value-parent', 'named-value-sibling', 'named-value-index'],
['wildcard-value-parent', 'wildcard-value-sibling', 'wildcard-value-index'],
['value-parent', 'value-sibling', 'value-index'],
'side-effect',
'style',
],
newlinesBetween: 1,
},
],
},
})