mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
use ts-es-tree-typings, support import-equals
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
|
||||
function createImportRuleListener(validateImport) {
|
||||
function _checkImport(node) {
|
||||
if (node && node.type === 'Literal' && typeof node.value === 'string') {
|
||||
@@ -23,6 +24,13 @@ function createImportRuleListener(validateImport) {
|
||||
_checkImport(args[0]);
|
||||
}
|
||||
},
|
||||
// import foo = ...
|
||||
[experimental_utils_1.AST_NODE_TYPES.TSImportEqualsDeclaration]: (node) => {
|
||||
const { moduleReference } = node;
|
||||
if (moduleReference.type === experimental_utils_1.AST_NODE_TYPES.TSExternalModuleReference) {
|
||||
_checkImport(moduleReference.expression);
|
||||
}
|
||||
},
|
||||
// export ?? from 'module'
|
||||
ExportAllDeclaration: (node) => {
|
||||
_checkImport(node.source);
|
||||
@@ -30,7 +38,7 @@ function createImportRuleListener(validateImport) {
|
||||
// export {foo} from 'module'
|
||||
ExportNamedDeclaration: (node) => {
|
||||
_checkImport(node.source);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
exports.createImportRuleListener = createImportRuleListener;
|
||||
|
||||
Reference in New Issue
Block a user