From 8f58cd77d8fb0f0d31ab14a9e5762eea438d01ee Mon Sep 17 00:00:00 2001 From: Tibor Blenessy Date: Fri, 12 Feb 2021 17:01:20 +0100 Subject: [PATCH] Revert "Use @babel/eslint-parser instead of babel-eslint (#2487)" (#2492) This reverts commit ca567460 --- eslint-bridge/package.json | 10 +- eslint-bridge/src/parser.ts | 33 ++--- eslint-bridge/tests/parser.test.ts | 19 ++- .../declarations-in-global-scope.test.ts | 8 +- .../tests/rules/no-dead-store.test.ts | 8 +- .../tests/rules/no-globals-shadowing.test.ts | 5 +- .../tests/rules/no-unused-expressions.test.ts | 9 +- .../tests/rules/unused-import.test.ts | 6 +- .../tests/utils/babel-rule-tester.ts | 29 ---- .../index.d.ts | 2 +- eslint-bridge/yarn.lock | 124 +++--------------- .../expected/js/jshint/javascript-S125.json | 1 + .../expected/js/jshint/javascript-S2260.json | 2 +- 13 files changed, 65 insertions(+), 191 deletions(-) delete mode 100644 eslint-bridge/tests/utils/babel-rule-tester.ts rename eslint-bridge/typings/{@babel__eslint-parser => babel-eslint}/index.d.ts (89%) diff --git a/eslint-bridge/package.json b/eslint-bridge/package.json index 6e231a04823..8bbb089d75f 100644 --- a/eslint-bridge/package.json +++ b/eslint-bridge/package.json @@ -40,13 +40,10 @@ "ts-node": "9.0.0" }, "dependencies": { - "@babel/core": "7.12.13", - "@babel/eslint-parser": "7.12.13", - "@babel/preset-flow": "^7.12.13", - "@babel/preset-react": "^7.12.13", "@typescript-eslint/eslint-plugin": "4.15.0", "@typescript-eslint/experimental-utils": "4.15.0", "@typescript-eslint/parser": "4.15.0", + "babel-eslint": "10.1.0", "body-parser": "1.18.3", "builtin-modules": "3.1.0", "bytes": "3.1.0", @@ -62,10 +59,7 @@ "@typescript-eslint/eslint-plugin", "@typescript-eslint/experimental-utils", "@typescript-eslint/parser", - "@babel/core", - "@babel/eslint-parser", - "@babel/preset-flow", - "@babel/preset-react", + "babel-eslint", "body-parser", "builtin-modules", "bytes", diff --git a/eslint-bridge/src/parser.ts b/eslint-bridge/src/parser.ts index 4b36692f693..a3f951e6093 100644 --- a/eslint-bridge/src/parser.ts +++ b/eslint-bridge/src/parser.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import * as babel from '@babel/eslint-parser'; +import * as babel from 'babel-eslint'; import { Linter, SourceCode } from 'eslint'; import { ParsingError } from './analyzer'; import * as VueJS from 'vue-eslint-parser'; @@ -68,7 +68,7 @@ export function parseJavaScriptSourceFile( let exceptionToReport: ParseException | null = null; for (const config of [PARSER_CONFIG_MODULE, PARSER_CONFIG_SCRIPT]) { - const result = parse(babel.parseForESLint, babelConfig(config), fileContent); + const result = parse(babel.parseForESLint, config, fileContent); if (result instanceof SourceCode) { return result; } else if (!exceptionToReport) { @@ -119,19 +119,16 @@ export function parseVueSourceFile( tsConfigs?: string[], ): SourceCode | ParsingError { let exception: ParseException | null = null; - const parserOptions = { - filePath, - project: tsConfigs, - extraFileExtensions: ['.vue'], - ...PARSER_CONFIG_MODULE, - }; - const parsers = [ - { parser: '@typescript-eslint/parser', parserOptions }, - { parser: '@babel/eslint-parser', parserOptions: babelConfig(parserOptions) }, - ]; - for (const { parser, parserOptions } of parsers) { + const parsers = ['@typescript-eslint/parser', 'babel-eslint']; + for (const parser of parsers) { try { - const result = VueJS.parseForESLint(fileContent, { parser, ...parserOptions }); + const result = VueJS.parseForESLint(fileContent, { + filePath, + parser, + project: tsConfigs, + extraFileExtensions: ['.vue'], + ...PARSER_CONFIG_MODULE, + }); return new SourceCode(({ ...result, parserServices: result.services, @@ -191,11 +188,3 @@ export function parseExceptionCodeOf(exceptionMsg: string): ParseExceptionCode { return ParseExceptionCode.Parsing; } } - -export function babelConfig(config: Linter.ParserOptions) { - const pluginPath = `${__dirname}/../node_modules`; - const babelOptions = { - presets: [`${pluginPath}/@babel/preset-react`, `${pluginPath}/@babel/preset-flow`], - }; - return { ...config, requireConfigFile: false, babelOptions }; -} diff --git a/eslint-bridge/tests/parser.test.ts b/eslint-bridge/tests/parser.test.ts index 30cfcc83528..4f58fe797b5 100644 --- a/eslint-bridge/tests/parser.test.ts +++ b/eslint-bridge/tests/parser.test.ts @@ -27,15 +27,14 @@ import { parseVueSourceFile, ParseExceptionCode, parseExceptionCodeOf, - babelConfig, -} from 'parser'; -import * as babel from '@babel/eslint-parser'; +} from '../src/parser'; +import * as babel from 'babel-eslint'; import { SourceCode } from 'eslint'; -import { ParsingError } from 'analyzer'; +import { ParsingError } from '../src/analyzer'; import visit from '../src/utils/visitor'; import * as path from 'path'; import * as fs from 'fs'; -import { setContext } from 'context'; +import { setContext } from '../src/context'; describe('parseJavaScriptSourceFile', () => { beforeEach(() => { @@ -281,7 +280,7 @@ describe('parseVueSourceFile', () => { ) as ParsingError; expect(parsingError).toBeDefined(); expect(parsingError.line).toEqual(4); - expect(parsingError.message).toContain('Unexpected token (3:4)'); + expect(parsingError.message).toEqual('Unexpected token (3:4)'); expect(parsingError.code).toEqual(ParseExceptionCode.Parsing); }); @@ -335,13 +334,13 @@ function expectToNotParse(code: string, message: string) { const parsingError = parseJavaScriptSourceFile(code, 'foo.js') as ParsingError; expect(parsingError).toBeDefined(); expect(parsingError.line).toEqual(1); - expect(parsingError.message).toContain(message); + expect(parsingError.message).toEqual(message); } function expectToParseInNonStrictMode(code: string, msgInStrictMode: string) { - const result1 = parse(babel.parse, babelConfig(PARSER_CONFIG_MODULE), code); - expect((result1 as ParseException).message).toContain(msgInStrictMode); + const result1 = parse(babel.parse, PARSER_CONFIG_MODULE, code); + expect((result1 as ParseException).message).toEqual(msgInStrictMode); - const result2 = parse(babel.parse, babelConfig(PARSER_CONFIG_SCRIPT), code); + const result2 = parse(babel.parse, PARSER_CONFIG_SCRIPT, code); expect((result2 as SourceCode).ast.body.length).toBeGreaterThan(0); } diff --git a/eslint-bridge/tests/rules/declarations-in-global-scope.test.ts b/eslint-bridge/tests/rules/declarations-in-global-scope.test.ts index 618ec2ca962..2f8ab7cd930 100644 --- a/eslint-bridge/tests/rules/declarations-in-global-scope.test.ts +++ b/eslint-bridge/tests/rules/declarations-in-global-scope.test.ts @@ -18,8 +18,6 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { RuleTester } from 'eslint'; -import { rule } from 'rules/declarations-in-global-scope'; -import { babelRuleTester } from '../utils/babel-rule-tester'; const tsParserPath = require.resolve('@typescript-eslint/parser'); const ruleTester = new RuleTester({ @@ -38,7 +36,11 @@ const ruleTesterScript = new RuleTester({ parserOptions: { ecmaVersion: 2018, sourceType: 'script' }, }); -const ruleTesterBabel = babelRuleTester(); +const ruleTesterBabel = new RuleTester({ + parser: require.resolve('babel-eslint'), +}); + +import { rule } from 'rules/declarations-in-global-scope'; ruleTester.run('Variables and functions should not be declared in the global scope', rule, { valid: [ diff --git a/eslint-bridge/tests/rules/no-dead-store.test.ts b/eslint-bridge/tests/rules/no-dead-store.test.ts index e285bb2364f..40350b270be 100644 --- a/eslint-bridge/tests/rules/no-dead-store.test.ts +++ b/eslint-bridge/tests/rules/no-dead-store.test.ts @@ -18,10 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { rule } from 'rules/no-dead-store'; +import { RuleTester } from 'eslint'; import { RuleTesterTs } from '../RuleTesterTs'; -import { babelRuleTester } from '../utils/babel-rule-tester'; -const ruleTester = babelRuleTester(); +const ruleTester = new RuleTester({ + // we use babel to parse JSX syntax + parser: require.resolve('babel-eslint'), + parserOptions: { ecmaVersion: 2018, sourceType: 'module' }, +}); const valid = [ { diff --git a/eslint-bridge/tests/rules/no-globals-shadowing.test.ts b/eslint-bridge/tests/rules/no-globals-shadowing.test.ts index fc380c847c7..5ce54c299aa 100644 --- a/eslint-bridge/tests/rules/no-globals-shadowing.test.ts +++ b/eslint-bridge/tests/rules/no-globals-shadowing.test.ts @@ -28,7 +28,6 @@ const ruleTester = new RuleTester({ }); import { rule } from 'rules/no-globals-shadowing'; -import { babelRuleTester } from '../utils/babel-rule-tester'; ruleTester.run('Special identifiers should not be bound or assigned', rule, { valid: [ @@ -197,7 +196,9 @@ ruleTester.run('Special identifiers should not be bound or assigned', rule, { ], }); -const ruleTesterBabel = babelRuleTester(); +const ruleTesterBabel = new RuleTester({ + parser: require.resolve('babel-eslint'), +}); ruleTesterBabel.run('Special identifiers should not be bound or assigned', rule, { valid: [ diff --git a/eslint-bridge/tests/rules/no-unused-expressions.test.ts b/eslint-bridge/tests/rules/no-unused-expressions.test.ts index f77c38001d8..aeca17f52a1 100644 --- a/eslint-bridge/tests/rules/no-unused-expressions.test.ts +++ b/eslint-bridge/tests/rules/no-unused-expressions.test.ts @@ -130,25 +130,22 @@ ruleTester.run('Disallow unused expressions', rule, { }); import { rules as chaiFriendlyRules } from 'eslint-plugin-chai-friendly'; -import { babelConfig } from 'parser'; -for (let { parser, languageSpecificRule, parserOptions } of [ +for (let { parser, languageSpecificRule } of [ { parser: '@typescript-eslint/parser', languageSpecificRule: decorateTypescriptEslint( require('@typescript-eslint/eslint-plugin').rules!['no-unused-expressions'], ), - parserOptions: { ecmaVersion: 2018 }, }, { - parser: '@babel/eslint-parser', + parser: 'babel-eslint', languageSpecificRule: decorateJavascriptEslint(chaiFriendlyRules['no-unused-expressions']), - parserOptions: babelConfig({ ecmaVersion: 2018 }), }, ]) { const tester = new RuleTester({ parser: require.resolve(parser), - parserOptions, + parserOptions: { ecmaVersion: 2018 }, }); tester.run(`Disallow unused expressions - negations & IIFE (${parser})`, languageSpecificRule, { diff --git a/eslint-bridge/tests/rules/unused-import.test.ts b/eslint-bridge/tests/rules/unused-import.test.ts index b45be4187eb..09df70d6acb 100644 --- a/eslint-bridge/tests/rules/unused-import.test.ts +++ b/eslint-bridge/tests/rules/unused-import.test.ts @@ -19,9 +19,11 @@ */ import { RuleTester } from 'eslint'; import { rule } from 'rules/unused-import'; -import { babelRuleTester } from '../utils/babel-rule-tester'; -const ruleTesterJS = babelRuleTester(); +const ruleTesterJS = new RuleTester({ + parserOptions: { ecmaVersion: 2018, sourceType: 'module' }, + parser: require.resolve('babel-eslint'), +}); ruleTesterJS.run('Unnecessary imports should be removed', rule, { valid: [ diff --git a/eslint-bridge/tests/utils/babel-rule-tester.ts b/eslint-bridge/tests/utils/babel-rule-tester.ts deleted file mode 100644 index 001c0b3161a..00000000000 --- a/eslint-bridge/tests/utils/babel-rule-tester.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { RuleTester } from 'eslint'; -import { babelConfig } from 'parser'; - -export function babelRuleTester() { - return new RuleTester({ - // we use babel to parse JSX syntax - parser: require.resolve('@babel/eslint-parser'), - parserOptions: babelConfig({ ecmaVersion: 2018, sourceType: 'module' }), - }); -} diff --git a/eslint-bridge/typings/@babel__eslint-parser/index.d.ts b/eslint-bridge/typings/babel-eslint/index.d.ts similarity index 89% rename from eslint-bridge/typings/@babel__eslint-parser/index.d.ts rename to eslint-bridge/typings/babel-eslint/index.d.ts index e365f350c12..690c6904ce5 100644 --- a/eslint-bridge/typings/@babel__eslint-parser/index.d.ts +++ b/eslint-bridge/typings/babel-eslint/index.d.ts @@ -1,4 +1,4 @@ -declare module "@babel/eslint-parser" { +declare module "babel-eslint" { import { AST, Linter, Scope, SourceCode } from "eslint"; function parse(input: string, config?: Linter.ParserOptions): AST.Program; function parseForESLint(input: string, config?: Linter.ParserOptions): { ast: AST.Program, parserServices: SourceCode.ParserServices, scopeManager: Scope.ScopeManager, visitorKeys: SourceCode.VisitorKeys }; diff --git a/eslint-bridge/yarn.lock b/eslint-bridge/yarn.lock index 146f8494ef4..e139497d122 100644 --- a/eslint-bridge/yarn.lock +++ b/eslint-bridge/yarn.lock @@ -9,7 +9,7 @@ dependencies: "@babel/highlight" "^7.12.13" -"@babel/core@7.12.13", "@babel/core@^7.1.0", "@babel/core@^7.7.5": +"@babel/core@^7.1.0", "@babel/core@^7.7.5": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.13.tgz#b73a87a3a3e7d142a66248bf6ad88b9ceb093425" integrity sha512-BQKE9kXkPlXHPeqissfxo0lySWJcYdEP0hdtJOH/iJfDdhOCcgtNCjftCJg3qqauB4h+lz2N6ixM++b9DN1Tcw== @@ -30,15 +30,6 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/eslint-parser@7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.12.13.tgz#f3158c28ed9eecd95fb75ee3015033b8b3b869b2" - integrity sha512-+VF2M8ZWXc2KVf6L0tFcv6w8IZkCc1rvN65oj6hXxhYtOanlCA6ONpgEdy/HVGmcogu4El4ohdzuyfWYxSsKow== - dependencies: - eslint-scope "5.1.0" - eslint-visitor-keys "^1.3.0" - semver "^6.3.0" - "@babel/generator@^7.12.13": version "7.12.15" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.15.tgz#4617b5d0b25cc572474cc1aafee1edeaf9b5368f" @@ -48,13 +39,6 @@ jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.10.4", "@babel/helper-annotate-as-pure@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz#0f58e86dfc4bb3b1fcd7db806570e177d439b6ab" - integrity sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw== - dependencies: - "@babel/types" "^7.12.13" - "@babel/helper-function-name@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz#93ad656db3c3c2232559fd7b2c3dbdcbe0eb377a" @@ -159,7 +143,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.13": +"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.7.0": version "7.12.15" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.15.tgz#2b20de7f0b4b332d9b119dd9c33409c538b8aacf" integrity sha512-AQBOU2Z9kWwSZMd6lNjCX0GUgFonL1wAM1db8L8PMk9UDaGsRCArBkU4Sc+UCM3AE4hjbXx+h58Lb3QT4oRmrA== @@ -185,13 +169,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-syntax-flow@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.12.13.tgz#5df9962503c0a9c918381c929d51d4d6949e7e86" - integrity sha512-J/RYxnlSLXZLVR7wTRsozxKT8qbsx1mNKJzXEEjQ0Kjx1ZACcyHgbanNWNCFtc36IzuWhYWPpvJFFoexoOWFmA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - "@babel/plugin-syntax-import-meta@^7.8.3": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" @@ -206,13 +183,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.13.tgz#044fb81ebad6698fe62c478875575bcbb9b70f15" - integrity sha512-d4HM23Q1K7oq/SLNmG6mRt85l2csmQ0cHRaxRXjKW0YFdEXqlZ5kzFQKH5Uc3rDJECgu+yCRgPkG04Mm98R/1g== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" @@ -262,66 +232,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-flow-strip-types@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.12.13.tgz#b439c43116dc60fb45b7efd2e1db91897b7c8f4b" - integrity sha512-39/t9HtN+Jlc7EEY6oCSCf3kRrKIl2JULOGPnHZiaRjoYZEFaDXDZI32uE2NosQRh8o6N9B+8iGvDK7ToJhJaw== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - "@babel/plugin-syntax-flow" "^7.12.13" - -"@babel/plugin-transform-react-display-name@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.12.13.tgz#c28effd771b276f4647411c9733dbb2d2da954bd" - integrity sha512-MprESJzI9O5VnJZrL7gg1MpdqmiFcUv41Jc7SahxYsNP2kDkFqClxxTZq+1Qv4AFCamm+GXMRDQINNn+qrxmiA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-transform-react-jsx-development@^7.12.12": - version "7.12.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.12.12.tgz#bccca33108fe99d95d7f9e82046bfe762e71f4e7" - integrity sha512-i1AxnKxHeMxUaWVXQOSIco4tvVvvCxMSfeBMnMM06mpaJt3g+MpxYQQrDfojUQldP1xxraPSJYSMEljoWM/dCg== - dependencies: - "@babel/plugin-transform-react-jsx" "^7.12.12" - -"@babel/plugin-transform-react-jsx@^7.12.12", "@babel/plugin-transform-react-jsx@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.12.13.tgz#6c9f993b9f6fb6f0e32a4821ed59349748576a3e" - integrity sha512-hhXZMYR8t9RvduN2uW4sjl6MRtUhzNE726JvoJhpjhxKgRUVkZqTsA0xc49ALZxQM7H26pZ/lLvB2Yrea9dllA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.12.13" - "@babel/helper-module-imports" "^7.12.13" - "@babel/helper-plugin-utils" "^7.12.13" - "@babel/plugin-syntax-jsx" "^7.12.13" - "@babel/types" "^7.12.13" - -"@babel/plugin-transform-react-pure-annotations@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.12.1.tgz#05d46f0ab4d1339ac59adf20a1462c91b37a1a42" - integrity sha512-RqeaHiwZtphSIUZ5I85PEH19LOSzxfuEazoY7/pWASCAIBuATQzpSVD+eT6MebeeZT2F4eSL0u4vw6n4Nm0Mjg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/preset-flow@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.12.13.tgz#71ee7fe65a95b507ac12bcad65a4ced27d8dfc3e" - integrity sha512-gcEjiwcGHa3bo9idURBp5fmJPcyFPOszPQjztXrOjUE2wWVqc6fIVJPgWPIQksaQ5XZ2HWiRsf2s1fRGVjUtVw== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - "@babel/plugin-transform-flow-strip-types" "^7.12.13" - -"@babel/preset-react@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.12.13.tgz#5f911b2eb24277fa686820d5bd81cad9a0602a0a" - integrity sha512-TYM0V9z6Abb6dj1K7i5NrEhA13oS5ujUYQYDfqIBXYHOc2c2VkFgc+q9kyssIyUfy4/hEwqrgSlJ/Qgv8zJLsA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - "@babel/plugin-transform-react-display-name" "^7.12.13" - "@babel/plugin-transform-react-jsx" "^7.12.13" - "@babel/plugin-transform-react-jsx-development" "^7.12.12" - "@babel/plugin-transform-react-pure-annotations" "^7.12.1" - "@babel/template@^7.12.13", "@babel/template@^7.3.3": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" @@ -331,7 +241,7 @@ "@babel/parser" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.13": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.13", "@babel/traverse@^7.7.0": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.13.tgz#689f0e4b4c08587ad26622832632735fb8c4e0c0" integrity sha512-3Zb4w7eE/OslI0fTp8c7b286/cQps3+vdLW3UcwC8VSJC6GbKn55aeVVu2QJNuCDoeKyptLOFrPq8WqZZBodyA== @@ -346,7 +256,7 @@ globals "^11.1.0" lodash "^4.17.19" -"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.3.0", "@babel/types@^7.3.3": +"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.7.0": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.13.tgz#8be1aa8f2c876da11a9cf650c0ecf656913ad611" integrity sha512-oKrdZTld2im1z8bDwTOQvUbxKwE+854zc16qWZQlcTqMN00pWxHQ4ZeOq0yDMnisOpRykH2/5Qqcrk/OlbAjiQ== @@ -1080,6 +990,18 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== +babel-eslint@10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" + integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" + eslint-visitor-keys "^1.0.0" + resolve "^1.12.0" + babel-jest@^26.6.3: version "26.6.3" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.6.3.tgz#d87d25cb0037577a0c89f82e5755c5d293c01056" @@ -1726,14 +1648,6 @@ eslint-plugin-sonarjs@0.5.0: resolved "https://registry.yarnpkg.com/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.5.0.tgz#ce17b2daba65a874c2862213a9e38e8986ad7d7d" integrity sha512-XW5MnzlRjhXpIdbULC/qAdJYHWw3rRLws/DyawdlPU/IdVr9AmRK1r2LaCvabwKOAW2XYYSo3kDX58E4MrB7PQ== -eslint-scope@5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5" - integrity sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w== - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - eslint-scope@^5.0.0, eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" @@ -1749,7 +1663,7 @@ eslint-utils@^2.0.0, eslint-utils@^2.1.0: dependencies: eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== @@ -1832,7 +1746,7 @@ esquery@^1.0.1, esquery@^1.2.0: dependencies: estraverse "^5.1.0" -esrecurse@^4.1.0, esrecurse@^4.3.0: +esrecurse@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== @@ -3933,7 +3847,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.10.0, resolve@^1.18.1: +resolve@^1.10.0, resolve@^1.12.0, resolve@^1.18.1: version "1.19.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== diff --git a/its/ruling/src/test/expected/js/jshint/javascript-S125.json b/its/ruling/src/test/expected/js/jshint/javascript-S125.json index 0b6c29cf61e..92bb1ef5b13 100644 --- a/its/ruling/src/test/expected/js/jshint/javascript-S125.json +++ b/its/ruling/src/test/expected/js/jshint/javascript-S125.json @@ -1,6 +1,7 @@ { 'jshint:src/jshint.js':[ 5096, +5525, ], 'jshint:tests/unit/core.js':[ 1080, diff --git a/its/ruling/src/test/expected/js/jshint/javascript-S2260.json b/its/ruling/src/test/expected/js/jshint/javascript-S2260.json index 36e0d963012..4a0929bd934 100644 --- a/its/ruling/src/test/expected/js/jshint/javascript-S2260.json +++ b/its/ruling/src/test/expected/js/jshint/javascript-S2260.json @@ -33,7 +33,7 @@ 9, ], 'jshint:tests/unit/fixtures/switchFallThrough.js':[ -40, +41, ], 'jshint:tests/unit/fixtures/yield-expressions.js':[ 23,