'message':'Use <targetWindow>.document.activeElement to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.contains to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.styleSheets to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.fullscreenElement to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.body to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.addEventListener to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.removeEventListener to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.hasFocus to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.head to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.exitFullscreen to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.getElementById to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.getElementsByClassName to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.getElementsByName to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.getElementsByTagName to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.getElementsByTagNameNS to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.getSelection to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.open to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.close to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.documentElement to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.visibilityState to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.querySelector to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.querySelectorAll to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.elementFromPoint to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.elementsFromPoint to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.onkeydown to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.onkeyup to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.onmousedown to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.onmouseup to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
'message':'Use <targetWindow>.document.execCommand to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
}
],
'no-restricted-globals':[
'warn',
'name',
'length',
'event',
'closed',
'external',
'status',
'origin',
'orientation',
'context',
{
'name':'setInterval',
'message':'Use <targetWindow>.setInterval to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'clearInterval',
'message':'Use <targetWindow>.clearInterval to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'requestAnimationFrame',
'message':'Use <targetWindow>.requestAnimationFrame to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'cancelAnimationFrame',
'message':'Use <targetWindow>.cancelAnimationFrame to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'requestIdleCallback',
'message':'Use <targetWindow>.requestIdleCallback to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'cancelIdleCallback',
'message':'Use <targetWindow>.cancelIdleCallback to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'window',
'message':'Use <targetWindow> to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'addEventListener',
'message':'Use <targetWindow>.addEventListener to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'removeEventListener',
'message':'Use <targetWindow>.removeEventListener to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'getComputedStyle',
'message':'Use <targetWindow>.getComputedStyle to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'focus',
'message':'Use <targetWindow>.focus to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'blur',
'message':'Use <targetWindow>.blur to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'close',
'message':'Use <targetWindow>.close to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'dispatchEvent',
'message':'Use <targetWindow>.dispatchEvent to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'getSelection',
'message':'Use <targetWindow>.getSelection to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'matchMedia',
'message':'Use <targetWindow>.matchMedia to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'open',
'message':'Use <targetWindow>.open to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'parent',
'message':'Use <targetWindow>.parent to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'postMessage',
'message':'Use <targetWindow>.postMessage to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'devicePixelRatio',
'message':'Use <targetWindow>.devicePixelRatio to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'frames',
'message':'Use <targetWindow>.frames to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'frameElement',
'message':'Use <targetWindow>.frameElement to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'innerHeight',
'message':'Use <targetWindow>.innerHeight to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'innerWidth',
'message':'Use <targetWindow>.innerWidth to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'outerHeight',
'message':'Use <targetWindow>.outerHeight to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'outerWidth',
'message':'Use <targetWindow>.outerWidth to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'opener',
'message':'Use <targetWindow>.opener to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'origin',
'message':'Use <targetWindow>.origin to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'screen',
'message':'Use <targetWindow>.screen to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'screenLeft',
'message':'Use <targetWindow>.screenLeft to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'screenTop',
'message':'Use <targetWindow>.screenTop to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'screenX',
'message':'Use <targetWindow>.screenX to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'screenY',
'message':'Use <targetWindow>.screenY to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'scrollX',
'message':'Use <targetWindow>.scrollX to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'scrollY',
'message':'Use <targetWindow>.scrollY to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'top',
'message':'Use <targetWindow>.top to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
},
{
'name':'visualViewport',
'message':'Use <targetWindow>.visualViewport to support multi-window scenarios. Resolve targetWindow with DOM.getWindow(element) or DOM.getActiveWindow() or use the predefined mainWindow constant.'
}
]
}
},
// electron-utility layer
{
files:[
'src/**/electron-utility/**/*.ts'
],
languageOptions:{
parser:tseslint.parser,
},
rules:{
'no-restricted-imports':[
'warn',
{
'paths':[
{
'name':'electron',
'allowImportNames':[
'net',
'system-preferences',
],
'message':'Only net and system-preferences are allowed to be imported from electron'
}
]
}
]
}
},
{
files:[
'src/**/*.ts'
],
languageOptions:{
parser:tseslint.parser,
},
plugins:{
'local':pluginLocal,
},
rules:{
'local/code-import-patterns':[
'warn',
{
// imports that are allowed in all files of layers:
// - browser
// - electron-sandbox
'when':'hasBrowser',
'allow':[]
},
{
// imports that are allowed in all files of layers:
// - node
// - electron-utility
// - electron-main
'when':'hasNode',
'allow':[
'@parcel/watcher',
'@vscode/sqlite3',
'@vscode/vscode-languagedetection',
'@vscode/ripgrep',
'@vscode/iconv-lite-umd',
'@vscode/policy-watcher',
'@vscode/proxy-agent',
'@vscode/spdlog',
'@vscode/windows-process-tree',
'assert',
'child_process',
'console',
'cookie',
'crypto',
'dns',
'events',
'fs',
'fs/promises',
'http',
'https',
'minimist',
'node:module',
'native-keymap',
'native-watchdog',
'net',
'node-pty',
'os',
'path',
'perf_hooks',
'readline',
'stream',
'string_decoder',
'tas-client-umd',
'tls',
'undici-types',
'url',
'util',
'v8-inspect-profiler',
'vscode-regexpp',
'vscode-textmate',
'worker_threads',
'@xterm/addon-clipboard',
'@xterm/addon-image',
'@xterm/addon-ligatures',
'@xterm/addon-search',
'@xterm/addon-serialize',
'@xterm/addon-unicode11',
'@xterm/addon-webgl',
'@xterm/headless',
'@xterm/xterm',
'yauzl',
'yazl',
'zlib'
]
},
{
// imports that are allowed in all files of layers:
// - electron-utility
// - electron-main
'when':'hasElectron',
'allow':[
'electron'
]
},
{
// imports that are allowed in all /test/ files
'when':'test',
'allow':[
'assert',
'sinon',
'sinon-test'
]
},
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// !!! Do not relax these rules !!!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// A path ending in /~ has a special meaning. It indicates a template position
// which will be substituted with one or more layers.
//
// When /~ is used in the target, the rule will be expanded to 14 distinct rules.
// e.g. 'src/vs/base/~' will be expanded to:
// - src/vs/base/common
// - src/vs/base/worker
// - src/vs/base/browser
// - src/vs/base/electron-sandbox
// - src/vs/base/node
// - src/vs/base/electron-main
// - src/vs/base/test/common
// - src/vs/base/test/worker
// - src/vs/base/test/browser
// - src/vs/base/test/electron-sandbox
// - src/vs/base/test/node
// - src/vs/base/test/electron-main
//
// When /~ is used in the restrictions, it will be replaced with the correct
// layers that can be used e.g. 'src/vs/base/electron-sandbox' will be able
// to import '{common,browser,electron-sanbox}', etc.
//
// It is possible to use /~ in the restrictions property even without using it in
// the target property by adding a layer property.
{
'target':'src/vs/base/~',
'restrictions':[
'vs/base/~'
]
},
{
'target':'src/vs/base/parts/*/~',
'restrictions':[
'vs/base/~',
'vs/base/parts/*/~'
]
},
{
'target':'src/vs/platform/*/~',
'restrictions':[
'vs/base/~',
'vs/base/parts/*/~',
'vs/platform/*/~',
'tas-client-umd',// node module allowed even in /common/
'@microsoft/1ds-core-js',// node module allowed even in /common/
'@microsoft/1ds-post-js',// node module allowed even in /common/
'@xterm/headless'// node module allowed even in /common/
]
},
{
'target':'src/vs/editor/~',
'restrictions':[
'vs/base/~',
'vs/base/parts/*/~',
'vs/platform/*/~',
'vs/editor/~',
'@vscode/tree-sitter-wasm'// node module allowed even in /common/