typescript - 如何在打字稿中禁用独角兽/首选模块?
问题描述
禁用的正确方法是unicorn/prefer-module
什么?
我已经试过了/* eslint-disable unicorn/prefer-module */
但我越来越[eslint unicorn/prefer-module] [E] Definition for rule 'unicorn/prefer-module' was not found.
包.json
{
"name": "",
"version": "0.1.0",
"main": "lib/index.js",
"dependencies": {
"argon2": "^0.28.2",
"date-fns": "^2.22.1",
"express": "^4.17.1",
"express-mysql-session": "^2.1.6",
"express-session": "^1.17.2",
"helmet": "^4.6.0",
"mysql2": "^2.2.5"
},
"devDependencies": {
"@types/express": "^4.17.12",
"@types/express-mysql-session": "^2.1.2",
"@types/express-session": "^1.17.3",
"@types/helmet": "^4.0.0",
"@types/node": "^15.12.4",
"eslint-plugin-unicorn": "^32.0.1",
"typescript": "^4.3.4",
"xo": "^0.40.3"
},
"eslintConfig": {
"extends": [
"xo",
"xo-typescript"
],
"rules": {
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/dot-notation": "off"
}
},
"xo": {
"rules": {
"@typescript-eslint/no-require-imports": 0,
"@typescript-eslint/dot-notation": 0,
"unicorn/prevent-abbreviations": 0
}
}
}
解决方案
推荐阅读
- c# - 仅将身份服务器 4 用于没有 OpenID Connect 范围的 Oauth2 授权 - 可能吗?
- javascript - 函数 - 每隔一个单词返回一个大写字母
- android - 通过 NFC 发送 NdefRecord 但接收 android.nfc.tech.IsoDep
- flutter - 如何使用 Shortcuts/Intent/Actions 在 Flutter 中注册应用程序全局操作?
- oracle - 选择 DISTINCT 结果后的字符串连接
- javascript - JavaScript:动态更改数据范围规则的值
- azure-devops - 使用 azure dev ops 拉取请求代码覆盖率失败
- reactjs - 所以我使用 moment.js 来查找来自后端(UTC)的时间和来自 moment.js 的本地时间的时差
- bash - 是否可以在 Bash 脚本的 switch case 中结合两个条件?
- javascript - Javascript元素选择和修改