aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/eslint-local-rules
diff options
context:
space:
mode:
authorViktor Vorona <viktor.vorona@sonarsource.com>2024-02-06 15:34:53 +0100
committersonartech <sonartech@sonarsource.com>2024-02-07 20:02:50 +0000
commit5193e5772b2c7d2d6321426dbfa108b6906bafc0 (patch)
treeee9fde54d30767cb9acbc05366bc9d098e8a2c70 /server/sonar-web/eslint-local-rules
parente6dc9c509da6a8c7604541062f2184c166f860bb (diff)
downloadsonarqube-5193e5772b2c7d2d6321426dbfa108b6906bafc0.tar.gz
sonarqube-5193e5772b2c7d2d6321426dbfa108b6906bafc0.zip
SONAR-21571 typescript-eslint update
Diffstat (limited to 'server/sonar-web/eslint-local-rules')
-rw-r--r--server/sonar-web/eslint-local-rules/__tests__/no-implicit-coercion-test.js6
-rw-r--r--server/sonar-web/eslint-local-rules/test-config/react.tsx19
-rw-r--r--server/sonar-web/eslint-local-rules/test-config/tsconfig.json4
3 files changed, 27 insertions, 2 deletions
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"]
+}