mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
* Update build for web issues * Fix remote\web package.json * Remove extension activate test * Add terminal entry point * Bump distro * Update docker files and pipelines * Add linux task * Update build pool * Correct image name * Update pipelines * Fix indention * Update sql-web-build.yml for Azure Pipelines Add new build variable * Update sql-web-build.yml for Azure Pipelines Revert previous commit * Disable sourcemaps upload * Remove compile step * Fix yaml typo * Fix dependson error * Update yaml * Add notebook parameters * Remove web from desktop builds * Add web createDrop script * Bump distro * Change execution mode on createDrop script * Code review feedback * Update CI hygiene cache key * Bump distro * Fix merge conflicts * Revert "Fix merge conflicts" This reverts commit 06f7a58b6e0a065520b7686e8469e4e7682e157a. * Bump distro to before smoke test update
60 lines
2.1 KiB
JavaScript
60 lines
2.1 KiB
JavaScript
"use strict";
|
|
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
const path_1 = require("path");
|
|
const minimatch = require("minimatch");
|
|
const utils_1 = require("./utils");
|
|
module.exports = new class {
|
|
constructor() {
|
|
this.meta = {
|
|
messages: {
|
|
badImport: 'Imports violates \'{{restrictions}}\' restrictions. See https://github.com/microsoft/vscode/wiki/Source-Code-Organization'
|
|
},
|
|
docs: {
|
|
url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization'
|
|
}
|
|
};
|
|
}
|
|
create(context) {
|
|
const configs = context.options;
|
|
for (const config of configs) {
|
|
if (minimatch(context.getFilename(), config.target)) {
|
|
return (0, utils_1.createImportRuleListener)((node, value) => this._checkImport(context, config, node, value));
|
|
}
|
|
}
|
|
return {};
|
|
}
|
|
_checkImport(context, config, node, path) {
|
|
// resolve relative paths
|
|
if (path[0] === '.') {
|
|
path = (0, path_1.join)(context.getFilename(), path);
|
|
}
|
|
let restrictions;
|
|
if (typeof config.restrictions === 'string') {
|
|
restrictions = [config.restrictions];
|
|
}
|
|
else {
|
|
restrictions = config.restrictions;
|
|
}
|
|
let matched = false;
|
|
for (const pattern of restrictions) {
|
|
if (minimatch(path, pattern)) {
|
|
matched = true;
|
|
break;
|
|
}
|
|
}
|
|
if (!matched) {
|
|
// None of the restrictions matched
|
|
context.report({
|
|
loc: node.loc,
|
|
messageId: 'badImport',
|
|
data: {
|
|
restrictions: restrictions.join(' or ')
|
|
}
|
|
});
|
|
}
|
|
}
|
|
};
|