Skip to content

Commit

Permalink
Update dependencies (#2757)
Browse files Browse the repository at this point in the history
Co-authored-by: Tibor Blenessy <tibor.blenessy@sonarsource.com>
  • Loading branch information
vilchik-elena and saberduck committed Aug 13, 2021
1 parent 02f1309 commit 2390015
Show file tree
Hide file tree
Showing 27 changed files with 2,550 additions and 3,096 deletions.
26 changes: 13 additions & 13 deletions eslint-bridge/package.json
Expand Up @@ -26,9 +26,9 @@
},
"devDependencies": {
"@types/bytes": "3.1.0",
"@types/eslint": "7.2.6",
"@types/eslint-scope": "3.7.0",
"@types/estree": "0.0.46",
"@types/eslint": "7.28.0",
"@types/eslint-scope": "3.7.1",
"@types/estree": "0.0.50",
"@types/express": "4.17.11",
"@types/jest": "26.0.22",
"@types/node": "14.14.41",
Expand All @@ -40,23 +40,23 @@
"ts-node": "9.1.1"
},
"dependencies": {
"@babel/core": "7.13.15",
"@babel/eslint-parser": "7.13.14",
"@babel/core": "7.15.0",
"@babel/eslint-parser": "7.15.0",
"@babel/preset-env": "7.15.0",
"@babel/preset-flow": "7.13.13",
"@babel/preset-react": "7.13.13",
"@typescript-eslint/eslint-plugin": "4.26.0",
"@typescript-eslint/experimental-utils": "4.26.0",
"@typescript-eslint/parser": "4.26.0",
"@babel/preset-flow": "7.14.5",
"@babel/preset-react": "7.14.5",
"@typescript-eslint/eslint-plugin": "4.29.1",
"@typescript-eslint/experimental-utils": "4.29.1",
"@typescript-eslint/parser": "4.29.1",
"builtin-modules": "3.2.0",
"bytes": "3.1.0",
"eslint": "7.27.0",
"eslint-plugin-chai-friendly": "0.6.0",
"eslint": "7.32.0",
"eslint-plugin-chai-friendly": "0.7.2",
"eslint-plugin-sonarjs": "0.10.0-290",
"express": "4.17.1",
"regexpp": "3.2.0",
"run-node": "2.0.0",
"typescript": "4.3.2",
"typescript": "4.3.5",
"vue-eslint-parser": "7.6.0"
},
"bundledDependencies": [
Expand Down
8 changes: 8 additions & 0 deletions eslint-bridge/src/linter.ts
Expand Up @@ -214,6 +214,14 @@ function sanitizeTypeScriptESLintRule(rule: ESLintRule.RuleModule): ESLintRule.R
parserOptions: originalContext.parserOptions,
parserServices: originalContext.parserServices,

getCwd(): string {
return originalContext.getCwd();
},

getPhysicalFilename(): string {
return originalContext.getPhysicalFilename();
},

getAncestors() {
return originalContext.getAncestors();
},
Expand Down
2 changes: 1 addition & 1 deletion eslint-bridge/src/rules/no-invariant-returns.ts
Expand Up @@ -43,7 +43,7 @@ interface SingleWriteVariable {
initExpression?: estree.Expression | null;
}

type LiteralValue = number | RegExp | string | null | boolean;
type LiteralValue = number | RegExp | string | null | boolean | bigint;

export const rule: Rule.RuleModule = {
meta: {
Expand Down
7 changes: 5 additions & 2 deletions eslint-bridge/src/rules/os-command.ts
Expand Up @@ -63,7 +63,7 @@ function checkCallExpression(

function checkOSCommand(
moduleName: estree.Literal | undefined,
callee: estree.Expression,
callee: estree.Expression | estree.PrivateIdentifier,
args: Argument[],
context: Rule.RuleContext,
) {
Expand All @@ -75,7 +75,10 @@ function checkOSCommand(
}
}

function isQuestionable(expression: estree.Expression, [command, ...otherArguments]: Argument[]) {
function isQuestionable(
expression: estree.Expression | estree.PrivateIdentifier,
[command, ...otherArguments]: Argument[],
) {
// if command is hardcoded => no issue
if (!command || command.type === 'Literal') {
return false;
Expand Down
4 changes: 2 additions & 2 deletions eslint-bridge/src/rules/sockets.ts
Expand Up @@ -44,7 +44,7 @@ export const rule: Rule.RuleModule = {

function checkCallExpression({ callee, type }: estree.CallExpression, context: Rule.RuleContext) {
let moduleName;
let expression: estree.Expression | undefined;
let expression: estree.Expression | estree.PrivateIdentifier | undefined;
if (callee.type === 'MemberExpression' && callee.object.type === 'Identifier') {
moduleName = getModuleNameOfIdentifier(context, callee.object);
expression = callee.property;
Expand All @@ -61,7 +61,7 @@ function checkCallExpression({ callee, type }: estree.CallExpression, context: R
}

function isQuestionable(
expression: estree.Expression,
expression: estree.Expression | estree.PrivateIdentifier,
isConstructor: boolean,
moduleName?: estree.Literal,
) {
Expand Down
2 changes: 1 addition & 1 deletion eslint-bridge/src/rules/xpath.ts
Expand Up @@ -92,7 +92,7 @@ function checkCallExpression(
}
function getModuleAndCalledMethod(callee: estree.Node, context: Rule.RuleContext) {
let moduleName;
let expression: estree.Expression | undefined;
let expression: estree.Expression | estree.PrivateIdentifier | undefined;

if (callee.type === 'MemberExpression' && callee.object.type === 'Identifier') {
moduleName = getModuleNameOfIdentifier(context, callee.object);
Expand Down
8 changes: 8 additions & 0 deletions eslint-bridge/src/utils/utils-decorator.ts
Expand Up @@ -47,6 +47,14 @@ export function interceptReport(
parserOptions: originalContext.parserOptions,
parserServices: originalContext.parserServices,

getCwd(): string {
return originalContext.getCwd();
},

getPhysicalFilename(): string {
return originalContext.getPhysicalFilename();
},

getAncestors() {
return originalContext.getAncestors();
},
Expand Down
5 changes: 5 additions & 0 deletions eslint-bridge/tests/rules/no-reference-error.test.ts
Expand Up @@ -130,6 +130,11 @@ ruleTester.run('Variables should be defined before being used', rule, {
`,
errors: 1,
},
{
// even if we report on `_` in unit test here, in real analysis it should not happen as `_` is set as a default global
code: `_.foo();`,
errors: 1,
},
],
});

Expand Down

0 comments on commit 2390015

Please sign in to comment.