-
Notifications
You must be signed in to change notification settings - Fork 30.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pr/marrej/202668
# Conflicts: # src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.ts # src/vs/editor/standalone/browser/standaloneLanguages.ts # src/vs/workbench/api/common/extHost.api.impl.ts # src/vs/workbench/api/common/extHostTypeConverters.ts
- Loading branch information
Showing
1,319 changed files
with
36,794 additions
and
18,504 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { TSESTree } from '@typescript-eslint/typescript-estree'; | ||
import * as eslint from 'eslint'; | ||
import { dirname, join, relative } from 'path'; | ||
import minimatch from 'minimatch'; | ||
import { createImportRuleListener } from './utils'; | ||
|
||
export = new class implements eslint.Rule.RuleModule { | ||
|
||
readonly meta: eslint.Rule.RuleMetaData = { | ||
messages: { | ||
layerbreaker: 'You are only allowed to import {{import}} from here using `import type ...`.' | ||
}, | ||
schema: { | ||
type: "array", | ||
items: { | ||
type: "object", | ||
additionalProperties: { | ||
type: "array", | ||
items: { | ||
type: "string" | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { | ||
let fileRelativePath = relative(dirname(__dirname), context.getFilename()); | ||
if (!fileRelativePath.endsWith('/')) { | ||
fileRelativePath += '/'; | ||
} | ||
const ruleArgs = <Record<string, string[]>>context.options[0]; | ||
|
||
const matchingKey = Object.keys(ruleArgs).find(key => fileRelativePath.startsWith(key) || minimatch(fileRelativePath, key)); | ||
if (!matchingKey) { | ||
// nothing | ||
return {}; | ||
} | ||
|
||
const restrictedImports = ruleArgs[matchingKey]; | ||
return createImportRuleListener((node, path) => { | ||
if (path[0] === '.') { | ||
path = join(dirname(context.getFilename()), path); | ||
} | ||
|
||
if (( | ||
restrictedImports.includes(path) || restrictedImports.some(restriction => minimatch(path, restriction)) | ||
) && !( | ||
(node.parent?.type === TSESTree.AST_NODE_TYPES.ImportDeclaration && node.parent.importKind === 'type') || | ||
(node.parent && 'exportKind' in node.parent && node.parent.exportKind === 'type'))) { // the export could be multiple types | ||
context.report({ | ||
loc: node.parent!.loc, | ||
messageId: 'layerbreaker', | ||
data: { | ||
import: path | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# ensure the API police is aware of changes to the vscode-dts file | ||
# this is only about the final API, not about proposed API changes | ||
src/vscode-dts/vscode.d.ts @jrieken @mjbvz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
18.17.1 | ||
18.19.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
disturl "https://electronjs.org/headers" | ||
target "27.2.3" | ||
ms_build_id "26495564" | ||
target "28.2.2" | ||
ms_build_id "26836304" | ||
runtime "electron" | ||
build_from_source "true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2023-12-07T16:21:36.646Z | ||
2024-02-05T09:34:15.476Z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.