Initial commit
This commit is contained in:
81
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/ast-guards.d.ts
generated
vendored
Normal file
81
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/ast-guards.d.ts
generated
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
import type { TSESTree } from '@typescript-eslint/types';
|
||||
export declare function isArrayExpression(node: TSESTree.Node): node is TSESTree.ArrayExpression;
|
||||
export declare function isArrowFunctionExpression(node: TSESTree.Node): node is TSESTree.ArrowFunctionExpression;
|
||||
/** default parameters */
|
||||
export declare function isAssignmentPattern(node: TSESTree.Node): node is TSESTree.AssignmentPattern;
|
||||
export declare function isClassDeclaration(node: TSESTree.Node): node is TSESTree.ClassDeclaration;
|
||||
export declare function isClassExpression(node: TSESTree.Node): node is TSESTree.ClassExpression;
|
||||
export declare function isExportDefaultDeclaration(node: TSESTree.Node): node is TSESTree.ExportDefaultDeclaration;
|
||||
export declare function isExpression(node: TSESTree.Node): node is TSESTree.Expression;
|
||||
export declare function isFunctionDeclaration(node: TSESTree.Node): node is TSESTree.FunctionDeclaration;
|
||||
export declare function isFunctionExpression(node: TSESTree.Node): node is TSESTree.FunctionExpression;
|
||||
export declare function isIdentifier(node: TSESTree.Node): node is TSESTree.Identifier;
|
||||
export declare function isLiteral(node: TSESTree.Node): node is TSESTree.Literal;
|
||||
export declare function isMethodDefinition(node: TSESTree.Node): node is TSESTree.MethodDefinition;
|
||||
export declare function isObjectExpression(node: TSESTree.Node): node is TSESTree.ObjectExpression;
|
||||
export declare function isPrivateIdentifier(node: TSESTree.Node): node is TSESTree.PrivateIdentifier;
|
||||
export declare function isProperty(node: TSESTree.Node): node is TSESTree.Property;
|
||||
export declare function isPropertyDefinition(node: TSESTree.Node): node is TSESTree.PropertyDefinition;
|
||||
export declare function isTSEnumDeclaration(node: TSESTree.Node): node is TSESTree.TSEnumDeclaration;
|
||||
export declare function isTSInterfaceDeclaration(node: TSESTree.Node): node is TSESTree.TSInterfaceDeclaration;
|
||||
export declare function isTSModuleDeclaration(node: TSESTree.Node): node is TSESTree.TSModuleDeclaration;
|
||||
export declare function isTSQualifiedName(node: TSESTree.Node): node is TSESTree.TSQualifiedName;
|
||||
export declare function isTSTypeAliasDeclaration(node: TSESTree.Node): node is TSESTree.TSTypeAliasDeclaration;
|
||||
export declare function isVariableDeclarator(node: TSESTree.Node): node is TSESTree.VariableDeclarator;
|
||||
export declare function isClassDeclarationWithName(node: TSESTree.Node): node is TSESTree.ClassDeclarationWithName;
|
||||
export declare function isClassPropertyNameNonComputed(node: TSESTree.Node): node is TSESTree.ClassPropertyNameNonComputed;
|
||||
export declare function isFunctionDeclarationWithName(node: TSESTree.Node): node is TSESTree.FunctionDeclarationWithName;
|
||||
export declare function isNumberLiteral(node: TSESTree.Node): node is TSESTree.NumberLiteral;
|
||||
export declare function isPropertyNameNonComputed(node: TSESTree.Node): node is TSESTree.PropertyNameNonComputed;
|
||||
export declare function isStringLiteral(node: TSESTree.Node): node is TSESTree.StringLiteral;
|
||||
export interface IClassExpressionWithName extends TSESTree.ClassExpression {
|
||||
id: TSESTree.Identifier;
|
||||
}
|
||||
export declare function isClassExpressionWithName(node: TSESTree.Node): node is IClassExpressionWithName;
|
||||
export interface IFunctionExpressionWithName extends TSESTree.FunctionExpression {
|
||||
id: TSESTree.Identifier;
|
||||
}
|
||||
export declare function isFunctionExpressionWithName(node: TSESTree.Node): node is IFunctionExpressionWithName;
|
||||
export type NormalAnonymousExpression = TSESTree.ArrowFunctionExpression | TSESTree.ClassExpression | TSESTree.FunctionExpression | TSESTree.ObjectExpression;
|
||||
export declare function isNormalAnonymousExpression(node: TSESTree.Node): node is NormalAnonymousExpression;
|
||||
export interface INormalAssignmentPattern extends TSESTree.AssignmentPattern {
|
||||
left: TSESTree.Identifier;
|
||||
}
|
||||
export declare function isNormalAssignmentPattern(node: TSESTree.Node): node is INormalAssignmentPattern;
|
||||
export interface INormalClassPropertyDefinition extends TSESTree.PropertyDefinitionNonComputedName {
|
||||
key: TSESTree.PrivateIdentifier | TSESTree.Identifier;
|
||||
value: TSESTree.Expression;
|
||||
}
|
||||
export declare function isNormalClassPropertyDefinition(node: TSESTree.Node): node is INormalClassPropertyDefinition;
|
||||
export interface INormalMethodDefinition extends TSESTree.MethodDefinitionNonComputedName {
|
||||
key: TSESTree.PrivateIdentifier | TSESTree.Identifier;
|
||||
}
|
||||
export declare function isNormalMethodDefinition(node: TSESTree.Node): node is INormalMethodDefinition;
|
||||
export interface INormalObjectProperty extends TSESTree.PropertyNonComputedName {
|
||||
key: TSESTree.Identifier;
|
||||
}
|
||||
export declare function isNormalObjectProperty(node: TSESTree.Node): node is INormalObjectProperty;
|
||||
export type INormalVariableDeclarator = TSESTree.LetOrConstOrVarDeclaration & {
|
||||
id: TSESTree.Identifier;
|
||||
init: TSESTree.Expression;
|
||||
};
|
||||
export declare function isNormalVariableDeclarator(node: TSESTree.Node): node is INormalVariableDeclarator;
|
||||
export interface INormalAssignmentPatternWithAnonymousExpressionAssigned extends INormalAssignmentPattern {
|
||||
right: NormalAnonymousExpression;
|
||||
}
|
||||
export declare function isNormalAssignmentPatternWithAnonymousExpressionAssigned(node: TSESTree.Node): node is INormalAssignmentPatternWithAnonymousExpressionAssigned;
|
||||
export type INormalVariableDeclaratorWithAnonymousExpressionAssigned = INormalVariableDeclarator & {
|
||||
init: NormalAnonymousExpression;
|
||||
};
|
||||
export declare function isNormalVariableDeclaratorWithAnonymousExpressionAssigned(node: TSESTree.Node): node is INormalVariableDeclaratorWithAnonymousExpressionAssigned;
|
||||
export interface INormalObjectPropertyWithAnonymousExpressionAssigned extends INormalObjectProperty {
|
||||
value: NormalAnonymousExpression;
|
||||
}
|
||||
export declare function isNormalObjectPropertyWithAnonymousExpressionAssigned(node: TSESTree.Node): node is INormalObjectPropertyWithAnonymousExpressionAssigned;
|
||||
export interface INormalClassPropertyDefinitionWithAnonymousExpressionAssigned extends INormalClassPropertyDefinition {
|
||||
value: NormalAnonymousExpression;
|
||||
}
|
||||
export declare function isNormalClassPropertyDefinitionWithAnonymousExpressionAssigned(node: TSESTree.Node): node is INormalClassPropertyDefinitionWithAnonymousExpressionAssigned;
|
||||
export type NodeWithName = TSESTree.ClassDeclarationWithName | TSESTree.FunctionDeclarationWithName | IClassExpressionWithName | IFunctionExpressionWithName | INormalVariableDeclaratorWithAnonymousExpressionAssigned | INormalObjectPropertyWithAnonymousExpressionAssigned | INormalClassPropertyDefinitionWithAnonymousExpressionAssigned | INormalAssignmentPatternWithAnonymousExpressionAssigned | INormalMethodDefinition | TSESTree.TSEnumDeclaration | TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeAliasDeclaration;
|
||||
export declare function isNodeWithName(node: TSESTree.Node): node is NodeWithName;
|
||||
//# sourceMappingURL=ast-guards.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/ast-guards.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/ast-guards.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"ast-guards.d.ts","sourceRoot":"","sources":["../../src/eslint-bulk-suppressions/ast-guards.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,eAAe,CAEvF;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,uBAAuB,CAEvG;AAED,yBAAyB;AACzB,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,iBAAiB,CAE3F;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,gBAAgB,CAEzF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,eAAe,CAEvF;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,wBAAwB,CAEzG;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,UAAU,CAE7E;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,mBAAmB,CAE/F;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,kBAAkB,CAE7F;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,UAAU,CAE7E;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,OAAO,CAEvE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,gBAAgB,CAEzF;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,gBAAgB,CAEzF;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,iBAAiB,CAE3F;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,QAAQ,CAEzE;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,kBAAkB,CAE7F;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,iBAAiB,CAE3F;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,sBAAsB,CAErG;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,mBAAmB,CAE/F;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,eAAe,CAEvF;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,sBAAsB,CAErG;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,kBAAkB,CAE7F;AAGD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,wBAAwB,CAEzG;AAED,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,IAAI,IAAI,QAAQ,CAAC,4BAA4B,CAE/C;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,IAAI,IAAI,QAAQ,CAAC,2BAA2B,CAE9C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,aAAa,CAEnF;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,uBAAuB,CAEvG;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,aAAa,CAEnF;AAGD,MAAM,WAAW,wBAAyB,SAAQ,QAAQ,CAAC,eAAe;IACxE,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC;CACzB;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,wBAAwB,CAE/F;AACD,MAAM,WAAW,2BAA4B,SAAQ,QAAQ,CAAC,kBAAkB;IAC9E,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC;CACzB;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,2BAA2B,CAErG;AAED,MAAM,MAAM,yBAAyB,GACjC,QAAQ,CAAC,uBAAuB,GAChC,QAAQ,CAAC,eAAe,GACxB,QAAQ,CAAC,kBAAkB,GAC3B,QAAQ,CAAC,gBAAgB,CAAC;AAE9B,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,yBAAyB,CAQlG;AAED,MAAM,WAAW,wBAAyB,SAAQ,QAAQ,CAAC,iBAAiB;IAC1E,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC;CAC3B;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,wBAAwB,CAE/F;AAED,MAAM,WAAW,8BAA+B,SAAQ,QAAQ,CAAC,iCAAiC;IAChG,GAAG,EAAE,QAAQ,CAAC,iBAAiB,GAAG,QAAQ,CAAC,UAAU,CAAC;IACtD,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC;CAC5B;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,8BAA8B,CAM3G;AAED,MAAM,WAAW,uBAAwB,SAAQ,QAAQ,CAAC,+BAA+B;IACvF,GAAG,EAAE,QAAQ,CAAC,iBAAiB,GAAG,QAAQ,CAAC,UAAU,CAAC;CACvD;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,uBAAuB,CAE7F;AAED,MAAM,WAAW,qBAAsB,SAAQ,QAAQ,CAAC,uBAAuB;IAC7E,GAAG,EAAE,QAAQ,CAAC,UAAU,CAAC;CAC1B;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,qBAAqB,CAEzF;AAED,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC,0BAA0B,GAAG;IAC5E,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC;IACxB,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC;CAC3B,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,yBAAyB,CAEjG;AAED,MAAM,WAAW,uDAAwD,SAAQ,wBAAwB;IACvG,KAAK,EAAE,yBAAyB,CAAC;CAClC;AAED,wBAAgB,wDAAwD,CACtE,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,IAAI,IAAI,uDAAuD,CAEjE;AAED,MAAM,MAAM,wDAAwD,GAAG,yBAAyB,GAAG;IACjG,IAAI,EAAE,yBAAyB,CAAC;CACjC,CAAC;AAEF,wBAAgB,yDAAyD,CACvE,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,IAAI,IAAI,wDAAwD,CAElE;AAED,MAAM,WAAW,oDAAqD,SAAQ,qBAAqB;IACjG,KAAK,EAAE,yBAAyB,CAAC;CAClC;AAED,wBAAgB,qDAAqD,CACnE,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,IAAI,IAAI,oDAAoD,CAE9D;AAED,MAAM,WAAW,6DACf,SAAQ,8BAA8B;IACtC,KAAK,EAAE,yBAAyB,CAAC;CAClC;AAED,wBAAgB,8DAA8D,CAC5E,IAAI,EAAE,QAAQ,CAAC,IAAI,GAClB,IAAI,IAAI,6DAA6D,CAEvE;AAED,MAAM,MAAM,YAAY,GACpB,QAAQ,CAAC,wBAAwB,GACjC,QAAQ,CAAC,2BAA2B,GACpC,wBAAwB,GACxB,2BAA2B,GAC3B,wDAAwD,GACxD,oDAAoD,GACpD,6DAA6D,GAC7D,uDAAuD,GACvD,uBAAuB,GACvB,QAAQ,CAAC,iBAAiB,GAC1B,QAAQ,CAAC,sBAAsB,GAC/B,QAAQ,CAAC,sBAAsB,CAAC;AAEpC,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,YAAY,CAexE"}
|
||||
190
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/ast-guards.js
generated
vendored
Normal file
190
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/ast-guards.js
generated
vendored
Normal file
@ -0,0 +1,190 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isArrayExpression = isArrayExpression;
|
||||
exports.isArrowFunctionExpression = isArrowFunctionExpression;
|
||||
exports.isAssignmentPattern = isAssignmentPattern;
|
||||
exports.isClassDeclaration = isClassDeclaration;
|
||||
exports.isClassExpression = isClassExpression;
|
||||
exports.isExportDefaultDeclaration = isExportDefaultDeclaration;
|
||||
exports.isExpression = isExpression;
|
||||
exports.isFunctionDeclaration = isFunctionDeclaration;
|
||||
exports.isFunctionExpression = isFunctionExpression;
|
||||
exports.isIdentifier = isIdentifier;
|
||||
exports.isLiteral = isLiteral;
|
||||
exports.isMethodDefinition = isMethodDefinition;
|
||||
exports.isObjectExpression = isObjectExpression;
|
||||
exports.isPrivateIdentifier = isPrivateIdentifier;
|
||||
exports.isProperty = isProperty;
|
||||
exports.isPropertyDefinition = isPropertyDefinition;
|
||||
exports.isTSEnumDeclaration = isTSEnumDeclaration;
|
||||
exports.isTSInterfaceDeclaration = isTSInterfaceDeclaration;
|
||||
exports.isTSModuleDeclaration = isTSModuleDeclaration;
|
||||
exports.isTSQualifiedName = isTSQualifiedName;
|
||||
exports.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration;
|
||||
exports.isVariableDeclarator = isVariableDeclarator;
|
||||
exports.isClassDeclarationWithName = isClassDeclarationWithName;
|
||||
exports.isClassPropertyNameNonComputed = isClassPropertyNameNonComputed;
|
||||
exports.isFunctionDeclarationWithName = isFunctionDeclarationWithName;
|
||||
exports.isNumberLiteral = isNumberLiteral;
|
||||
exports.isPropertyNameNonComputed = isPropertyNameNonComputed;
|
||||
exports.isStringLiteral = isStringLiteral;
|
||||
exports.isClassExpressionWithName = isClassExpressionWithName;
|
||||
exports.isFunctionExpressionWithName = isFunctionExpressionWithName;
|
||||
exports.isNormalAnonymousExpression = isNormalAnonymousExpression;
|
||||
exports.isNormalAssignmentPattern = isNormalAssignmentPattern;
|
||||
exports.isNormalClassPropertyDefinition = isNormalClassPropertyDefinition;
|
||||
exports.isNormalMethodDefinition = isNormalMethodDefinition;
|
||||
exports.isNormalObjectProperty = isNormalObjectProperty;
|
||||
exports.isNormalVariableDeclarator = isNormalVariableDeclarator;
|
||||
exports.isNormalAssignmentPatternWithAnonymousExpressionAssigned = isNormalAssignmentPatternWithAnonymousExpressionAssigned;
|
||||
exports.isNormalVariableDeclaratorWithAnonymousExpressionAssigned = isNormalVariableDeclaratorWithAnonymousExpressionAssigned;
|
||||
exports.isNormalObjectPropertyWithAnonymousExpressionAssigned = isNormalObjectPropertyWithAnonymousExpressionAssigned;
|
||||
exports.isNormalClassPropertyDefinitionWithAnonymousExpressionAssigned = isNormalClassPropertyDefinitionWithAnonymousExpressionAssigned;
|
||||
exports.isNodeWithName = isNodeWithName;
|
||||
function isArrayExpression(node) {
|
||||
return node.type === 'ArrayExpression';
|
||||
}
|
||||
function isArrowFunctionExpression(node) {
|
||||
return node.type === 'ArrowFunctionExpression';
|
||||
}
|
||||
/** default parameters */
|
||||
function isAssignmentPattern(node) {
|
||||
return node.type === 'AssignmentPattern';
|
||||
}
|
||||
function isClassDeclaration(node) {
|
||||
return node.type === 'ClassDeclaration';
|
||||
}
|
||||
function isClassExpression(node) {
|
||||
return node.type === 'ClassExpression';
|
||||
}
|
||||
function isExportDefaultDeclaration(node) {
|
||||
return node.type === 'ExportDefaultDeclaration';
|
||||
}
|
||||
function isExpression(node) {
|
||||
return node.type.includes('Expression');
|
||||
}
|
||||
function isFunctionDeclaration(node) {
|
||||
return node.type === 'FunctionDeclaration';
|
||||
}
|
||||
function isFunctionExpression(node) {
|
||||
return node.type === 'FunctionExpression';
|
||||
}
|
||||
function isIdentifier(node) {
|
||||
return node.type === 'Identifier';
|
||||
}
|
||||
function isLiteral(node) {
|
||||
return node.type === 'Literal';
|
||||
}
|
||||
function isMethodDefinition(node) {
|
||||
return node.type === 'MethodDefinition';
|
||||
}
|
||||
function isObjectExpression(node) {
|
||||
return node.type === 'ObjectExpression';
|
||||
}
|
||||
function isPrivateIdentifier(node) {
|
||||
return node.type === 'PrivateIdentifier';
|
||||
}
|
||||
function isProperty(node) {
|
||||
return node.type === 'Property';
|
||||
}
|
||||
function isPropertyDefinition(node) {
|
||||
return node.type === 'PropertyDefinition';
|
||||
}
|
||||
function isTSEnumDeclaration(node) {
|
||||
return node.type === 'TSEnumDeclaration';
|
||||
}
|
||||
function isTSInterfaceDeclaration(node) {
|
||||
return node.type === 'TSInterfaceDeclaration';
|
||||
}
|
||||
function isTSModuleDeclaration(node) {
|
||||
return node.type === 'TSModuleDeclaration';
|
||||
}
|
||||
function isTSQualifiedName(node) {
|
||||
return node.type === 'TSQualifiedName';
|
||||
}
|
||||
function isTSTypeAliasDeclaration(node) {
|
||||
return node.type === 'TSTypeAliasDeclaration';
|
||||
}
|
||||
function isVariableDeclarator(node) {
|
||||
return node.type === 'VariableDeclarator';
|
||||
}
|
||||
// Compound Type Guards for @typescript-eslint/types ast-spec compound types
|
||||
function isClassDeclarationWithName(node) {
|
||||
return isClassDeclaration(node) && node.id !== null;
|
||||
}
|
||||
function isClassPropertyNameNonComputed(node) {
|
||||
return isPrivateIdentifier(node) || isPropertyNameNonComputed(node);
|
||||
}
|
||||
function isFunctionDeclarationWithName(node) {
|
||||
return isFunctionDeclaration(node) && node.id !== null;
|
||||
}
|
||||
function isNumberLiteral(node) {
|
||||
return isLiteral(node) && typeof node.value === 'number';
|
||||
}
|
||||
function isPropertyNameNonComputed(node) {
|
||||
return isIdentifier(node) || isNumberLiteral(node) || isStringLiteral(node);
|
||||
}
|
||||
function isStringLiteral(node) {
|
||||
return isLiteral(node) && typeof node.value === 'string';
|
||||
}
|
||||
function isClassExpressionWithName(node) {
|
||||
return isClassExpression(node) && node.id !== null;
|
||||
}
|
||||
function isFunctionExpressionWithName(node) {
|
||||
return isFunctionExpression(node) && node.id !== null;
|
||||
}
|
||||
function isNormalAnonymousExpression(node) {
|
||||
const ANONYMOUS_EXPRESSION_GUARDS = [
|
||||
isArrowFunctionExpression,
|
||||
isClassExpression,
|
||||
isFunctionExpression,
|
||||
isObjectExpression
|
||||
];
|
||||
return ANONYMOUS_EXPRESSION_GUARDS.some((guard) => guard(node));
|
||||
}
|
||||
function isNormalAssignmentPattern(node) {
|
||||
return isAssignmentPattern(node) && isIdentifier(node.left);
|
||||
}
|
||||
function isNormalClassPropertyDefinition(node) {
|
||||
return (isPropertyDefinition(node) &&
|
||||
(isIdentifier(node.key) || isPrivateIdentifier(node.key)) &&
|
||||
node.value !== null);
|
||||
}
|
||||
function isNormalMethodDefinition(node) {
|
||||
return isMethodDefinition(node) && (isIdentifier(node.key) || isPrivateIdentifier(node.key));
|
||||
}
|
||||
function isNormalObjectProperty(node) {
|
||||
return isProperty(node) && (isIdentifier(node.key) || isPrivateIdentifier(node.key));
|
||||
}
|
||||
function isNormalVariableDeclarator(node) {
|
||||
return isVariableDeclarator(node) && isIdentifier(node.id) && node.init !== null;
|
||||
}
|
||||
function isNormalAssignmentPatternWithAnonymousExpressionAssigned(node) {
|
||||
return isNormalAssignmentPattern(node) && isNormalAnonymousExpression(node.right);
|
||||
}
|
||||
function isNormalVariableDeclaratorWithAnonymousExpressionAssigned(node) {
|
||||
return isNormalVariableDeclarator(node) && isNormalAnonymousExpression(node.init);
|
||||
}
|
||||
function isNormalObjectPropertyWithAnonymousExpressionAssigned(node) {
|
||||
return isNormalObjectProperty(node) && isNormalAnonymousExpression(node.value);
|
||||
}
|
||||
function isNormalClassPropertyDefinitionWithAnonymousExpressionAssigned(node) {
|
||||
return isNormalClassPropertyDefinition(node) && isNormalAnonymousExpression(node.value);
|
||||
}
|
||||
function isNodeWithName(node) {
|
||||
return (isClassDeclarationWithName(node) ||
|
||||
isFunctionDeclarationWithName(node) ||
|
||||
isClassExpressionWithName(node) ||
|
||||
isFunctionExpressionWithName(node) ||
|
||||
isNormalVariableDeclaratorWithAnonymousExpressionAssigned(node) ||
|
||||
isNormalObjectPropertyWithAnonymousExpressionAssigned(node) ||
|
||||
isNormalClassPropertyDefinitionWithAnonymousExpressionAssigned(node) ||
|
||||
isNormalAssignmentPatternWithAnonymousExpressionAssigned(node) ||
|
||||
isNormalMethodDefinition(node) ||
|
||||
isTSEnumDeclaration(node) ||
|
||||
isTSInterfaceDeclaration(node) ||
|
||||
isTSTypeAliasDeclaration(node));
|
||||
}
|
||||
//# sourceMappingURL=ast-guards.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/ast-guards.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/ast-guards.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
20
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-file.d.ts
generated
vendored
Normal file
20
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-file.d.ts
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
export interface ISuppression {
|
||||
file: string;
|
||||
scopeId: string;
|
||||
rule: string;
|
||||
}
|
||||
export interface IBulkSuppressionsConfig {
|
||||
serializedSuppressions: Set<string>;
|
||||
jsonObject: IBulkSuppressionsJson;
|
||||
newSerializedSuppressions: Set<string>;
|
||||
newJsonObject: IBulkSuppressionsJson;
|
||||
}
|
||||
export interface IBulkSuppressionsJson {
|
||||
suppressions: ISuppression[];
|
||||
}
|
||||
export declare function getSuppressionsConfigForEslintrcFolderPath(eslintrcFolderPath: string): IBulkSuppressionsConfig;
|
||||
export declare function getAllBulkSuppressionsConfigsByEslintrcFolderPath(): [string, IBulkSuppressionsConfig][];
|
||||
export declare function writeSuppressionsJsonToFile(eslintrcFolderPath: string, suppressionsConfig: IBulkSuppressionsConfig): void;
|
||||
export declare function deleteBulkSuppressionsFileInEslintrcFolder(eslintrcFolderPath: string): void;
|
||||
export declare function serializeSuppression({ file, scopeId, rule }: ISuppression): string;
|
||||
//# sourceMappingURL=bulk-suppressions-file.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-file.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-file.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"bulk-suppressions-file.d.ts","sourceRoot":"","sources":["../../src/eslint-bulk-suppressions/bulk-suppressions-file.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,uBAAuB;IACtC,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,UAAU,EAAE,qBAAqB,CAAC;IAClC,yBAAyB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvC,aAAa,EAAE,qBAAqB,CAAC;CACtC;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,YAAY,EAAE,CAAC;CAC9B;AAkBD,wBAAgB,0CAA0C,CACxD,kBAAkB,EAAE,MAAM,GACzB,uBAAuB,CAkDzB;AAED,wBAAgB,iDAAiD,IAAI,CAAC,MAAM,EAAE,uBAAuB,CAAC,EAAE,CAOvG;AAED,wBAAgB,2BAA2B,CACzC,kBAAkB,EAAE,MAAM,EAC1B,kBAAkB,EAAE,uBAAuB,GAC1C,IAAI,CASN;AAED,wBAAgB,0CAA0C,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAG3F;AAUD,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,YAAY,GAAG,MAAM,CAElF"}
|
||||
171
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-file.js
generated
vendored
Normal file
171
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-file.js
generated
vendored
Normal file
@ -0,0 +1,171 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSuppressionsConfigForEslintrcFolderPath = getSuppressionsConfigForEslintrcFolderPath;
|
||||
exports.getAllBulkSuppressionsConfigsByEslintrcFolderPath = getAllBulkSuppressionsConfigsByEslintrcFolderPath;
|
||||
exports.writeSuppressionsJsonToFile = writeSuppressionsJsonToFile;
|
||||
exports.deleteBulkSuppressionsFileInEslintrcFolder = deleteBulkSuppressionsFileInEslintrcFolder;
|
||||
exports.serializeSuppression = serializeSuppression;
|
||||
const fs_1 = __importDefault(require("fs"));
|
||||
const constants_1 = require("./constants");
|
||||
const IS_RUNNING_IN_VSCODE = process.env[constants_1.VSCODE_PID_ENV_VAR_NAME] !== undefined;
|
||||
const TEN_SECONDS_MS = 10 * 1000;
|
||||
const SUPPRESSIONS_JSON_FILENAME = '.eslint-bulk-suppressions.json';
|
||||
function throwIfAnythingOtherThanNotExistError(e) {
|
||||
if ((e === null || e === void 0 ? void 0 : e.code) !== 'ENOENT') {
|
||||
// Throw an error if any other error than file not found
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
const suppressionsJsonByFolderPath = new Map();
|
||||
function getSuppressionsConfigForEslintrcFolderPath(eslintrcFolderPath) {
|
||||
const cachedSuppressionsConfig = suppressionsJsonByFolderPath.get(eslintrcFolderPath);
|
||||
let shouldLoad;
|
||||
let suppressionsConfig;
|
||||
if (cachedSuppressionsConfig) {
|
||||
shouldLoad = IS_RUNNING_IN_VSCODE && cachedSuppressionsConfig.readTime < Date.now() - TEN_SECONDS_MS;
|
||||
suppressionsConfig = cachedSuppressionsConfig.suppressionsConfig;
|
||||
}
|
||||
else {
|
||||
shouldLoad = true;
|
||||
}
|
||||
if (shouldLoad) {
|
||||
const suppressionsPath = `${eslintrcFolderPath}/${SUPPRESSIONS_JSON_FILENAME}`;
|
||||
let rawJsonFile;
|
||||
try {
|
||||
rawJsonFile = fs_1.default.readFileSync(suppressionsPath).toString();
|
||||
}
|
||||
catch (e) {
|
||||
throwIfAnythingOtherThanNotExistError(e);
|
||||
}
|
||||
if (!rawJsonFile) {
|
||||
suppressionsConfig = {
|
||||
serializedSuppressions: new Set(),
|
||||
jsonObject: { suppressions: [] },
|
||||
newSerializedSuppressions: new Set(),
|
||||
newJsonObject: { suppressions: [] }
|
||||
};
|
||||
}
|
||||
else {
|
||||
const jsonObject = JSON.parse(rawJsonFile);
|
||||
validateSuppressionsJson(jsonObject);
|
||||
const serializedSuppressions = new Set();
|
||||
for (const suppression of jsonObject.suppressions) {
|
||||
serializedSuppressions.add(serializeSuppression(suppression));
|
||||
}
|
||||
suppressionsConfig = {
|
||||
serializedSuppressions,
|
||||
jsonObject,
|
||||
newSerializedSuppressions: new Set(),
|
||||
newJsonObject: { suppressions: [] }
|
||||
};
|
||||
}
|
||||
suppressionsJsonByFolderPath.set(eslintrcFolderPath, { readTime: Date.now(), suppressionsConfig });
|
||||
}
|
||||
return suppressionsConfig;
|
||||
}
|
||||
function getAllBulkSuppressionsConfigsByEslintrcFolderPath() {
|
||||
const result = [];
|
||||
for (const [eslintrcFolderPath, { suppressionsConfig }] of suppressionsJsonByFolderPath) {
|
||||
result.push([eslintrcFolderPath, suppressionsConfig]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function writeSuppressionsJsonToFile(eslintrcFolderPath, suppressionsConfig) {
|
||||
suppressionsJsonByFolderPath.set(eslintrcFolderPath, { readTime: Date.now(), suppressionsConfig });
|
||||
const suppressionsPath = `${eslintrcFolderPath}/${SUPPRESSIONS_JSON_FILENAME}`;
|
||||
if (suppressionsConfig.jsonObject.suppressions.length === 0) {
|
||||
deleteFile(suppressionsPath);
|
||||
}
|
||||
else {
|
||||
suppressionsConfig.jsonObject.suppressions.sort(compareSuppressions);
|
||||
fs_1.default.writeFileSync(suppressionsPath, JSON.stringify(suppressionsConfig.jsonObject, undefined, 2));
|
||||
}
|
||||
}
|
||||
function deleteBulkSuppressionsFileInEslintrcFolder(eslintrcFolderPath) {
|
||||
const suppressionsPath = `${eslintrcFolderPath}/${SUPPRESSIONS_JSON_FILENAME}`;
|
||||
deleteFile(suppressionsPath);
|
||||
}
|
||||
function deleteFile(filePath) {
|
||||
try {
|
||||
fs_1.default.unlinkSync(filePath);
|
||||
}
|
||||
catch (e) {
|
||||
throwIfAnythingOtherThanNotExistError(e);
|
||||
}
|
||||
}
|
||||
function serializeSuppression({ file, scopeId, rule }) {
|
||||
return `${file}|${scopeId}|${rule}`;
|
||||
}
|
||||
function compareSuppressions(a, b) {
|
||||
if (a.file < b.file) {
|
||||
return -1;
|
||||
}
|
||||
else if (a.file > b.file) {
|
||||
return 1;
|
||||
}
|
||||
else if (a.scopeId < b.scopeId) {
|
||||
return -1;
|
||||
}
|
||||
else if (a.scopeId > b.scopeId) {
|
||||
return 1;
|
||||
}
|
||||
else if (a.rule < b.rule) {
|
||||
return -1;
|
||||
}
|
||||
else if (a.rule > b.rule) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
function validateSuppressionsJson(json) {
|
||||
if (typeof json !== 'object') {
|
||||
throw new Error(`Invalid JSON object: ${JSON.stringify(json, null, 2)}`);
|
||||
}
|
||||
if (!json) {
|
||||
throw new Error('JSON object is null.');
|
||||
}
|
||||
const EXPECTED_ROOT_PROPERTY_NAMES = new Set(['suppressions']);
|
||||
for (const propertyName of Object.getOwnPropertyNames(json)) {
|
||||
if (!EXPECTED_ROOT_PROPERTY_NAMES.has(propertyName)) {
|
||||
throw new Error(`Unexpected property name: ${propertyName}`);
|
||||
}
|
||||
}
|
||||
const { suppressions } = json;
|
||||
if (!suppressions) {
|
||||
throw new Error('Missing "suppressions" property.');
|
||||
}
|
||||
if (!Array.isArray(suppressions)) {
|
||||
throw new Error('"suppressions" property is not an array.');
|
||||
}
|
||||
const EXPECTED_SUPPRESSION_PROPERTY_NAMES = new Set(['file', 'scopeId', 'rule']);
|
||||
for (const suppression of suppressions) {
|
||||
if (typeof suppression !== 'object') {
|
||||
throw new Error(`Invalid suppression: ${JSON.stringify(suppression, null, 2)}`);
|
||||
}
|
||||
if (!suppression) {
|
||||
throw new Error(`Suppression is null: ${JSON.stringify(suppression, null, 2)}`);
|
||||
}
|
||||
for (const propertyName of Object.getOwnPropertyNames(suppression)) {
|
||||
if (!EXPECTED_SUPPRESSION_PROPERTY_NAMES.has(propertyName)) {
|
||||
throw new Error(`Unexpected property name: ${propertyName}`);
|
||||
}
|
||||
}
|
||||
for (const propertyName of EXPECTED_SUPPRESSION_PROPERTY_NAMES) {
|
||||
if (!suppression.hasOwnProperty(propertyName)) {
|
||||
throw new Error(`Missing "${propertyName}" property in suppression: ${JSON.stringify(suppression, null, 2)}`);
|
||||
}
|
||||
else if (typeof suppression[propertyName] !== 'string') {
|
||||
throw new Error(`"${propertyName}" property in suppression is not a string: ${JSON.stringify(suppression, null, 2)}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//# sourceMappingURL=bulk-suppressions-file.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-file.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-file.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
29
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-patch.d.ts
generated
vendored
Normal file
29
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-patch.d.ts
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
import type { TSESTree } from '@typescript-eslint/types';
|
||||
import { type IBulkSuppressionsConfig, type ISuppression } from './bulk-suppressions-file';
|
||||
declare const SUPPRESSION_SYMBOL: unique symbol;
|
||||
interface IProblem {
|
||||
[SUPPRESSION_SYMBOL]?: {
|
||||
config: IBulkSuppressionsConfig;
|
||||
suppression: ISuppression;
|
||||
serializedSuppression: string;
|
||||
};
|
||||
}
|
||||
export declare function shouldBulkSuppress(params: {
|
||||
filename: string;
|
||||
currentNode: TSESTree.Node;
|
||||
ruleId: string;
|
||||
problem: IProblem;
|
||||
}): boolean;
|
||||
export declare function prune(): void;
|
||||
export declare function write(): void;
|
||||
export declare function requireFromPathToLinterJS(importPath: string): import('eslint').Linter;
|
||||
export declare function patchClass<T, U extends T>(originalClass: new () => T, patchedClass: new () => U): void;
|
||||
/**
|
||||
* This returns a wrapped version of the "verify" function from ESLint's Linter class
|
||||
* that postprocesses rule violations that weren't suppressed by comments. This postprocessing
|
||||
* records suppressions that weren't otherwise suppressed by comments to be used
|
||||
* by the "suppress" and "prune" commands.
|
||||
*/
|
||||
export declare function extendVerifyFunction(originalFn: (this: unknown, ...args: unknown[]) => IProblem[] | undefined): (this: unknown, ...args: unknown[]) => IProblem[] | undefined;
|
||||
export {};
|
||||
//# sourceMappingURL=bulk-suppressions-patch.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-patch.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-patch.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"bulk-suppressions-patch.d.ts","sourceRoot":"","sources":["../../src/eslint-bulk-suppressions/bulk-suppressions-patch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAWzD,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EAGlB,MAAM,0BAA0B,CAAC;AAQlC,QAAA,MAAM,kBAAkB,EAAE,OAAO,MAA8B,CAAC;AAOhE,UAAU,QAAQ;IAChB,CAAC,kBAAkB,CAAC,CAAC,EAAE;QACrB,MAAM,EAAE,uBAAuB,CAAC;QAChC,WAAW,EAAE,YAAY,CAAC;QAC1B,qBAAqB,EAAE,MAAM,CAAC;KAC/B,CAAC;CACH;AAgGD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,QAAQ,CAAC;CACnB,GAAG,OAAO,CA2BV;AAED,wBAAgB,KAAK,IAAI,IAAI,CAiB5B;AAED,wBAAgB,KAAK,IAAI,IAAI,CAS5B;AAGD,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,QAAQ,EAAE,MAAM,CAQrF;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,UAAU,CAAC,EAAE,YAAY,EAAE,UAAU,CAAC,GAAG,IAAI,CAgBtG;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,QAAQ,EAAE,GAAG,SAAS,GACxE,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,QAAQ,EAAE,GAAG,SAAS,CA0B/D"}
|
||||
245
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-patch.js
generated
vendored
Normal file
245
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-patch.js
generated
vendored
Normal file
@ -0,0 +1,245 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || (function () {
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
return function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
})();
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.shouldBulkSuppress = shouldBulkSuppress;
|
||||
exports.prune = prune;
|
||||
exports.write = write;
|
||||
exports.requireFromPathToLinterJS = requireFromPathToLinterJS;
|
||||
exports.patchClass = patchClass;
|
||||
exports.extendVerifyFunction = extendVerifyFunction;
|
||||
const fs_1 = __importDefault(require("fs"));
|
||||
const Guards = __importStar(require("./ast-guards"));
|
||||
const _patch_base_1 = require("../_patch-base");
|
||||
const constants_1 = require("./constants");
|
||||
const bulk_suppressions_file_1 = require("./bulk-suppressions-file");
|
||||
const ESLINTRC_FILENAMES = [
|
||||
'.eslintrc.js',
|
||||
'.eslintrc.cjs'
|
||||
// Several other filenames are allowed, but this patch requires that it be loaded via a JS config file,
|
||||
// so we only need to check for the JS-based filenames
|
||||
];
|
||||
const SUPPRESSION_SYMBOL = Symbol('suppression');
|
||||
const ESLINT_BULK_SUPPRESS_ENV_VAR_VALUE = process.env[constants_1.ESLINT_BULK_SUPPRESS_ENV_VAR_NAME];
|
||||
const SUPPRESS_ALL_RULES = ESLINT_BULK_SUPPRESS_ENV_VAR_VALUE === '*';
|
||||
const RULES_TO_SUPPRESS = ESLINT_BULK_SUPPRESS_ENV_VAR_VALUE
|
||||
? new Set(ESLINT_BULK_SUPPRESS_ENV_VAR_VALUE.split(','))
|
||||
: undefined;
|
||||
function getNodeName(node) {
|
||||
if (Guards.isClassDeclarationWithName(node)) {
|
||||
return node.id.name;
|
||||
}
|
||||
else if (Guards.isFunctionDeclarationWithName(node)) {
|
||||
return node.id.name;
|
||||
}
|
||||
else if (Guards.isClassExpressionWithName(node)) {
|
||||
return node.id.name;
|
||||
}
|
||||
else if (Guards.isFunctionExpressionWithName(node)) {
|
||||
return node.id.name;
|
||||
}
|
||||
else if (Guards.isNormalVariableDeclaratorWithAnonymousExpressionAssigned(node)) {
|
||||
return node.id.name;
|
||||
}
|
||||
else if (Guards.isNormalObjectPropertyWithAnonymousExpressionAssigned(node)) {
|
||||
return node.key.name;
|
||||
}
|
||||
else if (Guards.isNormalClassPropertyDefinitionWithAnonymousExpressionAssigned(node)) {
|
||||
return node.key.name;
|
||||
}
|
||||
else if (Guards.isNormalAssignmentPatternWithAnonymousExpressionAssigned(node)) {
|
||||
return node.left.name;
|
||||
}
|
||||
else if (Guards.isNormalMethodDefinition(node)) {
|
||||
return node.key.name;
|
||||
}
|
||||
else if (Guards.isTSEnumDeclaration(node)) {
|
||||
return node.id.name;
|
||||
}
|
||||
else if (Guards.isTSInterfaceDeclaration(node)) {
|
||||
return node.id.name;
|
||||
}
|
||||
else if (Guards.isTSTypeAliasDeclaration(node)) {
|
||||
return node.id.name;
|
||||
}
|
||||
}
|
||||
function calculateScopeId(node) {
|
||||
const scopeIds = [];
|
||||
for (let current = node; current; current = current.parent) {
|
||||
const scopeIdForASTNode = getNodeName(current);
|
||||
if (scopeIdForASTNode !== undefined) {
|
||||
scopeIds.unshift(scopeIdForASTNode);
|
||||
}
|
||||
}
|
||||
if (scopeIds.length === 0) {
|
||||
return '.';
|
||||
}
|
||||
else {
|
||||
return '.' + scopeIds.join('.');
|
||||
}
|
||||
}
|
||||
const eslintrcPathByFileOrFolderPath = new Map();
|
||||
function findEslintrcFolderPathForNormalizedFileAbsolutePath(normalizedFilePath) {
|
||||
const cachedFolderPathForFilePath = eslintrcPathByFileOrFolderPath.get(normalizedFilePath);
|
||||
if (cachedFolderPathForFilePath) {
|
||||
return cachedFolderPathForFilePath;
|
||||
}
|
||||
const normalizedFileFolderPath = normalizedFilePath.substring(0, normalizedFilePath.lastIndexOf('/'));
|
||||
const pathsToCache = [normalizedFilePath];
|
||||
let eslintrcFolderPath;
|
||||
findEslintrcFileLoop: for (let currentFolder = normalizedFileFolderPath; currentFolder; // 'something'.substring(0, -1) is ''
|
||||
currentFolder = currentFolder.substring(0, currentFolder.lastIndexOf('/'))) {
|
||||
const cachedEslintrcFolderPath = eslintrcPathByFileOrFolderPath.get(currentFolder);
|
||||
if (cachedEslintrcFolderPath) {
|
||||
// Need to cache this result into the intermediate paths
|
||||
eslintrcFolderPath = cachedEslintrcFolderPath;
|
||||
break;
|
||||
}
|
||||
pathsToCache.push(currentFolder);
|
||||
for (const eslintrcFilename of ESLINTRC_FILENAMES) {
|
||||
if (fs_1.default.existsSync(`${currentFolder}/${eslintrcFilename}`)) {
|
||||
eslintrcFolderPath = currentFolder;
|
||||
break findEslintrcFileLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (eslintrcFolderPath) {
|
||||
for (const checkedFolder of pathsToCache) {
|
||||
eslintrcPathByFileOrFolderPath.set(checkedFolder, eslintrcFolderPath);
|
||||
}
|
||||
return eslintrcFolderPath;
|
||||
}
|
||||
else {
|
||||
throw new Error(`Cannot locate an ESLint configuration file for ${normalizedFilePath}`);
|
||||
}
|
||||
}
|
||||
// One-line insert into the ruleContext report method to prematurely exit if the ESLint problem has been suppressed
|
||||
function shouldBulkSuppress(params) {
|
||||
// Use this ENV variable to turn off eslint-bulk-suppressions functionality, default behavior is on
|
||||
if (process.env[constants_1.ESLINT_BULK_ENABLE_ENV_VAR_NAME] === 'false') {
|
||||
return false;
|
||||
}
|
||||
const { filename: fileAbsolutePath, currentNode, ruleId: rule, problem } = params;
|
||||
const normalizedFileAbsolutePath = fileAbsolutePath.replace(/\\/g, '/');
|
||||
const eslintrcDirectory = findEslintrcFolderPathForNormalizedFileAbsolutePath(normalizedFileAbsolutePath);
|
||||
const fileRelativePath = normalizedFileAbsolutePath.substring(eslintrcDirectory.length + 1);
|
||||
const scopeId = calculateScopeId(currentNode);
|
||||
const suppression = { file: fileRelativePath, scopeId, rule };
|
||||
const config = (0, bulk_suppressions_file_1.getSuppressionsConfigForEslintrcFolderPath)(eslintrcDirectory);
|
||||
const serializedSuppression = (0, bulk_suppressions_file_1.serializeSuppression)(suppression);
|
||||
const currentNodeIsSuppressed = config.serializedSuppressions.has(serializedSuppression);
|
||||
if (currentNodeIsSuppressed || SUPPRESS_ALL_RULES || (RULES_TO_SUPPRESS === null || RULES_TO_SUPPRESS === void 0 ? void 0 : RULES_TO_SUPPRESS.has(suppression.rule))) {
|
||||
problem[SUPPRESSION_SYMBOL] = {
|
||||
suppression,
|
||||
serializedSuppression,
|
||||
config
|
||||
};
|
||||
}
|
||||
return process.env[constants_1.ESLINT_BULK_PRUNE_ENV_VAR_NAME] !== '1' && currentNodeIsSuppressed;
|
||||
}
|
||||
function prune() {
|
||||
for (const [eslintrcFolderPath, suppressionsConfig] of (0, bulk_suppressions_file_1.getAllBulkSuppressionsConfigsByEslintrcFolderPath)()) {
|
||||
if (suppressionsConfig) {
|
||||
const { newSerializedSuppressions, newJsonObject } = suppressionsConfig;
|
||||
const newSuppressionsConfig = {
|
||||
serializedSuppressions: newSerializedSuppressions,
|
||||
jsonObject: newJsonObject,
|
||||
newSerializedSuppressions: new Set(),
|
||||
newJsonObject: { suppressions: [] }
|
||||
};
|
||||
(0, bulk_suppressions_file_1.writeSuppressionsJsonToFile)(eslintrcFolderPath, newSuppressionsConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
function write() {
|
||||
for (const [eslintrcFolderPath, suppressionsConfig] of (0, bulk_suppressions_file_1.getAllBulkSuppressionsConfigsByEslintrcFolderPath)()) {
|
||||
if (suppressionsConfig) {
|
||||
(0, bulk_suppressions_file_1.writeSuppressionsJsonToFile)(eslintrcFolderPath, suppressionsConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
// utility function for linter-patch.js to make require statements that use relative paths in linter.js work in linter-patch.js
|
||||
function requireFromPathToLinterJS(importPath) {
|
||||
if (!_patch_base_1.eslintFolder) {
|
||||
return require(importPath);
|
||||
}
|
||||
const pathToLinterFolder = `${_patch_base_1.eslintFolder}/lib/linter`;
|
||||
const moduleAbsolutePath = require.resolve(importPath, { paths: [pathToLinterFolder] });
|
||||
return require(moduleAbsolutePath);
|
||||
}
|
||||
function patchClass(originalClass, patchedClass) {
|
||||
// Get all the property names of the patched class prototype
|
||||
const patchedProperties = Object.getOwnPropertyNames(patchedClass.prototype);
|
||||
// Loop through all the properties
|
||||
for (const prop of patchedProperties) {
|
||||
// Override the property in the original class
|
||||
originalClass.prototype[prop] = patchedClass.prototype[prop];
|
||||
}
|
||||
// Handle getters and setters
|
||||
for (const [prop, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(patchedClass.prototype))) {
|
||||
if (descriptor.get || descriptor.set) {
|
||||
Object.defineProperty(originalClass.prototype, prop, descriptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This returns a wrapped version of the "verify" function from ESLint's Linter class
|
||||
* that postprocesses rule violations that weren't suppressed by comments. This postprocessing
|
||||
* records suppressions that weren't otherwise suppressed by comments to be used
|
||||
* by the "suppress" and "prune" commands.
|
||||
*/
|
||||
function extendVerifyFunction(originalFn) {
|
||||
return function (...args) {
|
||||
const problems = originalFn.apply(this, args);
|
||||
if (problems) {
|
||||
for (const problem of problems) {
|
||||
if (problem[SUPPRESSION_SYMBOL]) {
|
||||
const { serializedSuppression, suppression, config: { newSerializedSuppressions, jsonObject: { suppressions }, newJsonObject: { suppressions: newSuppressions } } } = problem[SUPPRESSION_SYMBOL];
|
||||
if (!newSerializedSuppressions.has(serializedSuppression)) {
|
||||
newSerializedSuppressions.add(serializedSuppression);
|
||||
newSuppressions.push(suppression);
|
||||
suppressions.push(suppression);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return problems;
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=bulk-suppressions-patch.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-patch.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/bulk-suppressions-patch.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/prune.d.ts
generated
vendored
Normal file
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/prune.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export declare function pruneAsync(): Promise<void>;
|
||||
//# sourceMappingURL=prune.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/prune.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/prune.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"prune.d.ts","sourceRoot":"","sources":["../../../src/eslint-bulk-suppressions/cli/prune.ts"],"names":[],"mappings":"AAaA,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAsBhD"}
|
||||
60
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/prune.js
generated
vendored
Normal file
60
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/prune.js
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.pruneAsync = pruneAsync;
|
||||
const fs_1 = __importDefault(require("fs"));
|
||||
const print_help_1 = require("./utils/print-help");
|
||||
const runEslint_1 = require("./runEslint");
|
||||
const constants_1 = require("../constants");
|
||||
const bulk_suppressions_file_1 = require("../bulk-suppressions-file");
|
||||
async function pruneAsync() {
|
||||
const args = process.argv.slice(3);
|
||||
if (args.includes('--help') || args.includes('-h')) {
|
||||
(0, print_help_1.printPruneHelp)();
|
||||
process.exit(0);
|
||||
}
|
||||
if (args.length > 0) {
|
||||
throw new Error(`@rushstack/eslint-bulk: Unknown arguments: ${args.join(' ')}`);
|
||||
}
|
||||
const normalizedCwd = process.cwd().replace(/\\/g, '/');
|
||||
const allFiles = await getAllFilesWithExistingSuppressionsForCwdAsync(normalizedCwd);
|
||||
if (allFiles.length > 0) {
|
||||
process.env[constants_1.ESLINT_BULK_PRUNE_ENV_VAR_NAME] = '1';
|
||||
console.log(`Pruning suppressions for ${allFiles.length} files...`);
|
||||
await (0, runEslint_1.runEslintAsync)(allFiles, 'prune');
|
||||
}
|
||||
else {
|
||||
console.log('No files with existing suppressions found.');
|
||||
(0, bulk_suppressions_file_1.deleteBulkSuppressionsFileInEslintrcFolder)(normalizedCwd);
|
||||
}
|
||||
}
|
||||
async function getAllFilesWithExistingSuppressionsForCwdAsync(normalizedCwd) {
|
||||
const { jsonObject: bulkSuppressionsConfigJson } = (0, bulk_suppressions_file_1.getSuppressionsConfigForEslintrcFolderPath)(normalizedCwd);
|
||||
const allFiles = new Set();
|
||||
for (const { file: filePath } of bulkSuppressionsConfigJson.suppressions) {
|
||||
allFiles.add(filePath);
|
||||
}
|
||||
const allFilesArray = Array.from(allFiles);
|
||||
const allExistingFiles = [];
|
||||
// TODO: limit parallelism here with something similar to `Async.forEachAsync` from `node-core-library`.
|
||||
await Promise.all(allFilesArray.map(async (filePath) => {
|
||||
try {
|
||||
await fs_1.default.promises.access(filePath, fs_1.default.constants.F_OK);
|
||||
allExistingFiles.push(filePath);
|
||||
}
|
||||
catch (_a) {
|
||||
// Doesn't exist - ignore
|
||||
}
|
||||
}));
|
||||
console.log(`Found ${allExistingFiles.length} files with existing suppressions.`);
|
||||
const deletedCount = allFilesArray.length - allExistingFiles.length;
|
||||
if (deletedCount > 0) {
|
||||
console.log(`${deletedCount} files with suppressions were deleted.`);
|
||||
}
|
||||
return allExistingFiles;
|
||||
}
|
||||
//# sourceMappingURL=prune.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/prune.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/prune.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"prune.js","sourceRoot":"","sources":["../../../src/eslint-bulk-suppressions/cli/prune.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;AAY3D,gCAsBC;AAhCD,4CAAoB;AAEpB,mDAAoD;AACpD,2CAA6C;AAC7C,4CAA8D;AAC9D,sEAGmC;AAE5B,KAAK,UAAU,UAAU;IAC9B,MAAM,IAAI,GAAa,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE7C,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACnD,IAAA,2BAAc,GAAE,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,8CAA8C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,MAAM,aAAa,GAAW,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAa,MAAM,8CAA8C,CAAC,aAAa,CAAC,CAAC;IAC/F,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,0CAA8B,CAAC,GAAG,GAAG,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,4BAA4B,QAAQ,CAAC,MAAM,WAAW,CAAC,CAAC;QACpE,MAAM,IAAA,0BAAc,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAC1D,IAAA,mEAA0C,EAAC,aAAa,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,KAAK,UAAU,8CAA8C,CAAC,aAAqB;IACjF,MAAM,EAAE,UAAU,EAAE,0BAA0B,EAAE,GAC9C,IAAA,mEAA0C,EAAC,aAAa,CAAC,CAAC;IAC5D,MAAM,QAAQ,GAAgB,IAAI,GAAG,EAAE,CAAC;IACxC,KAAK,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,0BAA0B,CAAC,YAAY,EAAE,CAAC;QACzE,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IAED,MAAM,aAAa,GAAa,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAErD,MAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,wGAAwG;IACxG,MAAM,OAAO,CAAC,GAAG,CACf,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,QAAgB,EAAE,EAAE;QAC3C,IAAI,CAAC;YACH,MAAM,YAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACtD,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;QAAC,WAAM,CAAC;YACP,yBAAyB;QAC3B,CAAC;IACH,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,SAAS,gBAAgB,CAAC,MAAM,oCAAoC,CAAC,CAAC;IAClF,MAAM,YAAY,GAAW,aAAa,CAAC,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAC5E,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,GAAG,YAAY,wCAAwC,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport fs from 'fs';\n\nimport { printPruneHelp } from './utils/print-help';\nimport { runEslintAsync } from './runEslint';\nimport { ESLINT_BULK_PRUNE_ENV_VAR_NAME } from '../constants';\nimport {\n deleteBulkSuppressionsFileInEslintrcFolder,\n getSuppressionsConfigForEslintrcFolderPath\n} from '../bulk-suppressions-file';\n\nexport async function pruneAsync(): Promise<void> {\n const args: string[] = process.argv.slice(3);\n\n if (args.includes('--help') || args.includes('-h')) {\n printPruneHelp();\n process.exit(0);\n }\n\n if (args.length > 0) {\n throw new Error(`@rushstack/eslint-bulk: Unknown arguments: ${args.join(' ')}`);\n }\n\n const normalizedCwd: string = process.cwd().replace(/\\\\/g, '/');\n const allFiles: string[] = await getAllFilesWithExistingSuppressionsForCwdAsync(normalizedCwd);\n if (allFiles.length > 0) {\n process.env[ESLINT_BULK_PRUNE_ENV_VAR_NAME] = '1';\n console.log(`Pruning suppressions for ${allFiles.length} files...`);\n await runEslintAsync(allFiles, 'prune');\n } else {\n console.log('No files with existing suppressions found.');\n deleteBulkSuppressionsFileInEslintrcFolder(normalizedCwd);\n }\n}\n\nasync function getAllFilesWithExistingSuppressionsForCwdAsync(normalizedCwd: string): Promise<string[]> {\n const { jsonObject: bulkSuppressionsConfigJson } =\n getSuppressionsConfigForEslintrcFolderPath(normalizedCwd);\n const allFiles: Set<string> = new Set();\n for (const { file: filePath } of bulkSuppressionsConfigJson.suppressions) {\n allFiles.add(filePath);\n }\n\n const allFilesArray: string[] = Array.from(allFiles);\n\n const allExistingFiles: string[] = [];\n // TODO: limit parallelism here with something similar to `Async.forEachAsync` from `node-core-library`.\n await Promise.all(\n allFilesArray.map(async (filePath: string) => {\n try {\n await fs.promises.access(filePath, fs.constants.F_OK);\n allExistingFiles.push(filePath);\n } catch {\n // Doesn't exist - ignore\n }\n })\n );\n\n console.log(`Found ${allExistingFiles.length} files with existing suppressions.`);\n const deletedCount: number = allFilesArray.length - allExistingFiles.length;\n if (deletedCount > 0) {\n console.log(`${deletedCount} files with suppressions were deleted.`);\n }\n\n return allExistingFiles;\n}\n"]}
|
||||
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/runEslint.d.ts
generated
vendored
Normal file
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/runEslint.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export declare function runEslintAsync(files: string[], mode: 'suppress' | 'prune'): Promise<void>;
|
||||
//# sourceMappingURL=runEslint.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/runEslint.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/runEslint.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"runEslint.d.ts","sourceRoot":"","sources":["../../../src/eslint-bulk-suppressions/cli/runEslint.ts"],"names":[],"mappings":"AAMA,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAuC/F"}
|
||||
74
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/runEslint.js
generated
vendored
Normal file
74
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/runEslint.js
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || (function () {
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
return function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.runEslintAsync = runEslintAsync;
|
||||
const get_eslint_cli_1 = require("./utils/get-eslint-cli");
|
||||
async function runEslintAsync(files, mode) {
|
||||
const cwd = process.cwd();
|
||||
const eslintPath = (0, get_eslint_cli_1.getEslintPath)(cwd);
|
||||
const { ESLint } = require(eslintPath);
|
||||
const eslint = new ESLint({
|
||||
useEslintrc: true,
|
||||
cwd
|
||||
});
|
||||
let results;
|
||||
try {
|
||||
results = await eslint.lintFiles(files);
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error(`@rushstack/eslint-bulk execution error: ${e.message}`);
|
||||
}
|
||||
const { write, prune } = await Promise.resolve().then(() => __importStar(require('../bulk-suppressions-patch')));
|
||||
switch (mode) {
|
||||
case 'suppress': {
|
||||
await write();
|
||||
break;
|
||||
}
|
||||
case 'prune': {
|
||||
await prune();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (results.length > 0) {
|
||||
const stylishFormatter = await eslint.loadFormatter();
|
||||
const formattedResults = await Promise.resolve(stylishFormatter.format(results));
|
||||
console.log(formattedResults);
|
||||
}
|
||||
console.log('@rushstack/eslint-bulk: Successfully pruned unused suppressions in all .eslint-bulk-suppressions.json ' +
|
||||
`files under directory ${cwd}`);
|
||||
}
|
||||
//# sourceMappingURL=runEslint.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/runEslint.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/runEslint.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"runEslint.js","sourceRoot":"","sources":["../../../src/eslint-bulk-suppressions/cli/runEslint.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAK3D,wCAuCC;AAzCD,2DAAuD;AAEhD,KAAK,UAAU,cAAc,CAAC,KAAe,EAAE,IAA0B;IAC9E,MAAM,GAAG,GAAW,OAAO,CAAC,GAAG,EAAE,CAAC;IAClC,MAAM,UAAU,GAAW,IAAA,8BAAa,EAAC,GAAG,CAAC,CAAC;IAC9C,MAAM,EAAE,MAAM,EAAE,GAA4B,OAAO,CAAC,UAAU,CAAC,CAAC;IAChE,MAAM,MAAM,GAAW,IAAI,MAAM,CAAC;QAChC,WAAW,EAAE,IAAI;QACjB,GAAG;KACJ,CAAC,CAAC;IAEH,IAAI,OAA4B,CAAC;IACjC,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,wDAAa,4BAA4B,GAAC,CAAC;IACpE,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,UAAU,CAAC,CAAC,CAAC;YAChB,MAAM,KAAK,EAAE,CAAC;YACd,MAAM;QACR,CAAC;QAED,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,MAAM,KAAK,EAAE,CAAC;YACd,MAAM;QACR,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,gBAAgB,GAAqB,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC;QACxE,MAAM,gBAAgB,GAAW,MAAM,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QACzF,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,CAAC,GAAG,CACT,wGAAwG;QACtG,yBAAyB,GAAG,EAAE,CACjC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { ESLint } from 'eslint';\nimport { getEslintPath } from './utils/get-eslint-cli';\n\nexport async function runEslintAsync(files: string[], mode: 'suppress' | 'prune'): Promise<void> {\n const cwd: string = process.cwd();\n const eslintPath: string = getEslintPath(cwd);\n const { ESLint }: typeof import('eslint') = require(eslintPath);\n const eslint: ESLint = new ESLint({\n useEslintrc: true,\n cwd\n });\n\n let results: ESLint.LintResult[];\n try {\n results = await eslint.lintFiles(files);\n } catch (e) {\n throw new Error(`@rushstack/eslint-bulk execution error: ${e.message}`);\n }\n\n const { write, prune } = await import('../bulk-suppressions-patch');\n switch (mode) {\n case 'suppress': {\n await write();\n break;\n }\n\n case 'prune': {\n await prune();\n break;\n }\n }\n\n if (results.length > 0) {\n const stylishFormatter: ESLint.Formatter = await eslint.loadFormatter();\n const formattedResults: string = await Promise.resolve(stylishFormatter.format(results));\n console.log(formattedResults);\n }\n\n console.log(\n '@rushstack/eslint-bulk: Successfully pruned unused suppressions in all .eslint-bulk-suppressions.json ' +\n `files under directory ${cwd}`\n );\n}\n"]}
|
||||
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/start.d.ts
generated
vendored
Normal file
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/start.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=start.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/start.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/start.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/eslint-bulk-suppressions/cli/start.ts"],"names":[],"mappings":""}
|
||||
44
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/start.js
generated
vendored
Normal file
44
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/start.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const prune_1 = require("./prune");
|
||||
const suppress_1 = require("./suppress");
|
||||
const is_correct_cwd_1 = require("./utils/is-correct-cwd");
|
||||
const print_help_1 = require("./utils/print-help");
|
||||
if (process.argv.includes('-h') || process.argv.includes('-H') || process.argv.includes('--help')) {
|
||||
(0, print_help_1.printHelp)();
|
||||
process.exit(0);
|
||||
}
|
||||
if (process.argv.length < 3) {
|
||||
(0, print_help_1.printHelp)();
|
||||
process.exit(1);
|
||||
}
|
||||
if (!(0, is_correct_cwd_1.isCorrectCwd)(process.cwd())) {
|
||||
console.error('@rushstack/eslint-bulk: Please call this command from the directory that contains .eslintrc.js or .eslintrc.cjs');
|
||||
process.exit(1);
|
||||
}
|
||||
const subcommand = process.argv[2];
|
||||
let processPromise;
|
||||
switch (subcommand) {
|
||||
case 'suppress': {
|
||||
processPromise = (0, suppress_1.suppressAsync)();
|
||||
break;
|
||||
}
|
||||
case 'prune': {
|
||||
processPromise = (0, prune_1.pruneAsync)();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
console.error('@rushstack/eslint-bulk: Unknown subcommand: ' + subcommand);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
processPromise.catch((e) => {
|
||||
if (e instanceof Error) {
|
||||
console.error(e.message);
|
||||
process.exit(1);
|
||||
}
|
||||
throw e;
|
||||
});
|
||||
//# sourceMappingURL=start.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/start.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/start.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/eslint-bulk-suppressions/cli/start.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAE3D,mCAAqC;AACrC,yCAA2C;AAC3C,2DAAsD;AACtD,mDAA+C;AAE/C,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;IAClG,IAAA,sBAAS,GAAE,CAAC;IACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;IAC5B,IAAA,sBAAS,GAAE,CAAC;IACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,IAAI,CAAC,IAAA,6BAAY,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;IACjC,OAAO,CAAC,KAAK,CACX,iHAAiH,CAClH,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,GAAW,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC3C,IAAI,cAA6B,CAAC;AAClC,QAAQ,UAAU,EAAE,CAAC;IACnB,KAAK,UAAU,CAAC,CAAC,CAAC;QAChB,cAAc,GAAG,IAAA,wBAAa,GAAE,CAAC;QACjC,MAAM;IACR,CAAC;IAED,KAAK,OAAO,CAAC,CAAC,CAAC;QACb,cAAc,GAAG,IAAA,kBAAU,GAAE,CAAC;QAC9B,MAAM;IACR,CAAC;IAED,OAAO,CAAC,CAAC,CAAC;QACR,OAAO,CAAC,KAAK,CAAC,8CAA8C,GAAG,UAAU,CAAC,CAAC;QAC3E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACzB,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;QACvB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,CAAC;AACV,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { pruneAsync } from './prune';\nimport { suppressAsync } from './suppress';\nimport { isCorrectCwd } from './utils/is-correct-cwd';\nimport { printHelp } from './utils/print-help';\n\nif (process.argv.includes('-h') || process.argv.includes('-H') || process.argv.includes('--help')) {\n printHelp();\n process.exit(0);\n}\n\nif (process.argv.length < 3) {\n printHelp();\n process.exit(1);\n}\n\nif (!isCorrectCwd(process.cwd())) {\n console.error(\n '@rushstack/eslint-bulk: Please call this command from the directory that contains .eslintrc.js or .eslintrc.cjs'\n );\n process.exit(1);\n}\n\nconst subcommand: string = process.argv[2];\nlet processPromise: Promise<void>;\nswitch (subcommand) {\n case 'suppress': {\n processPromise = suppressAsync();\n break;\n }\n\n case 'prune': {\n processPromise = pruneAsync();\n break;\n }\n\n default: {\n console.error('@rushstack/eslint-bulk: Unknown subcommand: ' + subcommand);\n process.exit(1);\n }\n}\n\nprocessPromise.catch((e) => {\n if (e instanceof Error) {\n console.error(e.message);\n process.exit(1);\n }\n\n throw e;\n});\n"]}
|
||||
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/suppress.d.ts
generated
vendored
Normal file
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/suppress.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export declare function suppressAsync(): Promise<void>;
|
||||
//# sourceMappingURL=suppress.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/suppress.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/suppress.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"suppress.d.ts","sourceRoot":"","sources":["../../../src/eslint-bulk-suppressions/cli/suppress.ts"],"names":[],"mappings":"AAaA,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAuEnD"}
|
||||
63
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/suppress.js
generated
vendored
Normal file
63
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/suppress.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.suppressAsync = suppressAsync;
|
||||
const print_help_1 = require("./utils/print-help");
|
||||
const runEslint_1 = require("./runEslint");
|
||||
const constants_1 = require("../constants");
|
||||
async function suppressAsync() {
|
||||
const args = process.argv.slice(3);
|
||||
if (args.includes('--help') || args.includes('-h')) {
|
||||
(0, print_help_1.printSuppressHelp)();
|
||||
process.exit(0);
|
||||
}
|
||||
// Use reduce to create an object with all the parsed arguments
|
||||
const parsedArgs = args.reduce((acc, arg, index, arr) => {
|
||||
if (arg === '--rule') {
|
||||
// continue because next arg should be the rule
|
||||
}
|
||||
else if (index > 0 && arr[index - 1] === '--rule' && arr[index + 1]) {
|
||||
acc.rules.push(arg);
|
||||
}
|
||||
else if (arg === '--all') {
|
||||
acc.all = true;
|
||||
}
|
||||
else if (arg.startsWith('--')) {
|
||||
throw new Error(`@rushstack/eslint-bulk: Unknown option: ${arg}`);
|
||||
}
|
||||
else {
|
||||
acc.files.push(arg);
|
||||
}
|
||||
return acc;
|
||||
}, { rules: [], all: false, files: [] });
|
||||
if (parsedArgs.files.length === 0) {
|
||||
throw new Error('@rushstack/eslint-bulk: Files argument is required. Use glob patterns to specify files or use ' +
|
||||
'`.` to suppress all files for the specified rules.');
|
||||
}
|
||||
if (parsedArgs.rules.length === 0 && !parsedArgs.all) {
|
||||
throw new Error('@rushstack/eslint-bulk: Please specify at least one rule to suppress. Use --all to suppress all rules.');
|
||||
}
|
||||
// Find the index of the last argument that starts with '--'
|
||||
const lastOptionIndex = args
|
||||
.map((arg, i) => (arg.startsWith('--') ? i : -1))
|
||||
.reduce((lastIndex, currentIndex) => Math.max(lastIndex, currentIndex), -1);
|
||||
// Check if options come before files
|
||||
if (parsedArgs.files.some((file) => args.indexOf(file) < lastOptionIndex)) {
|
||||
throw new Error('@rushstack/eslint-bulk: Unable to parse command line arguments. All options should come before files argument.');
|
||||
}
|
||||
if (parsedArgs.all) {
|
||||
process.env[constants_1.ESLINT_BULK_SUPPRESS_ENV_VAR_NAME] = '*';
|
||||
}
|
||||
else if (parsedArgs.rules.length > 0) {
|
||||
process.env[constants_1.ESLINT_BULK_SUPPRESS_ENV_VAR_NAME] = parsedArgs.rules.join(',');
|
||||
}
|
||||
await (0, runEslint_1.runEslintAsync)(parsedArgs.files, 'suppress');
|
||||
if (parsedArgs.all) {
|
||||
console.log(`@rushstack/eslint-bulk: Successfully suppressed all rules for file(s) ${parsedArgs.files}`);
|
||||
}
|
||||
else if (parsedArgs.rules.length > 0) {
|
||||
console.log(`@rushstack/eslint-bulk: Successfully suppressed rules ${parsedArgs.rules} for file(s) ${parsedArgs.files}`);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=suppress.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/suppress.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/suppress.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/get-eslint-cli.d.ts
generated
vendored
Normal file
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/get-eslint-cli.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export declare function getEslintPath(packagePath: string): string;
|
||||
//# sourceMappingURL=get-eslint-cli.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/get-eslint-cli.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/get-eslint-cli.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"get-eslint-cli.d.ts","sourceRoot":"","sources":["../../../../src/eslint-bulk-suppressions/cli/utils/get-eslint-cli.ts"],"names":[],"mappings":"AAkBA,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA8CzD"}
|
||||
56
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/get-eslint-cli.js
generated
vendored
Normal file
56
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/get-eslint-cli.js
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getEslintPath = getEslintPath;
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const constants_1 = require("../../constants");
|
||||
// When this list is updated, update the `eslint-bulk-suppressions-newest-test`
|
||||
// and/or the `eslint-bulk-suppressions-newest-test` projects' eslint dependencies.
|
||||
const TESTED_VERSIONS = new Set([
|
||||
'8.6.0',
|
||||
'8.7.0',
|
||||
'8.21.0',
|
||||
'8.22.0',
|
||||
'8.23.0',
|
||||
'8.23.1',
|
||||
'8.57.0'
|
||||
]);
|
||||
function getEslintPath(packagePath) {
|
||||
// Try to find a local ESLint installation, the one that should be listed as a dev dependency in package.json
|
||||
// and installed in node_modules
|
||||
try {
|
||||
const localEslintApiPath = require.resolve(constants_1.BULK_SUPPRESSIONS_CLI_ESLINT_PACKAGE_NAME, {
|
||||
paths: [packagePath]
|
||||
});
|
||||
const localEslintPath = path_1.default.dirname(path_1.default.dirname(localEslintApiPath));
|
||||
const { version: localEslintVersion } = require(`${localEslintPath}/package.json`);
|
||||
if (!TESTED_VERSIONS.has(localEslintVersion)) {
|
||||
console.warn('@rushstack/eslint-bulk: Be careful, the installed ESLint version has not been tested with eslint-bulk.');
|
||||
}
|
||||
return localEslintApiPath;
|
||||
}
|
||||
catch (e) {
|
||||
try {
|
||||
const { dependencies, devDependencies } = require(`${packagePath}/package.json`);
|
||||
if (devDependencies === null || devDependencies === void 0 ? void 0 : devDependencies.eslint) {
|
||||
throw new Error('@rushstack/eslint-bulk: eslint is specified as a dev dependency in package.json, ' +
|
||||
'but eslint-bulk cannot find it in node_modules.');
|
||||
}
|
||||
else if (dependencies === null || dependencies === void 0 ? void 0 : dependencies.eslint) {
|
||||
throw new Error('@rushstack/eslint-bulk: eslint is specified as a dependency in package.json, ' +
|
||||
'but eslint-bulk cannot find it in node_modules.');
|
||||
}
|
||||
else {
|
||||
throw new Error('@rushstack/eslint-bulk: eslint is not specified as a dependency in package.json.');
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error("@rushstack/eslint-bulk: This command must be run in the same folder as a project's package.json file.");
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=get-eslint-cli.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/get-eslint-cli.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/get-eslint-cli.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"get-eslint-cli.js","sourceRoot":"","sources":["../../../../src/eslint-bulk-suppressions/cli/utils/get-eslint-cli.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;AAiB3D,sCA8CC;AA7DD,gDAAwB;AACxB,+CAA4E;AAE5E,+EAA+E;AAC/E,mFAAmF;AACnF,MAAM,eAAe,GAAgB,IAAI,GAAG,CAAC;IAC3C,OAAO;IACP,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;CACT,CAAC,CAAC;AAEH,SAAgB,aAAa,CAAC,WAAmB;IAC/C,6GAA6G;IAC7G,gCAAgC;IAChC,IAAI,CAAC;QACH,MAAM,kBAAkB,GAAW,OAAO,CAAC,OAAO,CAAC,qDAAyC,EAAE;YAC5F,KAAK,EAAE,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;QACH,MAAM,eAAe,GAAW,cAAI,CAAC,OAAO,CAAC,cAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAC/E,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,GAAG,eAAe,eAAe,CAAC,CAAC;QAEnF,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC;YAC7C,OAAO,CAAC,IAAI,CACV,wGAAwG,CACzG,CAAC;QACJ,CAAC;QAED,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC;YACH,MAAM,EACJ,YAAY,EACZ,eAAe,EAChB,GAGG,OAAO,CAAC,GAAG,WAAW,eAAe,CAAC,CAAC;YAE3C,IAAI,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,EAAE,CAAC;gBAC5B,MAAM,IAAI,KAAK,CACb,mFAAmF;oBACjF,iDAAiD,CACpD,CAAC;YACJ,CAAC;iBAAM,IAAI,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,EAAE,CAAC;gBAChC,MAAM,IAAI,KAAK,CACb,+EAA+E;oBAC7E,iDAAiD,CACpD,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC,CAAC;YACtG,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CACb,uGAAuG,CACxG,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport path from 'path';\nimport { BULK_SUPPRESSIONS_CLI_ESLINT_PACKAGE_NAME } from '../../constants';\n\n// When this list is updated, update the `eslint-bulk-suppressions-newest-test`\n// and/or the `eslint-bulk-suppressions-newest-test` projects' eslint dependencies.\nconst TESTED_VERSIONS: Set<string> = new Set([\n '8.6.0',\n '8.7.0',\n '8.21.0',\n '8.22.0',\n '8.23.0',\n '8.23.1',\n '8.57.0'\n]);\n\nexport function getEslintPath(packagePath: string): string {\n // Try to find a local ESLint installation, the one that should be listed as a dev dependency in package.json\n // and installed in node_modules\n try {\n const localEslintApiPath: string = require.resolve(BULK_SUPPRESSIONS_CLI_ESLINT_PACKAGE_NAME, {\n paths: [packagePath]\n });\n const localEslintPath: string = path.dirname(path.dirname(localEslintApiPath));\n const { version: localEslintVersion } = require(`${localEslintPath}/package.json`);\n\n if (!TESTED_VERSIONS.has(localEslintVersion)) {\n console.warn(\n '@rushstack/eslint-bulk: Be careful, the installed ESLint version has not been tested with eslint-bulk.'\n );\n }\n\n return localEslintApiPath;\n } catch (e) {\n try {\n const {\n dependencies,\n devDependencies\n }: {\n dependencies: Record<string, string> | undefined;\n devDependencies: Record<string, string> | undefined;\n } = require(`${packagePath}/package.json`);\n\n if (devDependencies?.eslint) {\n throw new Error(\n '@rushstack/eslint-bulk: eslint is specified as a dev dependency in package.json, ' +\n 'but eslint-bulk cannot find it in node_modules.'\n );\n } else if (dependencies?.eslint) {\n throw new Error(\n '@rushstack/eslint-bulk: eslint is specified as a dependency in package.json, ' +\n 'but eslint-bulk cannot find it in node_modules.'\n );\n } else {\n throw new Error('@rushstack/eslint-bulk: eslint is not specified as a dependency in package.json.');\n }\n } catch (e) {\n throw new Error(\n \"@rushstack/eslint-bulk: This command must be run in the same folder as a project's package.json file.\"\n );\n }\n }\n}\n"]}
|
||||
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/is-correct-cwd.d.ts
generated
vendored
Normal file
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/is-correct-cwd.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export declare function isCorrectCwd(cwd: string): boolean;
|
||||
//# sourceMappingURL=is-correct-cwd.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/is-correct-cwd.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/is-correct-cwd.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"is-correct-cwd.d.ts","sourceRoot":"","sources":["../../../../src/eslint-bulk-suppressions/cli/utils/is-correct-cwd.ts"],"names":[],"mappings":"AAKA,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEjD"}
|
||||
13
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/is-correct-cwd.js
generated
vendored
Normal file
13
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/is-correct-cwd.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isCorrectCwd = isCorrectCwd;
|
||||
const fs_1 = __importDefault(require("fs"));
|
||||
function isCorrectCwd(cwd) {
|
||||
return fs_1.default.existsSync(`${cwd}/.eslintrc.js`) || fs_1.default.existsSync(`${cwd}/.eslintrc.cjs`);
|
||||
}
|
||||
//# sourceMappingURL=is-correct-cwd.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/is-correct-cwd.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/is-correct-cwd.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"is-correct-cwd.js","sourceRoot":"","sources":["../../../../src/eslint-bulk-suppressions/cli/utils/is-correct-cwd.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;AAI3D,oCAEC;AAJD,4CAAoB;AAEpB,SAAgB,YAAY,CAAC,GAAW;IACtC,OAAO,YAAE,CAAC,UAAU,CAAC,GAAG,GAAG,eAAe,CAAC,IAAI,YAAE,CAAC,UAAU,CAAC,GAAG,GAAG,gBAAgB,CAAC,CAAC;AACvF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport fs from 'fs';\n\nexport function isCorrectCwd(cwd: string): boolean {\n return fs.existsSync(`${cwd}/.eslintrc.js`) || fs.existsSync(`${cwd}/.eslintrc.cjs`);\n}\n"]}
|
||||
4
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/print-help.d.ts
generated
vendored
Normal file
4
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/print-help.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
export declare function printPruneHelp(): void;
|
||||
export declare function printHelp(): void;
|
||||
export declare function printSuppressHelp(): void;
|
||||
//# sourceMappingURL=print-help.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/print-help.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/print-help.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"print-help.d.ts","sourceRoot":"","sources":["../../../../src/eslint-bulk-suppressions/cli/utils/print-help.ts"],"names":[],"mappings":"AAKA,wBAAgB,cAAc,IAAI,IAAI,CAarC;AAED,wBAAgB,SAAS,IAAI,IAAI,CA8BhC;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CA6BxC"}
|
||||
81
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/print-help.js
generated
vendored
Normal file
81
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/print-help.js
generated
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.printPruneHelp = printPruneHelp;
|
||||
exports.printHelp = printHelp;
|
||||
exports.printSuppressHelp = printSuppressHelp;
|
||||
const wrap_words_to_lines_1 = require("./wrap-words-to-lines");
|
||||
function printPruneHelp() {
|
||||
const help = `eslint-bulk prune
|
||||
|
||||
Usage:
|
||||
|
||||
eslint-bulk prune
|
||||
|
||||
This command is a thin wrapper around ESLint that communicates with @rushstack/eslint-patch to delete all unused suppression entries in all .eslint-bulk-suppressions.json files under the current working directory.`;
|
||||
const wrapped = (0, wrap_words_to_lines_1.wrapWordsToLines)(help);
|
||||
for (const line of wrapped) {
|
||||
console.log(line);
|
||||
}
|
||||
}
|
||||
function printHelp() {
|
||||
const help = `eslint-bulk <command>
|
||||
|
||||
Usage:
|
||||
|
||||
eslint-bulk suppress --rule RULENAME1 [--rule RULENAME2...] PATH1 [PATH2...]
|
||||
eslint-bulk suppress --all PATH1 [PATH2...]
|
||||
eslint-bulk suppress --help
|
||||
|
||||
eslint-bulk prune
|
||||
eslint-bulk prune --help
|
||||
|
||||
eslint-bulk --help
|
||||
|
||||
This command line tool is a thin wrapper around ESLint that communicates with @rushstack/eslint-patch to suppress or prune unused suppressions in the local .eslint-bulk-suppressions.json file.
|
||||
|
||||
Commands:
|
||||
eslint-bulk suppress [options] <path...>
|
||||
Use this command to generate a new .eslint-bulk-suppressions.json file or add suppression entries to the existing file. Specify the files and rules you want to suppress.
|
||||
Please run "eslint-bulk suppress --help" to learn more.
|
||||
|
||||
eslint-bulk prune
|
||||
Use this command to delete all unused suppression entries in all .eslint-bulk-suppressions.json files under the current working directory.
|
||||
Please run "eslint-bulk prune --help" to learn more.
|
||||
`;
|
||||
const wrapped = (0, wrap_words_to_lines_1.wrapWordsToLines)(help);
|
||||
for (const line of wrapped) {
|
||||
console.log(line);
|
||||
}
|
||||
}
|
||||
function printSuppressHelp() {
|
||||
const help = `eslint-bulk suppress [options] <path...>
|
||||
|
||||
Usage:
|
||||
|
||||
eslint-bulk suppress --rule RULENAME1 [--rule RULENAME2...] PATH1 [PATH2...]
|
||||
eslint-bulk suppress --all PATH1 [PATH2...]
|
||||
eslint-bulk suppress --help
|
||||
|
||||
This command is a thin wrapper around ESLint that communicates with @rushstack/eslint-patch to either generate a new .eslint-bulk-suppressions.json file or add suppression entries to the existing file. Specify the files and rules you want to suppress.
|
||||
|
||||
Argument:
|
||||
<path...>
|
||||
Glob patterns for paths to suppress, same as eslint files argument. Should be relative to the project root.
|
||||
|
||||
Options:
|
||||
-h, -H, --help
|
||||
Display this help message.
|
||||
|
||||
-R, --rule
|
||||
The full name of the ESLint rule you want to bulk-suppress. Specify multiple rules with --rule NAME1 --rule RULENAME2.
|
||||
|
||||
-A, --all
|
||||
Bulk-suppress all rules in the specified file patterns.`;
|
||||
const wrapped = (0, wrap_words_to_lines_1.wrapWordsToLines)(help);
|
||||
for (const line of wrapped) {
|
||||
console.log(line);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=print-help.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/print-help.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/print-help.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"print-help.js","sourceRoot":"","sources":["../../../../src/eslint-bulk-suppressions/cli/utils/print-help.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAI3D,wCAaC;AAED,8BA8BC;AAED,8CA6BC;AA9ED,+DAAyD;AAEzD,SAAgB,cAAc;IAC5B,MAAM,IAAI,GAAW;;;;;;sNAM+L,CAAC;IAErN,MAAM,OAAO,GAAa,IAAA,sCAAgB,EAAC,IAAI,CAAC,CAAC;IACjD,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;AACH,CAAC;AAED,SAAgB,SAAS;IACvB,MAAM,IAAI,GAAW;;;;;;;;;;;;;;;;;;;;;;;CAuBtB,CAAC;IAEA,MAAM,OAAO,GAAa,IAAA,sCAAgB,EAAC,IAAI,CAAC,CAAC;IACjD,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;AACH,CAAC;AAED,SAAgB,iBAAiB;IAC/B,MAAM,IAAI,GAAW;;;;;;;;;;;;;;;;;;;;;;4DAsBqC,CAAC;IAE3D,MAAM,OAAO,GAAa,IAAA,sCAAgB,EAAC,IAAI,CAAC,CAAC;IACjD,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { wrapWordsToLines } from './wrap-words-to-lines';\n\nexport function printPruneHelp(): void {\n const help: string = `eslint-bulk prune\n\nUsage:\n\neslint-bulk prune\n\nThis command is a thin wrapper around ESLint that communicates with @rushstack/eslint-patch to delete all unused suppression entries in all .eslint-bulk-suppressions.json files under the current working directory.`;\n\n const wrapped: string[] = wrapWordsToLines(help);\n for (const line of wrapped) {\n console.log(line);\n }\n}\n\nexport function printHelp(): void {\n const help: string = `eslint-bulk <command>\n\nUsage:\n\neslint-bulk suppress --rule RULENAME1 [--rule RULENAME2...] PATH1 [PATH2...]\neslint-bulk suppress --all PATH1 [PATH2...]\neslint-bulk suppress --help\n\neslint-bulk prune\neslint-bulk prune --help\n\neslint-bulk --help\n\nThis command line tool is a thin wrapper around ESLint that communicates with @rushstack/eslint-patch to suppress or prune unused suppressions in the local .eslint-bulk-suppressions.json file.\n\nCommands:\n eslint-bulk suppress [options] <path...>\n Use this command to generate a new .eslint-bulk-suppressions.json file or add suppression entries to the existing file. Specify the files and rules you want to suppress.\n Please run \"eslint-bulk suppress --help\" to learn more.\n\n eslint-bulk prune\n Use this command to delete all unused suppression entries in all .eslint-bulk-suppressions.json files under the current working directory.\n Please run \"eslint-bulk prune --help\" to learn more.\n`;\n\n const wrapped: string[] = wrapWordsToLines(help);\n for (const line of wrapped) {\n console.log(line);\n }\n}\n\nexport function printSuppressHelp(): void {\n const help: string = `eslint-bulk suppress [options] <path...>\n\nUsage:\n\neslint-bulk suppress --rule RULENAME1 [--rule RULENAME2...] PATH1 [PATH2...]\neslint-bulk suppress --all PATH1 [PATH2...]\neslint-bulk suppress --help\n\nThis command is a thin wrapper around ESLint that communicates with @rushstack/eslint-patch to either generate a new .eslint-bulk-suppressions.json file or add suppression entries to the existing file. Specify the files and rules you want to suppress.\n\nArgument:\n <path...>\n Glob patterns for paths to suppress, same as eslint files argument. Should be relative to the project root.\n\nOptions:\n -h, -H, --help\n Display this help message.\n\n -R, --rule\n The full name of the ESLint rule you want to bulk-suppress. Specify multiple rules with --rule NAME1 --rule RULENAME2.\n\n -A, --all\n Bulk-suppress all rules in the specified file patterns.`;\n\n const wrapped: string[] = wrapWordsToLines(help);\n for (const line of wrapped) {\n console.log(line);\n }\n}\n"]}
|
||||
26
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/wrap-words-to-lines.d.ts
generated
vendored
Normal file
26
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/wrap-words-to-lines.d.ts
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Applies word wrapping and returns an array of lines.
|
||||
*
|
||||
* @param text - The text to wrap
|
||||
* @param maxLineLength - The maximum length of a line, defaults to the console width
|
||||
* @param indent - The number of spaces to indent the wrapped lines, defaults to 0
|
||||
*/
|
||||
export declare function wrapWordsToLines(text: string, maxLineLength?: number, indent?: number): string[];
|
||||
/**
|
||||
* Applies word wrapping and returns an array of lines.
|
||||
*
|
||||
* @param text - The text to wrap
|
||||
* @param maxLineLength - The maximum length of a line, defaults to the console width
|
||||
* @param linePrefix - The string to prefix each line with, defaults to ''
|
||||
*/
|
||||
export declare function wrapWordsToLines(text: string, maxLineLength?: number, linePrefix?: string): string[];
|
||||
/**
|
||||
* Applies word wrapping and returns an array of lines.
|
||||
*
|
||||
* @param text - The text to wrap
|
||||
* @param maxLineLength - The maximum length of a line, defaults to the console width
|
||||
* @param indentOrLinePrefix - The number of spaces to indent the wrapped lines or the string to prefix
|
||||
* each line with, defaults to no prefix
|
||||
*/
|
||||
export declare function wrapWordsToLines(text: string, maxLineLength?: number, indentOrLinePrefix?: number | string): string[];
|
||||
//# sourceMappingURL=wrap-words-to-lines.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/wrap-words-to-lines.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/wrap-words-to-lines.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"wrap-words-to-lines.d.ts","sourceRoot":"","sources":["../../../../src/eslint-bulk-suppressions/cli/utils/wrap-words-to-lines.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;AAClG;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;AACtG;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE,MAAM,EACtB,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,GACnC,MAAM,EAAE,CAAC"}
|
||||
68
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/wrap-words-to-lines.js
generated
vendored
Normal file
68
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/wrap-words-to-lines.js
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.wrapWordsToLines = wrapWordsToLines;
|
||||
function wrapWordsToLines(text, maxLineLength, indentOrLinePrefix) {
|
||||
var _a;
|
||||
let linePrefix;
|
||||
switch (typeof indentOrLinePrefix) {
|
||||
case 'number':
|
||||
linePrefix = ' '.repeat(indentOrLinePrefix);
|
||||
break;
|
||||
case 'string':
|
||||
linePrefix = indentOrLinePrefix;
|
||||
break;
|
||||
default:
|
||||
linePrefix = '';
|
||||
break;
|
||||
}
|
||||
const linePrefixLength = linePrefix.length;
|
||||
if (!maxLineLength) {
|
||||
maxLineLength = process.stdout.getWindowSize()[0];
|
||||
}
|
||||
// Apply word wrapping and the provided line prefix, while also respecting existing newlines
|
||||
// and prefix spaces that may exist in the text string already.
|
||||
const lines = text.split(/\r?\n/);
|
||||
const wrappedLines = [];
|
||||
for (const line of lines) {
|
||||
if (line.length + linePrefixLength <= maxLineLength) {
|
||||
wrappedLines.push(linePrefix + line);
|
||||
}
|
||||
else {
|
||||
const lineAdditionalPrefix = ((_a = line.match(/^\s*/)) === null || _a === void 0 ? void 0 : _a[0]) || '';
|
||||
const whitespaceRegexp = /\s+/g;
|
||||
let currentWhitespaceMatch = null;
|
||||
let previousWhitespaceMatch;
|
||||
let currentLineStartIndex = lineAdditionalPrefix.length;
|
||||
let previousBreakRanOver = false;
|
||||
while ((currentWhitespaceMatch = whitespaceRegexp.exec(line)) !== null) {
|
||||
if (currentWhitespaceMatch.index + linePrefixLength - currentLineStartIndex > maxLineLength) {
|
||||
let whitespaceToSplitAt;
|
||||
if (!previousWhitespaceMatch ||
|
||||
// Handle the case where there are two words longer than the maxLineLength in a row
|
||||
previousBreakRanOver) {
|
||||
whitespaceToSplitAt = currentWhitespaceMatch;
|
||||
}
|
||||
else {
|
||||
whitespaceToSplitAt = previousWhitespaceMatch;
|
||||
}
|
||||
wrappedLines.push(linePrefix +
|
||||
lineAdditionalPrefix +
|
||||
line.substring(currentLineStartIndex, whitespaceToSplitAt.index));
|
||||
previousBreakRanOver = whitespaceToSplitAt.index - currentLineStartIndex > maxLineLength;
|
||||
currentLineStartIndex = whitespaceToSplitAt.index + whitespaceToSplitAt[0].length;
|
||||
}
|
||||
else {
|
||||
previousBreakRanOver = false;
|
||||
}
|
||||
previousWhitespaceMatch = currentWhitespaceMatch;
|
||||
}
|
||||
if (currentLineStartIndex < line.length) {
|
||||
wrappedLines.push(linePrefix + lineAdditionalPrefix + line.substring(currentLineStartIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
return wrappedLines;
|
||||
}
|
||||
//# sourceMappingURL=wrap-words-to-lines.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/wrap-words-to-lines.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/cli/utils/wrap-words-to-lines.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
10
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/constants.d.ts
generated
vendored
Normal file
10
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/constants.d.ts
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
export declare const ESLINT_BULK_PATCH_PATH_ENV_VAR_NAME: 'RUSHSTACK_ESLINT_BULK_PATCH_PATH';
|
||||
export declare const ESLINT_BULK_SUPPRESS_ENV_VAR_NAME: 'RUSHSTACK_ESLINT_BULK_SUPPRESS';
|
||||
export declare const ESLINT_BULK_ENABLE_ENV_VAR_NAME: 'ESLINT_BULK_ENABLE';
|
||||
export declare const ESLINT_BULK_PRUNE_ENV_VAR_NAME: 'ESLINT_BULK_PRUNE';
|
||||
export declare const ESLINT_BULK_DETECT_ENV_VAR_NAME: '_RUSHSTACK_ESLINT_BULK_DETECT';
|
||||
export declare const ESLINT_BULK_FORCE_REGENERATE_PATCH_ENV_VAR_NAME: 'RUSHSTACK_ESLINT_BULK_FORCE_REGENERATE_PATCH';
|
||||
export declare const VSCODE_PID_ENV_VAR_NAME: 'VSCODE_PID';
|
||||
export declare const ESLINT_PACKAGE_NAME_ENV_VAR_NAME: '_RUSHSTACK_ESLINT_PACKAGE_NAME';
|
||||
export declare const BULK_SUPPRESSIONS_CLI_ESLINT_PACKAGE_NAME: string;
|
||||
//# sourceMappingURL=constants.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/constants.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/constants.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/eslint-bulk-suppressions/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mCAAmC,EAAE,kCACd,CAAC;AACrC,eAAO,MAAM,iCAAiC,EAAE,gCACd,CAAC;AACnC,eAAO,MAAM,+BAA+B,EAAE,oBAA2C,CAAC;AAC1F,eAAO,MAAM,8BAA8B,EAAE,mBAAyC,CAAC;AACvF,eAAO,MAAM,+BAA+B,EAAE,+BACb,CAAC;AAClC,eAAO,MAAM,+CAA+C,EAAE,8CACd,CAAC;AACjD,eAAO,MAAM,uBAAuB,EAAE,YAA2B,CAAC;AAElE,eAAO,MAAM,gCAAgC,EAAE,gCACb,CAAC;AAEnC,eAAO,MAAM,yCAAyC,EAAE,MACG,CAAC"}
|
||||
16
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/constants.js
generated
vendored
Normal file
16
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/constants.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.BULK_SUPPRESSIONS_CLI_ESLINT_PACKAGE_NAME = exports.ESLINT_PACKAGE_NAME_ENV_VAR_NAME = exports.VSCODE_PID_ENV_VAR_NAME = exports.ESLINT_BULK_FORCE_REGENERATE_PATCH_ENV_VAR_NAME = exports.ESLINT_BULK_DETECT_ENV_VAR_NAME = exports.ESLINT_BULK_PRUNE_ENV_VAR_NAME = exports.ESLINT_BULK_ENABLE_ENV_VAR_NAME = exports.ESLINT_BULK_SUPPRESS_ENV_VAR_NAME = exports.ESLINT_BULK_PATCH_PATH_ENV_VAR_NAME = void 0;
|
||||
exports.ESLINT_BULK_PATCH_PATH_ENV_VAR_NAME = 'RUSHSTACK_ESLINT_BULK_PATCH_PATH';
|
||||
exports.ESLINT_BULK_SUPPRESS_ENV_VAR_NAME = 'RUSHSTACK_ESLINT_BULK_SUPPRESS';
|
||||
exports.ESLINT_BULK_ENABLE_ENV_VAR_NAME = 'ESLINT_BULK_ENABLE';
|
||||
exports.ESLINT_BULK_PRUNE_ENV_VAR_NAME = 'ESLINT_BULK_PRUNE';
|
||||
exports.ESLINT_BULK_DETECT_ENV_VAR_NAME = '_RUSHSTACK_ESLINT_BULK_DETECT';
|
||||
exports.ESLINT_BULK_FORCE_REGENERATE_PATCH_ENV_VAR_NAME = 'RUSHSTACK_ESLINT_BULK_FORCE_REGENERATE_PATCH';
|
||||
exports.VSCODE_PID_ENV_VAR_NAME = 'VSCODE_PID';
|
||||
exports.ESLINT_PACKAGE_NAME_ENV_VAR_NAME = '_RUSHSTACK_ESLINT_PACKAGE_NAME';
|
||||
exports.BULK_SUPPRESSIONS_CLI_ESLINT_PACKAGE_NAME = (_a = process.env[exports.ESLINT_PACKAGE_NAME_ENV_VAR_NAME]) !== null && _a !== void 0 ? _a : 'eslint';
|
||||
//# sourceMappingURL=constants.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/constants.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/constants.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/eslint-bulk-suppressions/constants.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;AAE9C,QAAA,mCAAmC,GAC9C,kCAAkC,CAAC;AACxB,QAAA,iCAAiC,GAC5C,gCAAgC,CAAC;AACtB,QAAA,+BAA+B,GAAyB,oBAAoB,CAAC;AAC7E,QAAA,8BAA8B,GAAwB,mBAAmB,CAAC;AAC1E,QAAA,+BAA+B,GAC1C,+BAA+B,CAAC;AACrB,QAAA,+CAA+C,GAC1D,8CAA8C,CAAC;AACpC,QAAA,uBAAuB,GAAiB,YAAY,CAAC;AAErD,QAAA,gCAAgC,GAC3C,gCAAgC,CAAC;AAEtB,QAAA,yCAAyC,GACpD,MAAA,OAAO,CAAC,GAAG,CAAC,wCAAgC,CAAC,mCAAI,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nexport const ESLINT_BULK_PATCH_PATH_ENV_VAR_NAME: 'RUSHSTACK_ESLINT_BULK_PATCH_PATH' =\n 'RUSHSTACK_ESLINT_BULK_PATCH_PATH';\nexport const ESLINT_BULK_SUPPRESS_ENV_VAR_NAME: 'RUSHSTACK_ESLINT_BULK_SUPPRESS' =\n 'RUSHSTACK_ESLINT_BULK_SUPPRESS';\nexport const ESLINT_BULK_ENABLE_ENV_VAR_NAME: 'ESLINT_BULK_ENABLE' = 'ESLINT_BULK_ENABLE';\nexport const ESLINT_BULK_PRUNE_ENV_VAR_NAME: 'ESLINT_BULK_PRUNE' = 'ESLINT_BULK_PRUNE';\nexport const ESLINT_BULK_DETECT_ENV_VAR_NAME: '_RUSHSTACK_ESLINT_BULK_DETECT' =\n '_RUSHSTACK_ESLINT_BULK_DETECT';\nexport const ESLINT_BULK_FORCE_REGENERATE_PATCH_ENV_VAR_NAME: 'RUSHSTACK_ESLINT_BULK_FORCE_REGENERATE_PATCH' =\n 'RUSHSTACK_ESLINT_BULK_FORCE_REGENERATE_PATCH';\nexport const VSCODE_PID_ENV_VAR_NAME: 'VSCODE_PID' = 'VSCODE_PID';\n\nexport const ESLINT_PACKAGE_NAME_ENV_VAR_NAME: '_RUSHSTACK_ESLINT_PACKAGE_NAME' =\n '_RUSHSTACK_ESLINT_PACKAGE_NAME';\n\nexport const BULK_SUPPRESSIONS_CLI_ESLINT_PACKAGE_NAME: string =\n process.env[ESLINT_PACKAGE_NAME_ENV_VAR_NAME] ?? 'eslint';\n"]}
|
||||
7
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/generate-patched-file.d.ts
generated
vendored
Normal file
7
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/generate-patched-file.d.ts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Dynamically generate file to properly patch many versions of ESLint
|
||||
* @param inputFilePath - Must be an iteration of https://github.com/eslint/eslint/blob/main/lib/linter/linter.js
|
||||
* @param outputFilePath - Some small changes to linter.js
|
||||
*/
|
||||
export declare function generatePatchedLinterJsFileIfDoesNotExist(inputFilePath: string, outputFilePath: string): void;
|
||||
//# sourceMappingURL=generate-patched-file.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/generate-patched-file.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/generate-patched-file.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"generate-patched-file.d.ts","sourceRoot":"","sources":["../../src/eslint-bulk-suppressions/generate-patched-file.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,wBAAgB,yCAAyC,CACvD,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,GACrB,IAAI,CA6ON"}
|
||||
220
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/generate-patched-file.js
generated
vendored
Normal file
220
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/generate-patched-file.js
generated
vendored
Normal file
@ -0,0 +1,220 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.generatePatchedLinterJsFileIfDoesNotExist = generatePatchedLinterJsFileIfDoesNotExist;
|
||||
const fs_1 = __importDefault(require("fs"));
|
||||
const constants_1 = require("./constants");
|
||||
/**
|
||||
* Dynamically generate file to properly patch many versions of ESLint
|
||||
* @param inputFilePath - Must be an iteration of https://github.com/eslint/eslint/blob/main/lib/linter/linter.js
|
||||
* @param outputFilePath - Some small changes to linter.js
|
||||
*/
|
||||
function generatePatchedLinterJsFileIfDoesNotExist(inputFilePath, outputFilePath) {
|
||||
const generateEnvVarValue = process.env[constants_1.ESLINT_BULK_FORCE_REGENERATE_PATCH_ENV_VAR_NAME];
|
||||
if (generateEnvVarValue !== 'true' && generateEnvVarValue !== '1' && fs_1.default.existsSync(outputFilePath)) {
|
||||
return;
|
||||
}
|
||||
const inputFile = fs_1.default.readFileSync(inputFilePath).toString();
|
||||
let inputIndex = 0;
|
||||
/**
|
||||
* Extract from the stream until marker is reached. When matching marker,
|
||||
* ignore whitespace in the stream and in the marker. Return the extracted text.
|
||||
*/
|
||||
function scanUntilMarker(marker) {
|
||||
const trimmedMarker = marker.replace(/\s/g, '');
|
||||
let output = '';
|
||||
let trimmed = '';
|
||||
while (inputIndex < inputFile.length) {
|
||||
const char = inputFile[inputIndex++];
|
||||
output += char;
|
||||
if (!/^\s$/.test(char)) {
|
||||
trimmed += char;
|
||||
}
|
||||
if (trimmed.endsWith(trimmedMarker)) {
|
||||
return output;
|
||||
}
|
||||
}
|
||||
throw new Error('Unexpected end of input while looking for ' + JSON.stringify(marker));
|
||||
}
|
||||
function scanUntilNewline() {
|
||||
let output = '';
|
||||
while (inputIndex < inputFile.length) {
|
||||
const char = inputFile[inputIndex++];
|
||||
output += char;
|
||||
if (char === '\n') {
|
||||
return output;
|
||||
}
|
||||
}
|
||||
throw new Error('Unexpected end of input while looking for new line');
|
||||
}
|
||||
function scanUntilEnd() {
|
||||
const output = inputFile.substring(inputIndex);
|
||||
inputIndex = inputFile.length;
|
||||
return output;
|
||||
}
|
||||
/**
|
||||
* Returns index of next public method
|
||||
* @param fromIndex - index of inputFile to search if public method still exists
|
||||
* @returns -1 if public method does not exist or index of next public method
|
||||
*/
|
||||
function getIndexOfNextPublicMethod(fromIndex) {
|
||||
const rest = inputFile.substring(fromIndex);
|
||||
const endOfClassIndex = rest.indexOf('\n}');
|
||||
const markerForStartOfClassMethod = '\n */\n ';
|
||||
const startOfClassMethodIndex = rest.indexOf(markerForStartOfClassMethod);
|
||||
if (startOfClassMethodIndex === -1 || startOfClassMethodIndex > endOfClassIndex) {
|
||||
return -1;
|
||||
}
|
||||
const afterMarkerIndex = rest.indexOf(markerForStartOfClassMethod) + markerForStartOfClassMethod.length;
|
||||
const isPublicMethod = rest[afterMarkerIndex] !== '_' &&
|
||||
rest[afterMarkerIndex] !== '#' &&
|
||||
!rest.substring(afterMarkerIndex, rest.indexOf('\n', afterMarkerIndex)).includes('static') &&
|
||||
!rest.substring(afterMarkerIndex, rest.indexOf('\n', afterMarkerIndex)).includes('constructor');
|
||||
if (isPublicMethod) {
|
||||
return fromIndex + afterMarkerIndex;
|
||||
}
|
||||
return getIndexOfNextPublicMethod(fromIndex + afterMarkerIndex);
|
||||
}
|
||||
function scanUntilIndex(indexToScanTo) {
|
||||
const output = inputFile.substring(inputIndex, indexToScanTo);
|
||||
inputIndex = indexToScanTo;
|
||||
return output;
|
||||
}
|
||||
let outputFile = '';
|
||||
// Match this:
|
||||
// //------------------------------------------------------------------------------
|
||||
// // Requirements
|
||||
// //------------------------------------------------------------------------------
|
||||
outputFile += scanUntilMarker('// Requirements');
|
||||
outputFile += scanUntilMarker('//--');
|
||||
outputFile += scanUntilNewline();
|
||||
outputFile += `
|
||||
// --- BEGIN MONKEY PATCH ---
|
||||
const bulkSuppressionsPatch = require(process.env.${constants_1.ESLINT_BULK_PATCH_PATH_ENV_VAR_NAME});
|
||||
const requireFromPathToLinterJS = bulkSuppressionsPatch.requireFromPathToLinterJS;
|
||||
`;
|
||||
// Match this:
|
||||
// //------------------------------------------------------------------------------
|
||||
// // Typedefs
|
||||
// //------------------------------------------------------------------------------
|
||||
const requireSection = scanUntilMarker('// Typedefs');
|
||||
// Match something like this:
|
||||
//
|
||||
// const path = require('path'),
|
||||
// eslintScope = require('eslint-scope'),
|
||||
// evk = require('eslint-visitor-keys'),
|
||||
//
|
||||
// Convert to something like this:
|
||||
//
|
||||
// const path = require('path'),
|
||||
// eslintScope = requireFromPathToLinterJS('eslint-scope'),
|
||||
// evk = requireFromPathToLinterJS('eslint-visitor-keys'),
|
||||
//
|
||||
outputFile += requireSection.replace(/require\s*\((?:'([^']+)'|"([^"]+)")\)/g, (match, p1, p2) => {
|
||||
var _a;
|
||||
const importPath = (_a = p1 !== null && p1 !== void 0 ? p1 : p2) !== null && _a !== void 0 ? _a : '';
|
||||
if (importPath !== 'path') {
|
||||
if (p1) {
|
||||
return `requireFromPathToLinterJS('${p1}')`;
|
||||
}
|
||||
if (p2) {
|
||||
return `requireFromPathToLinterJS("${p2}")`;
|
||||
}
|
||||
}
|
||||
// Keep as-is
|
||||
return match;
|
||||
});
|
||||
outputFile += `--- END MONKEY PATCH ---
|
||||
`;
|
||||
// Match this:
|
||||
// ```
|
||||
// if (reportTranslator === null) {
|
||||
// reportTranslator = createReportTranslator({
|
||||
// ruleId,
|
||||
// severity,
|
||||
// sourceCode,
|
||||
// messageIds,
|
||||
// disableFixes
|
||||
// });
|
||||
// }
|
||||
// const problem = reportTranslator(...args);
|
||||
//
|
||||
// if (problem.fix && !(rule.meta && rule.meta.fixable)) {
|
||||
// throw new Error("Fixable rules must set the `meta.fixable` property to \"code\" or \"whitespace\".");
|
||||
// }
|
||||
// ```
|
||||
//
|
||||
// Convert to something like this:
|
||||
// ```
|
||||
// if (reportTranslator === null) {
|
||||
// reportTranslator = createReportTranslator({
|
||||
// ruleId,
|
||||
// severity,
|
||||
// sourceCode,
|
||||
// messageIds,
|
||||
// disableFixes
|
||||
// });
|
||||
// }
|
||||
// const problem = reportTranslator(...args);
|
||||
// // --- BEGIN MONKEY PATCH ---
|
||||
// if (bulkSuppressionsPatch.shouldBulkSuppress({ filename, currentNode, ruleId })) return;
|
||||
// // --- END MONKEY PATCH ---
|
||||
//
|
||||
// if (problem.fix && !(rule.meta && rule.meta.fixable)) {
|
||||
// throw new Error("Fixable rules must set the `meta.fixable` property to \"code\" or \"whitespace\".");
|
||||
// }
|
||||
// ```
|
||||
outputFile += scanUntilMarker('const problem = reportTranslator(...args);');
|
||||
outputFile += `
|
||||
// --- BEGIN MONKEY PATCH ---
|
||||
if (bulkSuppressionsPatch.shouldBulkSuppress({ filename, currentNode, ruleId, problem })) return;
|
||||
// --- END MONKEY PATCH ---
|
||||
`;
|
||||
outputFile += scanUntilMarker('nodeQueue.forEach(traversalInfo => {');
|
||||
outputFile += scanUntilMarker('});');
|
||||
outputFile += scanUntilNewline();
|
||||
outputFile += scanUntilMarker('class Linter {');
|
||||
outputFile += scanUntilNewline();
|
||||
outputFile += `
|
||||
// --- BEGIN MONKEY PATCH ---
|
||||
/**
|
||||
* We intercept ESLint execution at the .eslintrc.js file, but unfortunately the Linter class is
|
||||
* initialized before the .eslintrc.js file is executed. This means the internalSlotsMap that all
|
||||
* the patched methods refer to is not initialized. This method checks if the internalSlotsMap is
|
||||
* initialized, and if not, initializes it.
|
||||
*/
|
||||
_conditionallyReinitialize({ cwd, configType } = {}) {
|
||||
if (internalSlotsMap.get(this) === undefined) {
|
||||
internalSlotsMap.set(this, {
|
||||
cwd: normalizeCwd(cwd),
|
||||
lastConfigArray: null,
|
||||
lastSourceCode: null,
|
||||
lastSuppressedMessages: [],
|
||||
configType, // TODO: Remove after flat config conversion
|
||||
parserMap: new Map([['espree', espree]]),
|
||||
ruleMap: new Rules()
|
||||
});
|
||||
|
||||
this.version = pkg.version;
|
||||
}
|
||||
}
|
||||
// --- END MONKEY PATCH ---
|
||||
`;
|
||||
let indexOfNextPublicMethod = getIndexOfNextPublicMethod(inputIndex);
|
||||
while (indexOfNextPublicMethod !== -1) {
|
||||
outputFile += scanUntilIndex(indexOfNextPublicMethod);
|
||||
outputFile += scanUntilNewline();
|
||||
outputFile += ` // --- BEGIN MONKEY PATCH ---
|
||||
this._conditionallyReinitialize();
|
||||
// --- END MONKEY PATCH ---
|
||||
`;
|
||||
indexOfNextPublicMethod = getIndexOfNextPublicMethod(inputIndex);
|
||||
}
|
||||
outputFile += scanUntilEnd();
|
||||
fs_1.default.writeFileSync(outputFilePath, outputFile);
|
||||
}
|
||||
//# sourceMappingURL=generate-patched-file.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/generate-patched-file.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/generate-patched-file.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/index.d.ts
generated
vendored
Normal file
2
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/index.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/index.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eslint-bulk-suppressions/index.ts"],"names":[],"mappings":""}
|
||||
27
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/index.js
generated
vendored
Normal file
27
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/index.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const _patch_base_1 = require("../_patch-base");
|
||||
const path_utils_1 = require("./path-utils");
|
||||
const bulk_suppressions_patch_1 = require("./bulk-suppressions-patch");
|
||||
const generate_patched_file_1 = require("./generate-patched-file");
|
||||
const constants_1 = require("./constants");
|
||||
if (!_patch_base_1.eslintFolder) {
|
||||
console.error('@rushstack/eslint-patch/eslint-bulk-suppressions: Could not find ESLint installation to patch.');
|
||||
process.exit(1);
|
||||
}
|
||||
const eslintBulkDetectEnvVarValue = process.env[constants_1.ESLINT_BULK_DETECT_ENV_VAR_NAME];
|
||||
if (eslintBulkDetectEnvVarValue === 'true' || eslintBulkDetectEnvVarValue === '1') {
|
||||
(0, path_utils_1.findAndConsoleLogPatchPathCli)();
|
||||
process.exit(0);
|
||||
}
|
||||
const pathToLinterJS = (0, path_utils_1.getPathToLinterJS)();
|
||||
process.env[constants_1.ESLINT_BULK_PATCH_PATH_ENV_VAR_NAME] = require.resolve('./bulk-suppressions-patch');
|
||||
const pathToGeneratedPatch = (0, path_utils_1.ensurePathToGeneratedPatch)();
|
||||
(0, generate_patched_file_1.generatePatchedLinterJsFileIfDoesNotExist)(pathToLinterJS, pathToGeneratedPatch);
|
||||
const { Linter: LinterPatch } = require(pathToGeneratedPatch);
|
||||
LinterPatch.prototype.verify = (0, bulk_suppressions_patch_1.extendVerifyFunction)(LinterPatch.prototype.verify);
|
||||
const { Linter } = require(pathToLinterJS);
|
||||
(0, bulk_suppressions_patch_1.patchClass)(Linter, LinterPatch);
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/index.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eslint-bulk-suppressions/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAE3D,gDAA8C;AAC9C,6CAA4G;AAC5G,uEAA6E;AAC7E,mEAAoF;AACpF,2CAAmG;AAEnG,IAAI,CAAC,0BAAY,EAAE,CAAC;IAClB,OAAO,CAAC,KAAK,CACX,gGAAgG,CACjG,CAAC;IAEF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,2BAA2B,GAAuB,OAAO,CAAC,GAAG,CAAC,2CAA+B,CAAC,CAAC;AACrG,IAAI,2BAA2B,KAAK,MAAM,IAAI,2BAA2B,KAAK,GAAG,EAAE,CAAC;IAClF,IAAA,0CAA6B,GAAE,CAAC;IAChC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,cAAc,GAAW,IAAA,8BAAiB,GAAE,CAAC;AAEnD,OAAO,CAAC,GAAG,CAAC,+CAAmC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAEhG,MAAM,oBAAoB,GAAW,IAAA,uCAA0B,GAAE,CAAC;AAClE,IAAA,iEAAyC,EAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC;AAChF,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAC9D,WAAW,CAAC,SAAS,CAAC,MAAM,GAAG,IAAA,8CAAoB,EAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAElF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAE3C,IAAA,oCAAU,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { eslintFolder } from '../_patch-base';\nimport { findAndConsoleLogPatchPathCli, getPathToLinterJS, ensurePathToGeneratedPatch } from './path-utils';\nimport { patchClass, extendVerifyFunction } from './bulk-suppressions-patch';\nimport { generatePatchedLinterJsFileIfDoesNotExist } from './generate-patched-file';\nimport { ESLINT_BULK_DETECT_ENV_VAR_NAME, ESLINT_BULK_PATCH_PATH_ENV_VAR_NAME } from './constants';\n\nif (!eslintFolder) {\n console.error(\n '@rushstack/eslint-patch/eslint-bulk-suppressions: Could not find ESLint installation to patch.'\n );\n\n process.exit(1);\n}\n\nconst eslintBulkDetectEnvVarValue: string | undefined = process.env[ESLINT_BULK_DETECT_ENV_VAR_NAME];\nif (eslintBulkDetectEnvVarValue === 'true' || eslintBulkDetectEnvVarValue === '1') {\n findAndConsoleLogPatchPathCli();\n process.exit(0);\n}\n\nconst pathToLinterJS: string = getPathToLinterJS();\n\nprocess.env[ESLINT_BULK_PATCH_PATH_ENV_VAR_NAME] = require.resolve('./bulk-suppressions-patch');\n\nconst pathToGeneratedPatch: string = ensurePathToGeneratedPatch();\ngeneratePatchedLinterJsFileIfDoesNotExist(pathToLinterJS, pathToGeneratedPatch);\nconst { Linter: LinterPatch } = require(pathToGeneratedPatch);\nLinterPatch.prototype.verify = extendVerifyFunction(LinterPatch.prototype.verify);\n\nconst { Linter } = require(pathToLinterJS);\n\npatchClass(Linter, LinterPatch);\n"]}
|
||||
4
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/path-utils.d.ts
generated
vendored
Normal file
4
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/path-utils.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
export declare function findAndConsoleLogPatchPathCli(): void;
|
||||
export declare function getPathToLinterJS(): string;
|
||||
export declare function ensurePathToGeneratedPatch(): string;
|
||||
//# sourceMappingURL=path-utils.d.ts.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/path-utils.d.ts.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/path-utils.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../../src/eslint-bulk-suppressions/path-utils.ts"],"names":[],"mappings":"AAgBA,wBAAgB,6BAA6B,IAAI,IAAI,CAqBpD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAM1C;AAED,wBAAgB,0BAA0B,IAAI,MAAM,CAKnD"}
|
||||
48
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/path-utils.js
generated
vendored
Normal file
48
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/path-utils.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
// See LICENSE in the project root for license information.
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.findAndConsoleLogPatchPathCli = findAndConsoleLogPatchPathCli;
|
||||
exports.getPathToLinterJS = getPathToLinterJS;
|
||||
exports.ensurePathToGeneratedPatch = ensurePathToGeneratedPatch;
|
||||
const fs_1 = __importDefault(require("fs"));
|
||||
const os_1 = __importDefault(require("os"));
|
||||
const _patch_base_1 = require("../_patch-base");
|
||||
const constants_1 = require("./constants");
|
||||
const package_json_1 = __importDefault(require("../../package.json"));
|
||||
const CURRENT_PACKAGE_VERSION = package_json_1.default.version;
|
||||
function findAndConsoleLogPatchPathCli() {
|
||||
const eslintBulkDetectEnvVarValue = process.env[constants_1.ESLINT_BULK_DETECT_ENV_VAR_NAME];
|
||||
if (eslintBulkDetectEnvVarValue !== 'true' && eslintBulkDetectEnvVarValue !== '1') {
|
||||
return;
|
||||
}
|
||||
const startDelimiter = 'RUSHSTACK_ESLINT_BULK_START';
|
||||
const endDelimiter = 'RUSHSTACK_ESLINT_BULK_END';
|
||||
const configuration = {
|
||||
/**
|
||||
* `@rushstack/eslint-bulk` should report an error if its package.json is older than this number
|
||||
*/
|
||||
minCliVersion: '0.0.0',
|
||||
/**
|
||||
* `@rushstack/eslint-bulk` will invoke this entry point
|
||||
*/
|
||||
cliEntryPoint: require.resolve('../exports/eslint-bulk')
|
||||
};
|
||||
console.log(startDelimiter + JSON.stringify(configuration) + endDelimiter);
|
||||
}
|
||||
function getPathToLinterJS() {
|
||||
if (!_patch_base_1.eslintFolder) {
|
||||
throw new Error('Cannot find ESLint installation to patch.');
|
||||
}
|
||||
return `${_patch_base_1.eslintFolder}/lib/linter/linter.js`;
|
||||
}
|
||||
function ensurePathToGeneratedPatch() {
|
||||
const patchesFolderPath = `${os_1.default.tmpdir()}/rushstack-eslint-bulk-${CURRENT_PACKAGE_VERSION}/patches`;
|
||||
fs_1.default.mkdirSync(patchesFolderPath, { recursive: true });
|
||||
const pathToGeneratedPatch = `${patchesFolderPath}/linter-patch-v${_patch_base_1.eslintPackageVersion}.js`;
|
||||
return pathToGeneratedPatch;
|
||||
}
|
||||
//# sourceMappingURL=path-utils.js.map
|
||||
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/path-utils.js.map
generated
vendored
Normal file
1
frontend/webapp/node_modules/@rushstack/eslint-patch/lib/eslint-bulk-suppressions/path-utils.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../../src/eslint-bulk-suppressions/path-utils.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;AAe3D,sEAqBC;AAED,8CAMC;AAED,gEAKC;AAjDD,4CAAoB;AACpB,4CAAoB;AACpB,gDAAoE;AACpE,2CAA8D;AAC9D,sEAAoD;AAOpD,MAAM,uBAAuB,GAAW,sBAAkB,CAAC,OAAO,CAAC;AAEnE,SAAgB,6BAA6B;IAC3C,MAAM,2BAA2B,GAAuB,OAAO,CAAC,GAAG,CAAC,2CAA+B,CAAC,CAAC;IACrG,IAAI,2BAA2B,KAAK,MAAM,IAAI,2BAA2B,KAAK,GAAG,EAAE,CAAC;QAClF,OAAO;IACT,CAAC;IAED,MAAM,cAAc,GAAW,6BAA6B,CAAC;IAC7D,MAAM,YAAY,GAAW,2BAA2B,CAAC;IAEzD,MAAM,aAAa,GAAmB;QACpC;;WAEG;QACH,aAAa,EAAE,OAAO;QACtB;;WAEG;QACH,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC;KACzD,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,YAAY,CAAC,CAAC;AAC7E,CAAC;AAED,SAAgB,iBAAiB;IAC/B,IAAI,CAAC,0BAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,GAAG,0BAAY,uBAAuB,CAAC;AAChD,CAAC;AAED,SAAgB,0BAA0B;IACxC,MAAM,iBAAiB,GAAW,GAAG,YAAE,CAAC,MAAM,EAAE,0BAA0B,uBAAuB,UAAU,CAAC;IAC5G,YAAE,CAAC,SAAS,CAAC,iBAAiB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACrD,MAAM,oBAAoB,GAAW,GAAG,iBAAiB,kBAAkB,kCAAoB,KAAK,CAAC;IACrG,OAAO,oBAAoB,CAAC;AAC9B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport fs from 'fs';\nimport os from 'os';\nimport { eslintFolder, eslintPackageVersion } from '../_patch-base';\nimport { ESLINT_BULK_DETECT_ENV_VAR_NAME } from './constants';\nimport currentPackageJson from '../../package.json';\n\ninterface IConfiguration {\n minCliVersion: string;\n cliEntryPoint: string;\n}\n\nconst CURRENT_PACKAGE_VERSION: string = currentPackageJson.version;\n\nexport function findAndConsoleLogPatchPathCli(): void {\n const eslintBulkDetectEnvVarValue: string | undefined = process.env[ESLINT_BULK_DETECT_ENV_VAR_NAME];\n if (eslintBulkDetectEnvVarValue !== 'true' && eslintBulkDetectEnvVarValue !== '1') {\n return;\n }\n\n const startDelimiter: string = 'RUSHSTACK_ESLINT_BULK_START';\n const endDelimiter: string = 'RUSHSTACK_ESLINT_BULK_END';\n\n const configuration: IConfiguration = {\n /**\n * `@rushstack/eslint-bulk` should report an error if its package.json is older than this number\n */\n minCliVersion: '0.0.0',\n /**\n * `@rushstack/eslint-bulk` will invoke this entry point\n */\n cliEntryPoint: require.resolve('../exports/eslint-bulk')\n };\n\n console.log(startDelimiter + JSON.stringify(configuration) + endDelimiter);\n}\n\nexport function getPathToLinterJS(): string {\n if (!eslintFolder) {\n throw new Error('Cannot find ESLint installation to patch.');\n }\n\n return `${eslintFolder}/lib/linter/linter.js`;\n}\n\nexport function ensurePathToGeneratedPatch(): string {\n const patchesFolderPath: string = `${os.tmpdir()}/rushstack-eslint-bulk-${CURRENT_PACKAGE_VERSION}/patches`;\n fs.mkdirSync(patchesFolderPath, { recursive: true });\n const pathToGeneratedPatch: string = `${patchesFolderPath}/linter-patch-v${eslintPackageVersion}.js`;\n return pathToGeneratedPatch;\n}\n"]}
|
||||
Reference in New Issue
Block a user