Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 52 additions & 104 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"leven": "^3.1.0",
"markdown-it": "^14.1.0",
"mime": "^1.3.4",
"minimatch": "^3.0.3",
"minimatch": "^10.2.2",
"parse-semver": "^1.1.1",
"read": "^1.0.7",
"secretlint": "^10.1.2",
Expand All @@ -76,7 +76,6 @@
"@types/hosted-git-info": "^3.0.2",
"@types/markdown-it": "^0.0.2",
"@types/mime": "^1",
"@types/minimatch": "^3.0.3",
"@types/mocha": "^7.0.2",
"@types/node": "^16.11.7",
"@types/read": "^0.0.28",
Expand Down
12 changes: 6 additions & 6 deletions src/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ExtensionKind, ManifestPackage, UnverifiedManifest } from './manifest';
import { ITranslations, patchNLS } from './nls';
import * as util from './util';
import { glob } from 'glob';
import minimatch from 'minimatch';
import { minimatch, MinimatchOptions } from 'minimatch';
import markdownit from 'markdown-it';
import * as cheerio from 'cheerio';
import * as url from 'url';
Expand All @@ -30,7 +30,7 @@ import * as jsonc from 'jsonc-parser';
import * as vsceSign from '@vscode/vsce-sign';
import { getRuleNameFromRuleId, lintFiles, lintText, prettyPrintLintResult } from './secretLint';

const MinimatchOptions: minimatch.IOptions = { dot: true };
const minimatchOptions: MinimatchOptions = { dot: true };

export interface IInMemoryFile {
path: string;
Expand Down Expand Up @@ -1758,8 +1758,8 @@ function collectFiles(
.then(({ ignore, negate }) =>
files.filter(
f =>
!ignore.some(i => minimatch(f, i, MinimatchOptions)) ||
negate.some(i => minimatch(f, i.substr(1), MinimatchOptions))
!ignore.some(i => minimatch(f, i, minimatchOptions)) ||
negate.some(i => minimatch(f, i.substr(1), minimatchOptions))
)
)
);
Expand Down Expand Up @@ -2097,13 +2097,13 @@ export async function printAndValidatePackagedFiles(files: IFile[], cwd: string,
const unusedIncludePatterns = filesIncludePatterns.filter(includePattern => {
let absoluteIncludePattern = includePattern.absolute;
// Check if the pattern provided by the user matches any file in the package
if (localPaths.some(localFilePath => minimatch(localFilePath, absoluteIncludePattern, MinimatchOptions))) {
if (localPaths.some(localFilePath => minimatch(localFilePath, absoluteIncludePattern, minimatchOptions))) {
return false;
}
// Check if the pattern provided by the user matches any folder in the package
if (!/(^|\/)[^/]*\*[^/]*$/.test(absoluteIncludePattern)) {
absoluteIncludePattern = (/\/$/.test(absoluteIncludePattern) ? `${absoluteIncludePattern}**` : `${absoluteIncludePattern}/**`);
return !localPaths.some(localFilePath => minimatch(localFilePath, absoluteIncludePattern, MinimatchOptions));
return !localPaths.some(localFilePath => minimatch(localFilePath, absoluteIncludePattern, minimatchOptions));
}
// Pattern does not match any file or folder
return true;
Expand Down
Loading