7cbb7a9ac8
ci/woodpecker/push/woodpecker Pipeline failed
1. jest.setup.js: - 添加 Request/Response/Headers 全局对象 mock - 解决 'Request is not defined' 错误 2. .eslintrc.json: - 将 jest.setup.js 添加到忽略列表 3. shared-mocks.tsx: - 添加 ArrowUp 图标 mock 4. back-to-top.test.tsx: - 重写测试使用 import 语法 - 使用 fireEvent.scroll 触发滚动事件 - 修复组件渲染测试
61 lines
1.4 KiB
JSON
61 lines
1.4 KiB
JSON
{
|
|
"root": true,
|
|
"parser": "@typescript-eslint/parser",
|
|
"parserOptions": {
|
|
"ecmaVersion": 2020,
|
|
"sourceType": "module",
|
|
"ecmaFeatures": {
|
|
"jsx": true
|
|
}
|
|
},
|
|
"env": {
|
|
"browser": true,
|
|
"node": true,
|
|
"es6": true
|
|
},
|
|
"extends": [
|
|
"eslint:recommended",
|
|
"plugin:@typescript-eslint/recommended",
|
|
"plugin:react/recommended",
|
|
"plugin:react-hooks/recommended"
|
|
],
|
|
"plugins": ["@typescript-eslint", "react", "react-hooks"],
|
|
"settings": {
|
|
"react": {
|
|
"version": "detect"
|
|
}
|
|
},
|
|
"ignorePatterns": [
|
|
".next/**",
|
|
"out/**",
|
|
"build/**",
|
|
"dist/**",
|
|
"node_modules/**",
|
|
"coverage/**",
|
|
"scripts/**",
|
|
"config/test/**",
|
|
"jest.setup.js"
|
|
],
|
|
"globals": {
|
|
"jest": "readonly"
|
|
},
|
|
"rules": {
|
|
"react/react-in-jsx-scope": "off",
|
|
"react/no-unescaped-entities": "error",
|
|
"react/jsx-no-target-blank": "error",
|
|
"react/self-closing-comp": "error",
|
|
"@typescript-eslint/no-unused-vars": ["error", {
|
|
"argsIgnorePattern": "^_",
|
|
"varsIgnorePattern": "^_"
|
|
}],
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
"no-console": ["warn", { "allow": ["warn", "error"] }],
|
|
"prefer-const": "error",
|
|
"no-var": "error",
|
|
"eqeqeq": ["error", "always"],
|
|
"curly": ["error", "all"],
|
|
"no-throw-literal": "error",
|
|
"prefer-promise-reject-errors": "error"
|
|
}
|
|
}
|