Files
novalon-website/eslint.config.mjs
zhangxiang acb6b67357 feat(brand): 首页影像版式与名+号字标上线
- 首页按咨询机构影像版式重排,保留原站文案与“洞察→行业→能力”段序
- 导航/页脚/品牌页换用上下锁定字标,alt 维持法定主体名
- 修复 reduce 下 PageTransition 祖先 opacity 停留导致的白屏
- 4 浏览器 × 9 宽度多端复核,axe 0 violation
- 视觉基线 106 张更新并只读复跑 125/125
2026-10-20 11:09:32 +08:00

130 lines
3.4 KiB
JavaScript

import { dirname } from 'path';
import { fileURLToPath } from 'url';
import nextConfig from 'eslint-config-next';
import tsParser from '@typescript-eslint/parser';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
const __dirname = dirname(fileURLToPath(import.meta.url));
const config = [
...nextConfig,
{
name: 'ruixin/custom',
files: ['**/*.{js,jsx,ts,tsx}'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
globals: {
jest: 'readonly',
},
},
plugins: {
'@typescript-eslint': tsPlugin,
react: reactPlugin,
'react-hooks': reactHooksPlugin,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'react/react-in-jsx-scope': 'off',
'react/no-unescaped-entities': 'error',
'react/jsx-no-target-blank': 'error',
'react/self-closing-comp': 'error',
'react/display-name': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-empty-object-type': 'off',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'prefer-const': 'error',
'no-var': 'error',
eqeqeq: ['error', 'always'],
curly: ['error', 'multi-line'],
'no-throw-literal': 'error',
'prefer-promise-reject-errors': 'error',
'react-hooks/set-state-in-effect': 'warn',
},
},
{
name: 'ruixin/e2e-tests',
files: ['e2e/**/*.ts'],
rules: {
// E2E 测试使用 console.log 输出诊断信息,允许
'no-console': 'off',
},
},
{
name: 'ruixin/unit-tests',
files: ['**/*.test.{ts,tsx}', '**/__tests__/**/*.{ts,tsx}'],
rules: {
// 单测/集成测试在 mock 与断言中常使用 any,允许
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
name: 'ruixin/performance-tests',
files: ['tests/performance/*.js'],
rules: {
// k6 性能测试脚本按惯例使用匿名默认导出
'import/no-anonymous-default-export': 'off',
},
},
{
name: 'ruixin/ignores',
ignores: [
'.next/**',
// 代理工作树(.qoder/worktrees/**)是同一仓库的第二份副本,
// 不忽略会让 lint 把整棵工作树再扫一遍(实测 149,969 problems),
// 本仓库自己的 0 error 口径被噪声淹没。
'.qoder/**',
'.stryker-tmp/**',
'out/**',
'build/**',
'dist/**',
'node_modules/**',
'coverage/**',
'src/generated/**',
'scripts/**',
'config/test/**',
'**/_archive/**',
'.agents/**',
'test-framework/**',
'tests/styles/**',
'next-env.d.ts',
'playwright-report/**',
'.lighthouseci/**',
'test-results/**',
'release-acceptance-reports/**',
'.trae/**',
'*.log',
'*.txt',
'build-output.txt',
'e2e-output.txt',
'type-check-output.txt',
'lint-output.txt',
'npm-audit-output.txt',
'test-unit-output.txt',
'accessibility-report.json',
'heading-hierarchy-report.json',
],
},
];
export default config;