tslint 怎么对某个页面禁用检查

image.png

image.png

怎么只在index.tsx这个页面禁用变量检查?

上面是报错信息,下面是相关代码:

//pages/index.tsx

//rule没使用导致检查不过**********

const checkRealName = (rule, value) => {
    if (!value) {
      return Promise.reject('请输入真实姓名');
    }else if(value.length > 50) {
      return Promise.reject('姓名长度不可超过50个字符');
    }
    return Promise.resolve();
  }
{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "jsx": "preserve",
    "moduleResolution": "node",
    "allowSyntheticDefaultImports": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "removeComments": false,
    "preserveConstEnums": true,
    "sourceMap": true,
    "skipLibCheck": true,
    "experimentalDecorators": true,
    "typeRoots": ["./node_modules/@types", "./typings"],
    "lib": ["dom", "es2015", "es2016", "es2017"],
    "allowJs": false,
    "strict": false,
    "forceConsistentCasingInFileNames": true,
    "noEmit": false,
    "esModuleInterop": true,
    "resolveJsonModule": true,
    "isolatedModules": true
  },
  "exclude": [".next", "node_modules"],
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}
阅读 6.4k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题