/
45case
/
ptable
Обзор
Документация
Войти
/
45case
/
ptable
Код
Запросы
3
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
dev
eslint.config.js
94 строки
3 KB
Olya
first_commit
06 июл 2026, 18:16
06 июл 2026, 18:16
0ff6e29
Код
Авторство
О чём код?
import js from "@eslint/js"; import { defineConfig } from "eslint/config"; import eslintConfigPrettier from "eslint-config-prettier"; import simpleImportSort from "eslint-plugin-simple-import-sort"; import unusedImports from "eslint-plugin-unused-imports"; import eslintPluginVue from "eslint-plugin-vue"; import globals from "globals"; import tseslint from "typescript-eslint"; const CROSS_SEGMENT_REGEX = "^(\\.\\./)+(app|pages|shared|entities|features|widgets|processes|stores|data|assets)/"; export default defineConfig( { ignores: ["dist", "dist-ssr", "dist-electron", "coverage", "node_modules", "electron"], }, { extends: [ js.configs.recommended, ...tseslint.configs.recommended, ...eslintPluginVue.configs["flat/recommended"], ], files: ["**/*.{ts,tsx,vue}"], languageOptions: { ecmaVersion: "latest", sourceType: "module", globals: globals.browser, parserOptions: { parser: tseslint.parser, }, }, plugins: { "simple-import-sort": simpleImportSort, "unused-imports": unusedImports, }, rules: { "no-debugger": "warn", "padding-line-between-statements": [ "warn", { blankLine: "always", prev: "import", next: "*" }, { blankLine: "any", prev: "import", next: "import" }, ], "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "off", "unused-imports/no-unused-imports": "warn", "unused-imports/no-unused-vars": [ "warn", { argsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_", varsIgnorePattern: "^_", }, ], "@typescript-eslint/consistent-type-imports": [ "warn", { prefer: "type-imports", }, ], "simple-import-sort/imports": [ "warn", { groups: [ ["^node:", "^vue$", "^vue-router$", "^@?\\w"], ["^@/"], ["^\\.(?!/?$)", "^\\./?$", "^\\.\\.(?!/?$)", "^\\.\\./?$"], ["^.+\\.css$"], ], }, ], "simple-import-sort/exports": "warn", "vue/no-mutating-props": "error", "vue/multi-word-component-names": "off", }, }, { files: ["src/**/*.{ts,tsx,vue}"], rules: { "no-restricted-imports": [ "warn", { patterns: [ { regex: CROSS_SEGMENT_REGEX, message: "Relative imports are allowed only inside the same top-level segment. Use @/ when crossing from app/shared/pages/etc. to another segment.", }, ], }, ], }, }, eslintConfigPrettier, );