From 5193e5772b2c7d2d6321426dbfa108b6906bafc0 Mon Sep 17 00:00:00 2001 From: Viktor Vorona Date: Tue, 6 Feb 2024 15:34:53 +0100 Subject: SONAR-21571 typescript-eslint update --- .../__tests__/no-implicit-coercion-test.js | 6 ++++-- .../eslint-local-rules/test-config/react.tsx | 19 +++++++++++++++++++ .../eslint-local-rules/test-config/tsconfig.json | 4 ++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 server/sonar-web/eslint-local-rules/test-config/react.tsx create mode 100644 server/sonar-web/eslint-local-rules/test-config/tsconfig.json (limited to 'server/sonar-web/eslint-local-rules') diff --git a/server/sonar-web/eslint-local-rules/__tests__/no-implicit-coercion-test.js b/server/sonar-web/eslint-local-rules/__tests__/no-implicit-coercion-test.js index 73d39028730..da9990d7aad 100644 --- a/server/sonar-web/eslint-local-rules/__tests__/no-implicit-coercion-test.js +++ b/server/sonar-web/eslint-local-rules/__tests__/no-implicit-coercion-test.js @@ -17,11 +17,13 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -const { RuleTester } = require('eslint'); -const noImplicitCoercion = require('../no-implicit-coercion'); +import { RuleTester } from '@typescript-eslint/rule-tester'; +import noImplicitCoercion from '../no-implicit-coercion'; const ruleTester = new RuleTester({ parserOptions: { + project: './tsconfig.json', + tsconfigRootDir: __dirname + '/../test-config', ecmaFeatures: { jsx: true, }, diff --git a/server/sonar-web/eslint-local-rules/test-config/react.tsx b/server/sonar-web/eslint-local-rules/test-config/react.tsx new file mode 100644 index 00000000000..5e9942f478f --- /dev/null +++ b/server/sonar-web/eslint-local-rules/test-config/react.tsx @@ -0,0 +1,19 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 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. + */ diff --git a/server/sonar-web/eslint-local-rules/test-config/tsconfig.json b/server/sonar-web/eslint-local-rules/test-config/tsconfig.json new file mode 100644 index 00000000000..d8d83231bd7 --- /dev/null +++ b/server/sonar-web/eslint-local-rules/test-config/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base", + "include": ["./react.tsx"] +} -- cgit v1.2.3