mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-13 15:09:13 +00:00
js 代码检查放宽
This commit is contained in:
22
.eslintrc.js
22
.eslintrc.js
@@ -20,7 +20,7 @@ module.exports = {
|
||||
},
|
||||
ecmaVersion: 12,
|
||||
sourceType: 'module',
|
||||
project: './tsconfig.json' // 指定 tsconfig.json 的路径
|
||||
project: './tsconfig.eslint.json' // 指向新的 ESLint 配置文件
|
||||
},
|
||||
plugins: [
|
||||
'react',
|
||||
@@ -42,6 +42,26 @@ module.exports = {
|
||||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], // 确保未使用的变量报错
|
||||
'@typescript-eslint/explicit-function-return-type': 'off' // 关闭强制函数返回类型声明
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['.eslintrc.js'],
|
||||
parser: null // 避免对 `.eslintrc.js` 文件使用 TypeScript 解析器
|
||||
},
|
||||
{
|
||||
files: ['**/*.js'], // Match all .js files 对js的代码规范检查不那么严格
|
||||
rules: {
|
||||
'@typescript-eslint/no-unsafe-assignment': 'off',
|
||||
'@typescript-eslint/no-unsafe-argument': 'off',
|
||||
'@typescript-eslint/no-unsafe-member-access': 'off',
|
||||
'@typescript-eslint/no-unsafe-call': 'off',
|
||||
'@typescript-eslint/no-var-requires': 'off',
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/no-floating-promises': 'off'
|
||||
}
|
||||
}
|
||||
],
|
||||
globals: {
|
||||
React: true
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ const isTenantAdminRoute = createRouteMatcher([
|
||||
* @param ev
|
||||
* @returns
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
||||
const noAuthMiddleware = async (req: any, ev: any) => {
|
||||
// 如果没有配置 Clerk 相关环境变量,返回一个默认响应或者继续处理请求
|
||||
return NextResponse.next()
|
||||
|
||||
4
tsconfig.eslint.json
Normal file
4
tsconfig.eslint.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": [".eslintrc.js", "**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
|
||||
}
|
||||
@@ -24,6 +24,13 @@
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve"
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.js", "**/*.ts", "**/*.tsx", "**/*.jsx"],
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.js",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
"**/*.jsx",
|
||||
".eslintrc.js"
|
||||
],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user