加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.eslintrc.json 30.48 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"jsdoc"
],
"rules": {
"constructor-super": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-buffer-constructor": "warn",
"no-caller": "warn",
"no-debugger": "warn",
"no-duplicate-case": "warn",
"no-duplicate-imports": "warn",
"no-eval": "warn",
"no-extra-semi": "warn",
"no-new-wrappers": "warn",
"no-redeclare": "off",
"no-sparse-arrays": "warn",
"no-throw-literal": "warn",
"no-unsafe-finally": "warn",
"no-unused-labels": "warn",
"no-restricted-globals": [
"warn",
"name",
"length",
"event",
"closed",
"external",
"status",
"origin",
"orientation",
"context"
], // non-complete list of globals that are easy to access unintentionally
"no-var": "warn",
"jsdoc/no-types": "warn",
"semi": "off",
"@typescript-eslint/semi": "warn",
"@typescript-eslint/class-name-casing": "warn",
"code-no-unused-expressions": [
"warn",
{
"allowTernary": true
}
],
"code-translation-remind": "warn",
"code-no-nls-in-standalone-editor": "warn",
"code-no-standalone-editor": "warn",
"code-no-unexternalized-strings": "warn",
"code-layering": [
"warn",
{
"common": [],
"node": [
"common"
],
"browser": [
"common"
],
"electron-main": [
"common",
"node"
],
"electron-browser": [
"common",
"browser",
"node"
]
}
],
"code-import-patterns": [
"warn",
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// !!! Do not relax these rules !!!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
{
"target": "**/vs/base/common/**",
"restrictions": [
"vs/nls",
"**/vs/base/common/**"
]
},
{
"target": "**/vs/base/test/common/**",
"restrictions": [
"assert",
"sinon",
"vs/nls",
"**/vs/base/common/**",
"**/vs/base/test/common/**"
]
},
{
"target": "**/vs/base/browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/{common,browser}/**"
]
},
{
"target": "**/vs/base/node/**",
"restrictions": [
"vs/nls",
"**/vs/base/{common,node}/**",
"*" // node modules
]
},
{
// vs/base/test/browser contains tests for vs/base/browser
"target": "**/vs/base/test/browser/**",
"restrictions": [
"assert",
"sinon",
"vs/nls",
"**/vs/base/{common,browser}/**",
"**/vs/base/test/{common,browser}/**"
]
},
{
"target": "**/vs/base/parts/*/common/**",
"restrictions": [
"vs/nls",
"**/vs/base/common/**",
"**/vs/base/parts/*/common/**"
]
},
{
"target": "**/vs/base/parts/*/browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/{common,browser}/**",
"**/vs/base/parts/*/{common,browser}/**"
]
},
{
"target": "**/vs/base/parts/*/node/**",
"restrictions": [
"vs/nls",
"**/vs/base/{common,node}/**",
"**/vs/base/parts/*/{common,node}/**",
"*" // node modules
]
},
{
"target": "**/vs/base/parts/*/electron-browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/{common,browser,node,electron-browser}/**",
"**/vs/base/parts/*/{common,browser,node,electron-browser}/**",
"*" // node modules
]
},
{
"target": "**/vs/base/parts/*/electron-main/**",
"restrictions": [
"vs/nls",
"**/vs/base/{common,node,electron-main}/**",
"**/vs/base/parts/*/{common,node,electron-main}/**",
"*" // node modules
]
},
{
"target": "**/vs/platform/*/common/**",
"restrictions": [
"vs/nls",
"**/vs/base/common/**",
"**/vs/base/parts/*/common/**",
"**/vs/platform/*/common/**"
]
},
{
"target": "**/vs/platform/*/test/common/**",
"restrictions": [
"assert",
"sinon",
"vs/nls",
"**/vs/base/common/**",
"**/vs/base/parts/*/common/**",
"**/vs/platform/*/common/**",
"**/vs/platform/*/test/common/**"
]
},
{
"target": "**/vs/platform/*/browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/{common,browser}/**",
"**/vs/base/parts/*/{common,browser}/**",
"**/vs/platform/*/{common,browser}/**"
]
},
{
"target": "**/vs/platform/*/node/**",
"restrictions": [
"vs/nls",
"**/vs/base/{common,node}/**",
"**/vs/base/parts/*/{common,node}/**",
"**/vs/platform/*/{common,node}/**",
"*" // node modules
]
},
{
"target": "**/vs/platform/*/electron-browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/{common,browser,node}/**",
"**/vs/base/parts/*/{common,browser,node,electron-browser}/**",
"**/vs/platform/*/{common,browser,node,electron-browser}/**",
"*" // node modules
]
},
{
"target": "**/vs/platform/*/electron-main/**",
"restrictions": [
"vs/nls",
"**/vs/base/{common,node,electron-main}/**",
"**/vs/base/parts/*/{common,node,electron-main}/**",
"**/vs/platform/*/{common,node,electron-main}/**",
"**/vs/code/**",
"*" // node modules
]
},
{
"target": "**/vs/platform/*/test/browser/**",
"restrictions": [
"assert",
"sinon",
"vs/nls",
"**/vs/base/{common,browser}/**",
"**/vs/platform/*/{common,browser}/**",
"**/vs/platform/*/test/{common,browser}/**"
]
},
{
"target": "**/vs/editor/common/**",
"restrictions": [
"vs/nls",
"**/vs/base/common/**",
"**/vs/base/worker/**",
"**/vs/platform/*/common/**",
"**/vs/editor/common/**"
]
},
{
"target": "**/vs/editor/test/common/**",
"restrictions": [
"assert",
"sinon",
"vs/nls",
"**/vs/base/common/**",
"**/vs/platform/*/common/**",
"**/vs/platform/*/test/common/**",
"**/vs/editor/common/**",
"**/vs/editor/test/common/**"
]
},
{
"target": "**/vs/editor/browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/{common,browser}/**",
"**/vs/platform/*/{common,browser}/**",
"**/vs/editor/{common,browser}/**"
]
},
{
"target": "**/vs/editor/test/browser/**",
"restrictions": [
"assert",
"sinon",
"vs/nls",
"**/vs/base/{common,browser}/**",
"**/vs/platform/*/{common,browser}/**",
"**/vs/platform/*/test/{common,browser}/**",
"**/vs/editor/{common,browser}/**",
"**/vs/editor/test/{common,browser}/**"
]
},
{
"target": "**/vs/editor/standalone/common/**",
"restrictions": [
"vs/nls",
"**/vs/base/common/**",
"**/vs/platform/*/common/**",
"**/vs/editor/common/**",
"**/vs/editor/standalone/common/**"
]
},
{
"target": "**/vs/editor/standalone/test/common/**",
"restrictions": [
"assert",
"sinon",
"vs/nls",
"**/vs/base/common/**",
"**/vs/platform/*/common/**",
"**/vs/platform/*/test/common/**",
"**/vs/editor/common/**",
"**/vs/editor/test/common/**"
]
},
{
"target": "**/vs/editor/standalone/browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/{common,browser}/**",
"**/vs/base/parts/*/{common,browser}/**",
"**/vs/platform/*/{common,browser}/**",
"**/vs/editor/{common,browser}/**",
"**/vs/editor/contrib/**",
"**/vs/editor/standalone/{common,browser}/**"
]
},
{
"target": "**/vs/editor/standalone/test/browser/**",
"restrictions": [
"assert",
"sinon",
"vs/nls",
"**/vs/base/{common,browser}/**",
"**/vs/platform/*/{common,browser}/**",
"**/vs/platform/*/test/{common,browser}/**",
"**/vs/editor/{common,browser}/**",
"**/vs/editor/standalone/{common,browser}/**",
"**/vs/editor/test/{common,browser}/**"
]
},
{
"target": "**/vs/editor/contrib/*/test/**",
"restrictions": [
"assert",
"sinon",
"vs/nls",
"**/vs/base/{common,browser}/**",
"**/vs/base/test/{common,browser}/**",
"**/vs/base/parts/*/{common,browser}/**",
"**/vs/platform/*/{common,browser}/**",
"**/vs/platform/*/test/{common,browser}/**",
"**/vs/editor/{common,browser}/**",
"**/vs/editor/test/{common,browser}/**",
"**/vs/editor/contrib/**"
]
},
{
"target": "**/vs/editor/contrib/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/{common,browser}/**",
"**/vs/base/parts/*/{common,browser}/**",
"**/vs/platform/{common,browser}/**",
"**/vs/platform/*/{common,browser}/**",
"**/vs/editor/{common,browser}/**",
"**/vs/editor/contrib/**"
]
},
{
"target": "**/vs/workbench/common/**",
"restrictions": [
"vs/nls",
"**/vs/base/common/**",
"**/vs/base/parts/*/common/**",
"**/vs/platform/*/common/**",
"**/vs/editor/common/**",
"**/vs/editor/contrib/*/common/**",
"**/vs/workbench/common/**",
"**/vs/workbench/services/*/common/**",
"assert"
]
},
{
"target": "**/vs/workbench/browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/{common,browser}/**",
"**/vs/base/parts/*/{common,browser}/**",
"**/vs/platform/*/{common,browser}/**",
"**/vs/editor/{common,browser}/**",
"**/vs/editor/contrib/**", // editor/contrib is equivalent to /browser/ by convention
"**/vs/workbench/workbench.web.api",
"**/vs/workbench/{common,browser}/**",
"**/vs/workbench/services/*/{common,browser}/**",
"assert"
]
},
{
"target": "**/vs/workbench/api/common/**",
"restrictions": [
"vscode",
"vs/nls",
"**/vs/base/common/**",
"**/vs/platform/*/common/**",
"**/vs/editor/common/**",
"**/vs/editor/contrib/*/common/**",
"**/vs/workbench/api/common/**",
"**/vs/workbench/common/**",
"**/vs/workbench/services/*/common/**",
"**/vs/workbench/contrib/*/common/**"
]
},
{
"target": "**/vs/workbench/api/worker/**",
"restrictions": [
"vscode",
"vs/nls",
"**/vs/**/{common,worker}/**"
]
},
{
"target": "**/vs/workbench/electron-browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/{common,browser,node,electron-browser}/**",
"**/vs/base/parts/*/{common,browser,node,electron-browser}/**",
"**/vs/platform/*/{common,browser,node,electron-browser}/**",
"**/vs/editor/{common,browser,node,electron-browser}/**",
"**/vs/editor/contrib/**", // editor/contrib is equivalent to /browser/ by convention
"**/vs/workbench/{common,browser,node,electron-browser,api}/**",
"**/vs/workbench/services/*/{common,browser,node,electron-browser}/**",
"*" // node modules
]
},
{
"target": "**/vs/workbench/services/**/test/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**",
"**/vs/platform/**",
"**/vs/editor/**",
"**/vs/workbench/{common,browser,node,electron-browser}/**",
"vs/workbench/contrib/files/common/editors/fileEditorInput",
"**/vs/workbench/services/**",
"**/vs/workbench/test/**",
"*" // node modules
]
},
{
"target": "**/vs/workbench/services/**/common/**",
"restrictions": [
"vs/nls",
"**/vs/base/**/common/**",
"**/vs/platform/**/common/**",
"**/vs/editor/common/**",
"**/vs/workbench/workbench.web.api",
"**/vs/workbench/common/**",
"**/vs/workbench/services/**/common/**",
"**/vs/workbench/api/**/common/**",
"vscode-textmate",
"vscode-oniguruma"
]
},
{
"target": "**/vs/workbench/services/**/worker/**",
"restrictions": [
"vs/nls",
"**/vs/base/**/common/**",
"**/vs/platform/**/common/**",
"**/vs/editor/common/**",
"**/vs/workbench/**/common/**",
"**/vs/workbench/**/worker/**",
"**/vs/workbench/services/**/common/**",
"vscode"
]
},
{
"target": "**/vs/workbench/services/**/browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**/{common,browser,worker}/**",
"**/vs/platform/**/{common,browser}/**",
"**/vs/editor/{common,browser}/**",
"**/vs/workbench/workbench.web.api",
"**/vs/workbench/{common,browser}/**",
"**/vs/workbench/api/{common,browser}/**",
"**/vs/workbench/services/**/{common,browser}/**",
"vscode-textmate",
"vscode-oniguruma"
]
},
{
"target": "**/vs/workbench/services/**/node/**",
"restrictions": [
"vs/nls",
"**/vs/base/**/{common,node}/**",
"**/vs/platform/**/{common,node}/**",
"**/vs/editor/{common,node}/**",
"**/vs/workbench/{common,node}/**",
"**/vs/workbench/api/{common,node}/**",
"**/vs/workbench/services/**/{common,node}/**",
"*" // node modules
]
},
{
"target": "**/vs/workbench/services/**/electron-browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**/{common,browser,worker,node,electron-browser}/**",
"**/vs/platform/**/{common,browser,node,electron-browser}/**",
"**/vs/editor/**",
"**/vs/workbench/{common,browser,node,electron-browser,api}/**",
"**/vs/workbench/services/**/{common,browser,node,electron-browser}/**",
"*" // node modules
]
},
{
"target": "**/vs/workbench/contrib/**/test/**",
"restrictions": [
"assert",
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**",
"**/vs/platform/**",
"**/vs/editor/**",
"**/vs/workbench/{common,browser,node,electron-browser}/**",
"**/vs/workbench/services/**",
"**/vs/workbench/contrib/**",
"**/vs/workbench/test/**",
"*"
]
},
{
"target": "**/vs/workbench/contrib/terminal/browser/**",
"restrictions": [
// xterm and its addons are strictly browser-only components
"xterm",
"xterm-addon-*",
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**/{common,browser}/**",
"**/vs/platform/**/{common,browser}/**",
"**/vs/editor/**",
"**/vs/workbench/{common,browser}/**",
"**/vs/workbench/contrib/**/{common,browser}/**",
"**/vs/workbench/services/**/{common,browser}/**"
]
},
{
"target": "**/vs/workbench/contrib/extensions/browser/**",
"restrictions": [
"semver-umd",
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**/{common,browser}/**",
"**/vs/platform/**/{common,browser}/**",
"**/vs/editor/**",
"**/vs/workbench/{common,browser}/**",
"**/vs/workbench/contrib/**/{common,browser}/**",
"**/vs/workbench/services/**/{common,browser}/**"
]
},
{
"target": "**/vs/workbench/contrib/update/browser/update.ts",
"restrictions": [
"semver-umd",
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**/{common,browser}/**",
"**/vs/platform/**/{common,browser}/**",
"**/vs/editor/**",
"**/vs/workbench/{common,browser}/**",
"**/vs/workbench/contrib/**/{common,browser}/**",
"**/vs/workbench/services/**/{common,browser}/**"
]
},
{
"target": "**/vs/workbench/contrib/**/common/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**/common/**",
"**/vs/platform/**/common/**",
"**/vs/editor/**",
"**/vs/workbench/common/**",
"**/vs/workbench/api/common/**",
"**/vs/workbench/services/**/common/**",
"**/vs/workbench/contrib/**/common/**"
]
},
{
"target": "**/vs/workbench/contrib/**/browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**/{common,browser}/**",
"**/vs/platform/**/{common,browser}/**",
"**/vs/editor/**",
"**/vs/workbench/{common,browser}/**",
"**/vs/workbench/api/{common,browser}/**",
"**/vs/workbench/services/**/{common,browser}/**",
"**/vs/workbench/contrib/**/{common,browser}/**"
]
},
{
"target": "**/vs/workbench/contrib/**/node/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**/{common,node}/**",
"**/vs/platform/**/{common,node}/**",
"**/vs/editor/**/common/**",
"**/vs/workbench/{common,node}/**",
"**/vs/workbench/api/{common,node}/**",
"**/vs/workbench/services/**/{common,node}/**",
"**/vs/workbench/contrib/**/{common,node}/**",
"*" // node modules
]
},
{
"target": "**/vs/workbench/contrib/**/electron-browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**/{common,browser,worker,node,electron-browser}/**",
"**/vs/platform/**/{common,browser,node,electron-browser}/**",
"**/vs/editor/**",
"**/vs/workbench/{common,browser,node,electron-browser,api}/**",
"**/vs/workbench/services/**/{common,browser,node,electron-browser}/**",
"**/vs/workbench/contrib/**/{common,browser,node,electron-browser}/**",
"*" // node modules
]
},
{
"target": "**/vs/code/node/**",
"restrictions": [
"vs/nls",
"**/vs/base/**/{common,node}/**",
"**/vs/base/parts/**/{common,node}/**",
"**/vs/platform/**/{common,node}/**",
"**/vs/code/**/{common,node}/**",
"*" // node modules
]
},
{
"target": "**/vs/code/electron-browser/**",
"restrictions": [
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**/{common,browser,node,electron-browser}/**",
"**/vs/base/parts/**/{common,browser,node,electron-browser}/**",
"**/vs/platform/**/{common,browser,node,electron-browser}/**",
"**/vs/code/**/{common,browser,node,electron-browser}/**",
"*" // node modules
]
},
{
"target": "**/vs/code/electron-main/**",
"restrictions": [
"vs/nls",
"**/vs/base/**/{common,node,electron-main}/**",
"**/vs/base/parts/**/{common,node,electron-main}/**",
"**/vs/platform/**/{common,node,electron-main}/**",
"**/vs/code/**/{common,node,electron-main}/**",
"*" // node modules
]
},
{
"target": "**/vs/server/**",
"restrictions": [
"vs/nls",
"**/vs/base/**/{common,node}/**",
"**/vs/base/parts/**/{common,node}/**",
"**/vs/platform/**/{common,node}/**",
"**/vs/workbench/**/{common,node}/**",
"**/vs/server/**",
"**/vs/code/**/{common,node}/**",
"*" // node modules
]
},
{
"target": "**/extensions/**",
"restrictions": "**/*"
},
{
"target": "**/test/smoke/**",
"restrictions": [
"**/test/smoke/**",
"*" // node modules
]
},
{
"target": "**/test/automation/**",
"restrictions": [
"**/test/automation/**",
"*" // node modules
]
},
{
"target": "**/test/integration/**",
"restrictions": [
"**/test/integration/**",
"*" // node modules
]
},
{
"target": "**/api/**.test.ts",
"restrictions": [
"**/vs/**",
"assert",
"sinon",
"crypto",
"vscode"
]
},
{
"target": "**/{node,electron-browser,electron-main}/**/*.test.ts",
"restrictions": [
"**/vs/**",
"*" // node modules
]
},
{
"target": "**/{node,electron-browser,electron-main}/**/test/**",
"restrictions": [
"**/vs/**",
"*" // node modules
]
},
{
"target": "**/test/{node,electron-browser,electron-main}/**",
"restrictions": [
"**/vs/**",
"*" // node modules
]
},
{
"target": "**/**.test.ts",
"restrictions": [
"**/vs/**",
"assert",
"sinon",
"crypto",
"xterm*"
]
},
{
"target": "**/test/**",
"restrictions": [
"**/vs/**",
"assert",
"sinon",
"crypto",
"xterm*"
]
}
]
},
"overrides": [
{
"files": [
"*.js"
],
"rules": {
"jsdoc/no-types": "off"
}
},
{
"files": [
"**/vscode.d.ts",
"**/vscode.proposed.d.ts"
],
"rules": {
"vscode-dts-create-func": "warn",
"vscode-dts-literal-or-types": "warn",
"vscode-dts-interface-naming": "warn",
"vscode-dts-event-naming": [
"warn",
{
"allowed": [
"onCancellationRequested",
"event"
],
"verbs": [
"accept",
"change",
"close",
"collapse",
"create",
"delete",
"dispose",
"edit",
"end",
"expand",
"hide",
"open",
"override",
"receive",
"register",
"rename",
"save",
"send",
"start",
"terminate",
"trigger",
"unregister",
"write"
]
}
]
}
}
]
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化