mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
* feat(i18n): add Turkish locale-aware text helpers (search/sort) * test(i18n): cover null/whitespace edges + document compareTr/normalize contract * fix(i18n): route dashboard search through Turkish-safe matchesSearch * fix(i18n): sort user-visible lists with Turkish collation (compareTr) * fix(i18n): keep providerId tiebreaker as ASCII sort (technical id) * docs(i18n): document intentional lang=en in global-error boundary * chore(lint): guard against locale-unsafe toLowerCase().includes search * fix(i18n): migrate missed provider-name search + harden lint disable placement * fix(i18n): downgrade no-restricted-syntax to warn (incremental adoption) The rule errored on ~19 pre-existing toLowerCase().includes() call-sites in src/app accumulated since this PR's base. Keep it as a warning so the guard-rail guides future code without breaking the 0-errors lint gate (project policy: 0 errors, warnings tolerated). --------- Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
99 lines
2.9 KiB
JavaScript
99 lines
2.9 KiB
JavaScript
import nextVitals from "eslint-config-next/core-web-vitals";
|
||
import tseslint from "typescript-eslint";
|
||
|
||
/** @type {import("eslint").Linter.Config[]} */
|
||
const eslintConfig = [
|
||
...nextVitals,
|
||
// FASE-02: Security rules (strict everywhere)
|
||
{
|
||
rules: {
|
||
"no-eval": "error",
|
||
"no-implied-eval": "error",
|
||
"no-new-func": "error",
|
||
"no-restricted-imports": [
|
||
"error",
|
||
{
|
||
paths: [
|
||
{
|
||
name: "prop-types",
|
||
message: "PropTypes are deprecated. Use TypeScript types/interfaces instead.",
|
||
},
|
||
],
|
||
},
|
||
],
|
||
},
|
||
},
|
||
// i18n: ham toLowerCase().includes() arama pattern'ini engelle
|
||
// (Türkçe İ/ı karakterlerini bozar — matchesSearch kullanılmalı).
|
||
// "warn" (error değil): kuralın eklendiği anda kod tabanında zaten bu pattern'i
|
||
// kullanan ~19 satır var; aşamalı temizlik için uyarı seviyesinde tutuluyor
|
||
// (proje politikası: 0 error, warning'ler tolere edilir).
|
||
{
|
||
files: ["src/app/**/*.{ts,tsx}", "src/components/**/*.{ts,tsx}"],
|
||
rules: {
|
||
"no-restricted-syntax": [
|
||
"warn",
|
||
{
|
||
selector:
|
||
"CallExpression[callee.property.name='includes'][callee.object.callee.property.name='toLowerCase']",
|
||
message:
|
||
"Türkçe-güvenli arama için matchesSearch() kullan (@/shared/utils/turkishText). Ham toLowerCase().includes() İ/ı karakterlerini bozar.",
|
||
},
|
||
],
|
||
},
|
||
},
|
||
// Relaxed rules for open-sse and tests (incremental adoption)
|
||
{
|
||
files: ["open-sse/**/*.ts", "tests/**/*.mjs", "tests/**/*.ts"],
|
||
plugins: {
|
||
"@typescript-eslint": tseslint.plugin,
|
||
},
|
||
rules: {
|
||
"@typescript-eslint/no-explicit-any": "warn",
|
||
"@next/next/no-assign-module-variable": "off",
|
||
"react-hooks/rules-of-hooks": "off",
|
||
},
|
||
},
|
||
// Global ignores — keep ESLint scoped to source files only
|
||
{
|
||
ignores: [
|
||
// Next.js build output (distDir now .build/next; keep .next for legacy)
|
||
".next/**",
|
||
".build/**",
|
||
"src/.next/**",
|
||
"out/**",
|
||
"build/**",
|
||
"dist/**",
|
||
"coverage/**",
|
||
"next-env.d.ts",
|
||
// Scripts and binaries
|
||
"scripts/**",
|
||
"bin/**",
|
||
// Dependencies
|
||
"node_modules/**",
|
||
".worktrees/**",
|
||
".omnivscodeagent/**",
|
||
// VS Code extension and its large test fixtures
|
||
"vscode-extension/**",
|
||
"_references/**",
|
||
"_mono_repo/**",
|
||
// Electron app
|
||
"electron/**",
|
||
// Docs
|
||
"docs/**",
|
||
// Open-SSE compiled/bundled output
|
||
"open-sse/mcp-server/dist/**",
|
||
// Playwright test output
|
||
"playwright-report/**",
|
||
"test-results/**",
|
||
// Legacy app/ and QA backup dirs (renamed to dist/ in Layer 1)
|
||
"app/**",
|
||
"app.__qa_backup/**",
|
||
// CLI package copy directory
|
||
"clipr/**",
|
||
],
|
||
},
|
||
];
|
||
|
||
export default eslintConfig;
|