diff --git a/.eslint-doc-generatorrc.cjs b/.eslint-doc-generatorrc.cjs index 8ecc04aa986..0777469cd6b 100644 --- a/.eslint-doc-generatorrc.cjs +++ b/.eslint-doc-generatorrc.cjs @@ -15,13 +15,14 @@ * along with this program; if not, see https://sonarsource.com/license/ssal/ */ const rules = require('./lib').rules; +const prettier = require('prettier'); +const { prettier: prettierOpts } = require('./package.json'); /** @type {import('eslint-doc-generator').GenerateOptions} */ const config = { urlRuleDoc(name) { return rules[name].meta.docs.url; }, - postprocess: content => content.replace('', '<table>'), ignoreConfig: ['recommended-legacy'], pathRuleDoc(name) { return `docs/${name}.md`; @@ -36,6 +37,11 @@ const config = { 'requiresTypeChecking', 'deprecated', ], + postprocess: content => + prettier.format(content.replace('
', '<table>'), { + ...prettierOpts, + parser: 'markdown', + }), }; module.exports = config; diff --git a/.gitignore b/.gitignore index 89b406c6471..59942f20047 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ test-report.xml sonarjs-* +packages/jsts/src/rules/*/generated-meta.ts + # IntelliJ IDEA *.iws *.iml diff --git a/generate-eslint-package-json.mjs b/generate-eslint-package-json.mjs index c87f137f131..b1568e7f632 100644 --- a/generate-eslint-package-json.mjs +++ b/generate-eslint-package-json.mjs @@ -26,22 +26,14 @@ const eslintPluginDependencies = [ '@babel/preset-flow', '@babel/preset-react', '@eslint-community/regexpp', - '@typescript-eslint/eslint-plugin', - '@typescript-eslint/utils', 'builtin-modules', 'bytes', - 'eslint-plugin-import', - 'eslint-plugin-jsx-a11y', - 'eslint-plugin-react', - 'eslint-plugin-react-hooks', - 'eslint-scope', 'functional-red-black-tree', 'jsx-ast-utils', 'minimatch', 'scslre', 'semver', 'typescript', - 'vue-eslint-parser', ]; const mainPackageJson = JSON.parse( @@ -90,7 +82,7 @@ await fs.writeFile( 'https://github.com/SonarSource/SonarJS/blob/master/packages/jsts/src/rules/README.md', dependencies, peerDependencies: { - eslint: '8.0.0 - 9.14', + eslint: '^8.0.0 || ^9.0.0', }, }, null, diff --git a/its/eslint8-plugin-sonarjs/eslint.config.cjs b/its/eslint8-plugin-sonarjs/eslint.config.cjs index cff8b819894..dc69639cb5b 100644 --- a/its/eslint8-plugin-sonarjs/eslint.config.cjs +++ b/its/eslint8-plugin-sonarjs/eslint.config.cjs @@ -26,7 +26,6 @@ module.exports = [ plugin.configs.recommended, { rules: { - 'sonarjs/accessor-pairs': 'error', 'sonarjs/no-implicit-dependencies': 'error', }, }, diff --git a/its/eslint8-plugin-sonarjs/eslint.config.mjs b/its/eslint8-plugin-sonarjs/eslint.config.mjs index 3fbe393d1b9..ae7ed0ff976 100644 --- a/its/eslint8-plugin-sonarjs/eslint.config.mjs +++ b/its/eslint8-plugin-sonarjs/eslint.config.mjs @@ -26,7 +26,6 @@ export default [ plugin.configs.recommended, { rules: { - 'sonarjs/accessor-pairs': 'error', 'sonarjs/no-implicit-dependencies': 'error', }, }, diff --git a/its/eslint8-plugin-sonarjs/tseslint.config.mjs b/its/eslint8-plugin-sonarjs/tseslint.config.mjs index d1402107fe8..21cf1736288 100644 --- a/its/eslint8-plugin-sonarjs/tseslint.config.mjs +++ b/its/eslint8-plugin-sonarjs/tseslint.config.mjs @@ -23,7 +23,6 @@ import parser from '@typescript-eslint/parser'; console.log(`Loaded ${Object.keys(plugin.configs.recommended.rules ?? {}).length} rules`); export default tseslint.config(plugin.configs.recommended, { - rules: { 'sonarjs/accessor-pairs': 'error' }, files: ['**/*.ts'], languageOptions: { parser, diff --git a/its/eslint9-plugin-sonarjs/eslint.config.cjs b/its/eslint9-plugin-sonarjs/eslint.config.cjs index cff8b819894..dc69639cb5b 100644 --- a/its/eslint9-plugin-sonarjs/eslint.config.cjs +++ b/its/eslint9-plugin-sonarjs/eslint.config.cjs @@ -26,7 +26,6 @@ module.exports = [ plugin.configs.recommended, { rules: { - 'sonarjs/accessor-pairs': 'error', 'sonarjs/no-implicit-dependencies': 'error', }, }, diff --git a/its/eslint9-plugin-sonarjs/eslint.config.mjs b/its/eslint9-plugin-sonarjs/eslint.config.mjs index 3fbe393d1b9..ae7ed0ff976 100644 --- a/its/eslint9-plugin-sonarjs/eslint.config.mjs +++ b/its/eslint9-plugin-sonarjs/eslint.config.mjs @@ -26,7 +26,6 @@ export default [ plugin.configs.recommended, { rules: { - 'sonarjs/accessor-pairs': 'error', 'sonarjs/no-implicit-dependencies': 'error', }, }, diff --git a/its/eslint9-plugin-sonarjs/tseslint.config.mjs b/its/eslint9-plugin-sonarjs/tseslint.config.mjs index d1402107fe8..21cf1736288 100644 --- a/its/eslint9-plugin-sonarjs/tseslint.config.mjs +++ b/its/eslint9-plugin-sonarjs/tseslint.config.mjs @@ -23,7 +23,6 @@ import parser from '@typescript-eslint/parser'; console.log(`Loaded ${Object.keys(plugin.configs.recommended.rules ?? {}).length} rules`); export default tseslint.config(plugin.configs.recommended, { - rules: { 'sonarjs/accessor-pairs': 'error' }, files: ['**/*.ts'], languageOptions: { parser, diff --git a/package-lock.json b/package-lock.json index 1303411f48b..43773112acb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "htmlparser2": "9.1.0", "jsx-ast-utils": "3.3.5", "lodash.clone": "4.5.0", - "minimatch": "10.0.1", + "minimatch": "9.0.5", "module-alias": "2.2.3", "postcss": "8.4.49", "postcss-html": "0.36.0", @@ -54,6 +54,7 @@ }, "devDependencies": { "@babel/preset-typescript": "7.26.0", + "@inquirer/prompts": "^7.1.0", "@types/babel__preset-env": "7.9.7", "@types/bytes": "3.1.4", "@types/eslint": "8.56.12", @@ -90,7 +91,7 @@ "typedoc": "0.26.11" }, "engines": { - "node": "^18.17.0 || ^20.9.0 || >=21.1.0" + "node": ">=22" } }, "node_modules/@ampproject/remapping": { @@ -2573,6 +2574,277 @@ "deprecated": "Use @eslint/object-schema instead", "license": "BSD-3-Clause" }, + "node_modules/@inquirer/checkbox": { + "version": "4.0.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/checkbox/-/checkbox-4.0.2.tgz", + "integrity": "sha512-+gznPl8ip8P8HYHYecDtUtdsh1t2jvb+sWCD72GAiZ9m45RqwrLmReDaqdC0umQfamtFXVRoMVJ2/qINKGm9Tg==", + "dev": true, + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/figures": "^1.0.8", + "@inquirer/type": "^3.0.1", + "ansi-escapes": "^4.3.2", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/confirm": { + "version": "5.0.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/confirm/-/confirm-5.0.2.tgz", + "integrity": "sha512-KJLUHOaKnNCYzwVbryj3TNBxyZIrr56fR5N45v6K9IPrbT6B7DcudBMfylkV1A8PUdJE15mybkEQyp2/ZUpxUA==", + "dev": true, + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/core": { + "version": "10.1.0", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/core/-/core-10.1.0.tgz", + "integrity": "sha512-I+ETk2AL+yAVbvuKx5AJpQmoaWhpiTFOg/UJb7ZkMAK4blmtG8ATh5ct+T/8xNld0CZG/2UhtkdMwpgvld92XQ==", + "dev": true, + "dependencies": { + "@inquirer/figures": "^1.0.8", + "@inquirer/type": "^3.0.1", + "ansi-escapes": "^4.3.2", + "cli-width": "^4.1.0", + "mute-stream": "^2.0.0", + "signal-exit": "^4.1.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/core/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/@inquirer/core/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@inquirer/core/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@inquirer/editor": { + "version": "4.1.0", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/editor/-/editor-4.1.0.tgz", + "integrity": "sha512-K1gGWsxEqO23tVdp5MT3H799OZ4ER1za7Dlc8F4um0W7lwSv0KGR/YyrUEyimj0g7dXZd8XknM/5QA2/Uy+TbA==", + "dev": true, + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1", + "external-editor": "^3.1.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/expand": { + "version": "4.0.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/expand/-/expand-4.0.2.tgz", + "integrity": "sha512-WdgCX1cUtinz+syKyZdJomovULYlKUWZbVYZzhf+ZeeYf4htAQ3jLymoNs3koIAKfZZl3HUBb819ClCBfyznaw==", + "dev": true, + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/figures": { + "version": "1.0.8", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/figures/-/figures-1.0.8.tgz", + "integrity": "sha512-tKd+jsmhq21AP1LhexC0pPwsCxEhGgAkg28byjJAd+xhmIs8LUX8JbUc3vBf3PhLxWiB5EvyBE5X7JSPAqMAqg==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/input": { + "version": "4.0.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/input/-/input-4.0.2.tgz", + "integrity": "sha512-yCLCraigU085EcdpIVEDgyfGv4vBiE4I+k1qRkc9C5dMjWF42ADMGy1RFU94+eZlz4YlkmFsiyHZy0W1wdhaNg==", + "dev": true, + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/number": { + "version": "3.0.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/number/-/number-3.0.2.tgz", + "integrity": "sha512-MKQhYofdUNk7eqJtz52KvM1dH6R93OMrqHduXCvuefKrsiMjHiMwjc3NZw5Imm2nqY7gWd9xdhYrtcHMJQZUxA==", + "dev": true, + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/password": { + "version": "4.0.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/password/-/password-4.0.2.tgz", + "integrity": "sha512-tQXGSu7IO07gsYlGy3VgXRVsbOWqFBMbqAUrJSc1PDTQQ5Qdm+QVwkP0OC0jnUZ62D19iPgXOMO+tnWG+HhjNQ==", + "dev": true, + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1", + "ansi-escapes": "^4.3.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/prompts": { + "version": "7.1.0", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/prompts/-/prompts-7.1.0.tgz", + "integrity": "sha512-5U/XiVRH2pp1X6gpNAjWOglMf38/Ys522ncEHIKT1voRUvSj/DQnR22OVxHnwu5S+rCFaUiPQ57JOtMFQayqYA==", + "dev": true, + "dependencies": { + "@inquirer/checkbox": "^4.0.2", + "@inquirer/confirm": "^5.0.2", + "@inquirer/editor": "^4.1.0", + "@inquirer/expand": "^4.0.2", + "@inquirer/input": "^4.0.2", + "@inquirer/number": "^3.0.2", + "@inquirer/password": "^4.0.2", + "@inquirer/rawlist": "^4.0.2", + "@inquirer/search": "^3.0.2", + "@inquirer/select": "^4.0.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/rawlist": { + "version": "4.0.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/rawlist/-/rawlist-4.0.2.tgz", + "integrity": "sha512-3XGcskMoVF8H0Dl1S5TSZ3rMPPBWXRcM0VeNVsS4ByWeWjSeb0lPqfnBg6N7T0608I1B2bSVnbi2cwCrmOD1Yw==", + "dev": true, + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/type": "^3.0.1", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/search": { + "version": "3.0.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/search/-/search-3.0.2.tgz", + "integrity": "sha512-Zv4FC7w4dJ13BOJfKRQCICQfShinGjb1bCEIHxTSnjj2telu3+3RHwHubPG9HyD4aix5s+lyAMEK/wSFD75HLA==", + "dev": true, + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/figures": "^1.0.8", + "@inquirer/type": "^3.0.1", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/select": { + "version": "4.0.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/select/-/select-4.0.2.tgz", + "integrity": "sha512-uSWUzaSYAEj0hlzxa1mUB6VqrKaYx0QxGBLZzU4xWFxaSyGaXxsSE4OSOwdU24j0xl8OajgayqFXW0l2bkl2kg==", + "dev": true, + "dependencies": { + "@inquirer/core": "^10.1.0", + "@inquirer/figures": "^1.0.8", + "@inquirer/type": "^3.0.1", + "ansi-escapes": "^4.3.2", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/type": { + "version": "3.0.1", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@inquirer/type/-/type-3.0.1.tgz", + "integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==", + "dev": true, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -3435,21 +3707,6 @@ } } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/@typescript-eslint/utils": { "version": "7.18.0", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@typescript-eslint/utils/-/utils-7.18.0.tgz", @@ -3574,6 +3831,33 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -4196,6 +4480,12 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, "node_modules/chevrotain": { "version": "11.0.3", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/chevrotain/-/chevrotain-11.0.3.tgz", @@ -4303,6 +4593,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-width": { + "version": "4.1.0", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/color-convert/-/color-convert-2.0.1.tgz", @@ -6204,6 +6503,32 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "license": "MIT" }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/external-editor/node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/extract-zip/-/extract-zip-2.0.1.tgz", @@ -6723,21 +7048,6 @@ "node": ">= 6" } }, - "node_modules/glob/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/global-modules": { "version": "2.0.0", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/global-modules/-/global-modules-2.0.0.tgz", @@ -8448,15 +8758,14 @@ } }, "node_modules/minimatch": { - "version": "10.0.1", - "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", - "license": "ISC", + "version": "9.0.5", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": "20 || >=22" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -8568,6 +8877,15 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, + "node_modules/mute-stream": { + "version": "2.0.0", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/mute-stream/-/mute-stream-2.0.0.tgz", + "integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==", + "dev": true, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/nanoid": { "version": "3.3.7", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/nanoid/-/nanoid-3.3.7.tgz", @@ -8910,6 +9228,15 @@ "node": ">= 0.8.0" } }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/p-event": { "version": "5.0.1", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/p-event/-/p-event-5.0.1.tgz", @@ -10059,6 +10386,21 @@ "node": "20 || >=22" } }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "10.0.1", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/rimraf/node_modules/path-scurry": { "version": "2.0.0", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/path-scurry/-/path-scurry-2.0.0.tgz", @@ -11782,22 +12124,6 @@ "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x" } }, - "node_modules/typedoc/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/typescript": { "version": "5.6.3", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/typescript/-/typescript-5.6.3.tgz", @@ -12402,6 +12728,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/yoctocolors-cjs": { + "version": "2.1.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz", + "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/zwitch": { "version": "2.0.4", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/zwitch/-/zwitch-2.0.4.tgz", diff --git a/package.json b/package.json index 9ce0fbaeab3..4e022f8f7f9 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,14 @@ "build:cov": "mvn clean && npm run bridge:build:cov && npm run _:plugin:pre-build && npm run plugin:build", "build:fast": "npm run bridge:build:fast && npm run _:plugin:pre-build && npm run plugin:build:fast", "bf": "npm run build:fast", - "new-rule": "tsx tools/newRule.ts", - "generate-meta": "tsx tools/generate-meta.ts && cd packages/jsts/src/rules && npm run eslint-docs", + "new-rule": "tsx tools/new-rule.mts", + "generate-meta": "tsx tools/generate-meta.ts npm run eslint-docs", "generate-rules-list": "node tools/generate-rules-list.js", "ruling": "node tools/prepare-ruling.js && tsx --tsconfig packages/tsconfig.test.json --test packages/ruling/tests/projects/*.ruling.test.ts", "ruling-parametrized": "node tools/prepare-ruling.js && SONAR_RULING_SETTINGS=../settings.js tsx --tsconfig packages/tsconfig.test.json --test packages/ruling/tests/projects/*.ruling.test.ts", "ruling-sync": "rsync -avh packages/ruling/tests/actual/jsts/ its/ruling/src/test/expected/jsts/ --delete", "update-ruling-data": "mvn -f sonar-plugin/sonar-javascript-plugin/pom.xml compile && npx tsx packages/ruling/tests/tools/parseRulesData.ts", + "create-rule-indexes": "tsx tools/generate-rule-indexes.ts", "bridge:compile": "tsc -b packages profiling && npm run _:bridge:copy-protofiles", "bridge:test": "tsx --tsconfig packages/tsconfig.test.json --test --test-reporter spec --test-reporter-destination stdout \"packages/*/src/rules/*[!node_modules]/**/*.test.ts\" \"packages/*[!ruling]/tests/**/*.test.ts\"", "bridge:test:cov": "odz run npm run bridge:test || true && odz report --reporters=text-lcov > lcov.info", @@ -28,7 +29,7 @@ "plugin:build:fast": "mvn install -DskipTests && npm run update-ruling-data", "pbf": "npm run plugin:build:fast", "td": "npm --prefix typedoc/searchable-parameters-plugin run setup && npx typedoc --options typedoc/typedoc.js", - "prepare": "husky install", + "prepare": "husky install && npm run generate-meta", "precommit": "pretty-quick --staged", "count-rules": "node tools/count-rules.js", "_:bridge:copy-protofiles": "cpy --flat packages/jsts/src/parsers/estree.proto sonar-plugin/bridge/src/main/protobuf && cpy --flat packages/jsts/src/parsers/estree.proto lib/jsts/src/parsers", @@ -44,7 +45,7 @@ "eslint-plugin:types": "tsc -p tsconfig-plugin.json --declaration true --emitDeclarationOnly --outDir lib/types", "eslint-plugin:package-json": "node generate-eslint-package-json.mjs", "eslint-plugin:copy-assets": "cpy LICENSE.txt lib/ --rename LICENSE && cpy packages/jsts/src/rules/README.md lib/ --flat", - "eslint-docs": "npm run eslint-plugin:compile && eslint-doc-generator lib --init-rule-docs" + "eslint-docs": "npm run eslint-plugin:compile && eslint-doc-generator lib --init-rule-docs && tsx tools/generate-external-rules-docs.ts" }, "repository": { "type": "git", @@ -61,6 +62,7 @@ "type": "module", "devDependencies": { "@babel/preset-typescript": "7.26.0", + "@inquirer/prompts": "^7.1.0", "@types/babel__preset-env": "7.9.7", "@types/bytes": "3.1.4", "@types/eslint": "8.56.12", @@ -121,7 +123,7 @@ "htmlparser2": "9.1.0", "jsx-ast-utils": "3.3.5", "lodash.clone": "4.5.0", - "minimatch": "10.0.1", + "minimatch": "9.0.5", "module-alias": "2.2.3", "postcss": "8.4.49", "postcss-html": "0.36.0", diff --git a/packages/jsts/src/analysis/analyzer.ts b/packages/jsts/src/analysis/analyzer.ts index 265a9a06272..b823541f5f4 100644 --- a/packages/jsts/src/analysis/analyzer.ts +++ b/packages/jsts/src/analysis/analyzer.ts @@ -17,7 +17,7 @@ import { debug, info } from '../../../shared/src/helpers/logging.js'; import { SourceCode } from 'eslint'; import { JsTsAnalysisInput, JsTsAnalysisOutput } from './analysis.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { JsTsLanguage } from '../../../shared/src/helpers/language.js'; import { getLinter } from '../linter/linters.js'; import { buildSourceCode } from '../builders/build.js'; diff --git a/packages/jsts/src/linter/visitors/cpd.ts b/packages/jsts/src/linter/visitors/cpd.ts index b77ad020043..8c4be1a295e 100644 --- a/packages/jsts/src/linter/visitors/cpd.ts +++ b/packages/jsts/src/linter/visitors/cpd.ts @@ -15,7 +15,7 @@ * along with this program; if not, see https://sonarsource.com/license/ssal/ */ import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { SourceCode, AST } from 'eslint'; import { visit } from './visitor.js'; import { Location } from './metrics/helpers/location.js'; diff --git a/packages/jsts/src/linter/visitors/symbol-highlighting.ts b/packages/jsts/src/linter/visitors/symbol-highlighting.ts index 5ccf4183d5d..123964e2689 100644 --- a/packages/jsts/src/linter/visitors/symbol-highlighting.ts +++ b/packages/jsts/src/linter/visitors/symbol-highlighting.ts @@ -16,7 +16,7 @@ */ import { Rule, Scope } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { AST } from 'vue-eslint-parser'; import { convertLocation, extractTokensAndComments, Location } from './metrics/helpers/index.js'; diff --git a/packages/jsts/src/parsers/ast.ts b/packages/jsts/src/parsers/ast.ts index ccf05d9585e..2a63ec8c4be 100644 --- a/packages/jsts/src/parsers/ast.ts +++ b/packages/jsts/src/parsers/ast.ts @@ -15,7 +15,7 @@ * along with this program; if not, see https://sonarsource.com/license/ssal/ */ import protobuf from 'protobufjs'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { debug } from '../../../shared/src/helpers/logging.js'; import path from 'path'; diff --git a/packages/jsts/src/rules/.gitignore b/packages/jsts/src/rules/.gitignore new file mode 100644 index 00000000000..532cabda6eb --- /dev/null +++ b/packages/jsts/src/rules/.gitignore @@ -0,0 +1,2 @@ +rules.ts +plugin-rules.ts diff --git a/packages/jsts/src/rules/README.md b/packages/jsts/src/rules/README.md index 046cba96d5c..5a0a277c583 100644 --- a/packages/jsts/src/rules/README.md +++ b/packages/jsts/src/rules/README.md @@ -64,7 +64,9 @@ We include a `recommended-legacy` configuration to be backward compatible with E ## ESLint and Sonar -This plugin exposes to ESLint users all JS/TS rules from Sonar-\* products (aka [SonarJS](https://github.com/SonarSource/SonarJS)). We extracted the rules to be beneficial for the ESLint community. +This plugin exposes to ESLint users all original JS/TS rules from Sonar products (aka [SonarJS](https://github.com/SonarSource/SonarJS)). We extracted the rules to be beneficial for the ESLint community. + +This ESLint plugin does not contain all the rules from the SonarQube JS/TS analyzer. Aside of the rules available here, SonarQube uses rules from other ESLint plugins ([some](#eslint-rules) used as they are, [some others](#improved-eslint-rules) have been modified). We recommend installing those ESLint plugins and enabling those rules if you are looking for similar results to SonarQube using ESLint. If you are a [SonarQube](https://www.sonarqube.org) or [SonarCloud](https://sonarcloud.io) user, to lint your code locally, we suggest using [SonarLint](https://www.sonarlint.org) IDE extension (available for VSCode, JetBrains IDEs and Eclipse). You can connect SonarLint to your SonarQube/SonarCloud project to synchronize rules configuration, issue statuses, etc. @@ -79,337 +81,473 @@ If you are a [SonarQube](https://www.sonarqube.org) or [SonarCloud](https://sona πŸ’­ Requires [type information](https://typescript-eslint.io/linting/typed-linting).\ ❌ Deprecated. -| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ | -| :------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------------------------- | :-- | :-- | :-- | :-- | :-- | -| [accessor-pairs](https://sonarsource.github.io/rspec/#/rspec/S2376/javascript) | Property getters and setters should come in pairs | | | | | | -| [alt-text](https://sonarsource.github.io/rspec/#/rspec/S1077/javascript) | Image, area, button with image and object elements should have an alternative text | βœ… | | | | | -| [anchor-has-content](https://sonarsource.github.io/rspec/#/rspec/S6827/javascript) | Anchors should contain accessible content | βœ… | | πŸ’‘ | | | -| [anchor-is-valid](https://sonarsource.github.io/rspec/#/rspec/S6844/javascript) | Anchor tags should not be used as buttons | βœ… | | | | | -| [anchor-precedence](https://sonarsource.github.io/rspec/#/rspec/S5850/javascript) | Alternatives in regular expressions should be grouped when used with anchors | βœ… | | | πŸ’­ | | -| [argument-type](https://sonarsource.github.io/rspec/#/rspec/S3782/javascript) | Arguments to built-in functions should match documented types | βœ… | | | πŸ’­ | | -| [arguments-order](https://sonarsource.github.io/rspec/#/rspec/S2234/javascript) | Parameters should be passed in the correct order | βœ… | | | πŸ’­ | | -| [arguments-usage](https://sonarsource.github.io/rspec/#/rspec/S3513/javascript) | "arguments" should not be accessed directly | | | | | | -| [array-callback-without-return](https://sonarsource.github.io/rspec/#/rspec/S3796/javascript) | Callbacks of array methods should have return statements | βœ… | | | πŸ’­ | | -| [array-constructor](https://sonarsource.github.io/rspec/#/rspec/S1528/javascript) | Array constructors should not be used | | | πŸ’‘ | | | -| [arrow-function-convention](https://sonarsource.github.io/rspec/#/rspec/S3524/javascript) | Braces and parentheses should be used consistently with arrow functions | | | | | | -| [assertions-in-tests](https://sonarsource.github.io/rspec/#/rspec/S2699/javascript) | Tests should include assertions | βœ… | | | | | -| [aws-apigateway-public-api](https://sonarsource.github.io/rspec/#/rspec/S6333/javascript) | Creating public APIs is security-sensitive | βœ… | | | | | -| [aws-ec2-rds-dms-public](https://sonarsource.github.io/rspec/#/rspec/S6329/javascript) | Allowing public network access to cloud resources is security-sensitive | βœ… | | | | | -| [aws-ec2-unencrypted-ebs-volume](https://sonarsource.github.io/rspec/#/rspec/S6275/javascript) | Using unencrypted EBS volumes is security-sensitive | βœ… | | | | | -| [aws-efs-unencrypted](https://sonarsource.github.io/rspec/#/rspec/S6332/javascript) | Using unencrypted EFS file systems is security-sensitive | βœ… | | | | | -| [aws-iam-all-privileges](https://sonarsource.github.io/rspec/#/rspec/S6302/javascript) | Policies granting all privileges are security-sensitive | βœ… | | | | | -| [aws-iam-all-resources-accessible](https://sonarsource.github.io/rspec/#/rspec/S6304/javascript) | Policies granting access to all resources of an account are security-sensitive | | | | | | -| [aws-iam-privilege-escalation](https://sonarsource.github.io/rspec/#/rspec/S6317/javascript) | AWS IAM policies should limit the scope of permissions given | βœ… | | | | | -| [aws-iam-public-access](https://sonarsource.github.io/rspec/#/rspec/S6270/javascript) | Policies authorizing public access to resources are security-sensitive | βœ… | | | | | -| [aws-opensearchservice-domain](https://sonarsource.github.io/rspec/#/rspec/S6308/javascript) | Using unencrypted Elasticsearch domains is security-sensitive | βœ… | | | | | -| [aws-rds-unencrypted-databases](https://sonarsource.github.io/rspec/#/rspec/S6303/javascript) | Using unencrypted RDS DB resources is security-sensitive | βœ… | | | | | -| [aws-restricted-ip-admin-access](https://sonarsource.github.io/rspec/#/rspec/S6321/javascript) | Administration services access should be restricted to specific IP addresses | βœ… | | | | | -| [aws-s3-bucket-granted-access](https://sonarsource.github.io/rspec/#/rspec/S6265/javascript) | Granting access to S3 buckets to all or authenticated users is security-sensitive | βœ… | | | | | -| [aws-s3-bucket-insecure-http](https://sonarsource.github.io/rspec/#/rspec/S6249/javascript) | Authorizing HTTP communications with S3 buckets is security-sensitive | βœ… | | | | | -| [aws-s3-bucket-public-access](https://sonarsource.github.io/rspec/#/rspec/S6281/javascript) | Allowing public ACLs or policies on a S3 bucket is security-sensitive | βœ… | | | | | -| [aws-s3-bucket-server-encryption](https://sonarsource.github.io/rspec/#/rspec/S6245/javascript) | Disabling server-side encryption of S3 buckets is security-sensitive | | | | | ❌ | -| [aws-s3-bucket-versioning](https://sonarsource.github.io/rspec/#/rspec/S6252/javascript) | Disabling versioning of S3 buckets is security-sensitive | βœ… | | | | | -| [aws-sagemaker-unencrypted-notebook](https://sonarsource.github.io/rspec/#/rspec/S6319/javascript) | Using unencrypted SageMaker notebook instances is security-sensitive | βœ… | | | | | -| [aws-sns-unencrypted-topics](https://sonarsource.github.io/rspec/#/rspec/S6327/javascript) | Using unencrypted SNS topics is security-sensitive | βœ… | | | | | -| [aws-sqs-unencrypted-queue](https://sonarsource.github.io/rspec/#/rspec/S6330/javascript) | Using unencrypted SQS queues is security-sensitive | βœ… | | | | | -| [bitwise-operators](https://sonarsource.github.io/rspec/#/rspec/S1529/javascript) | Bitwise operators should not be used in boolean contexts | βœ… | | | | | -| [bool-param-default](https://sonarsource.github.io/rspec/#/rspec/S4798/javascript) | Optional boolean parameters should have default value | | | | | | -| [brace-style](https://sonarsource.github.io/rspec/#/rspec/S1105/javascript) | An open curly brace should be located at the end of a line | | πŸ”§ | | | ❌ | -| [call-argument-line](https://sonarsource.github.io/rspec/#/rspec/S1472/javascript) | Function call arguments should not start on new lines | βœ… | | | | | -| [certificate-transparency](https://sonarsource.github.io/rspec/#/rspec/S5742/javascript) | Disabling Certificate Transparency monitoring is security-sensitive | βœ… | | | | | -| [chai-determinate-assertion](https://sonarsource.github.io/rspec/#/rspec/S6092/javascript) | Chai assertions should have only one reason to succeed | βœ… | | | | | -| [class-name](https://sonarsource.github.io/rspec/#/rspec/S101/javascript) | Class names should comply with a naming convention | βœ… | | | | | -| [class-prototype](https://sonarsource.github.io/rspec/#/rspec/S3525/javascript) | Class methods should be used instead of "prototype" assignments | | | | πŸ’­ | | -| [code-eval](https://sonarsource.github.io/rspec/#/rspec/S1523/javascript) | Dynamically executing code is security-sensitive | βœ… | | | | | -| [cognitive-complexity](https://sonarsource.github.io/rspec/#/rspec/S3776/javascript) | Cognitive Complexity of functions should not be too high | βœ… | | | | | -| [comma-or-logical-or-case](https://sonarsource.github.io/rspec/#/rspec/S3616/javascript) | Comma and logical OR operators should not be used in switch cases | βœ… | | | | | -| [comment-regex](https://sonarsource.github.io/rspec/#/rspec/S124/javascript) | Track comments matching a regular expression | | | | | | -| [concise-regex](https://sonarsource.github.io/rspec/#/rspec/S6353/javascript) | Regular expression quantifiers and character classes should be used concisely | βœ… | | | πŸ’­ | | -| [conditional-indentation](https://sonarsource.github.io/rspec/#/rspec/S3973/javascript) | A conditionally executed single line should be denoted by indentation | | | | | ❌ | -| [confidential-information-logging](https://sonarsource.github.io/rspec/#/rspec/S5757/javascript) | Allowing confidential information to be logged is security-sensitive | βœ… | | | | | -| [constructor-for-side-effects](https://sonarsource.github.io/rspec/#/rspec/S1848/javascript) | Objects should not be created to be dropped immediately without being used | βœ… | | | | | -| [content-length](https://sonarsource.github.io/rspec/#/rspec/S5693/javascript) | Allowing requests with excessive content length is security-sensitive | βœ… | | | | | -| [content-security-policy](https://sonarsource.github.io/rspec/#/rspec/S5728/javascript) | Disabling content security policy fetch directives is security-sensitive | βœ… | | | | | -| [cookie-no-httponly](https://sonarsource.github.io/rspec/#/rspec/S3330/javascript) | Creating cookies without the "HttpOnly" flag is security-sensitive | βœ… | | | | | -| [cookies](https://sonarsource.github.io/rspec/#/rspec/S2255/javascript) | Writing cookies is security-sensitive | | | | | ❌ | -| [cors](https://sonarsource.github.io/rspec/#/rspec/S5122/javascript) | Having a permissive Cross-Origin Resource Sharing policy is security-sensitive | βœ… | | | | | -| [csrf](https://sonarsource.github.io/rspec/#/rspec/S4502/javascript) | Disabling CSRF protections is security-sensitive | βœ… | | | | | -| [cyclomatic-complexity](https://sonarsource.github.io/rspec/#/rspec/S1541/javascript) | Cyclomatic Complexity of functions should not be too high | | | | | | -| [declarations-in-global-scope](https://sonarsource.github.io/rspec/#/rspec/S3798/javascript) | Variables and functions should not be declared in the global scope | | | | | | -| [default-param-last](https://sonarsource.github.io/rspec/#/rspec/S1788/javascript) | Function parameters with default values should be last | βœ… | | | | | -| [deprecation](https://sonarsource.github.io/rspec/#/rspec/S1874/javascript) | Deprecated APIs should not be used | βœ… | | | πŸ’­ | | -| [destructuring-assignment-syntax](https://sonarsource.github.io/rspec/#/rspec/S3514/javascript) | Destructuring syntax should be used for assignments | | | | | | -| [different-types-comparison](https://sonarsource.github.io/rspec/#/rspec/S3403/javascript) | Strict equality operators should not be used with dissimilar types | βœ… | | πŸ’‘ | πŸ’­ | | -| [disabled-auto-escaping](https://sonarsource.github.io/rspec/#/rspec/S5247/javascript) | Disabling auto-escaping in template engines is security-sensitive | βœ… | | | πŸ’­ | | -| [disabled-resource-integrity](https://sonarsource.github.io/rspec/#/rspec/S5725/javascript) | Using remote artifacts without integrity checks is security-sensitive | βœ… | | | πŸ’­ | | -| [disabled-timeout](https://sonarsource.github.io/rspec/#/rspec/S6080/javascript) | Disabling Mocha timeouts should be explicit | βœ… | | | | | -| [dns-prefetching](https://sonarsource.github.io/rspec/#/rspec/S5743/javascript) | Allowing browsers to perform DNS prefetching is security-sensitive | | | | | ❌ | -| [duplicates-in-character-class](https://sonarsource.github.io/rspec/#/rspec/S5869/javascript) | Character classes in regular expressions should not contain the same character twice | βœ… | | | πŸ’­ | | -| [elseif-without-else](https://sonarsource.github.io/rspec/#/rspec/S126/javascript) | "if ... else if" constructs should end with "else" clauses | | | | | | -| [empty-string-repetition](https://sonarsource.github.io/rspec/#/rspec/S5842/javascript) | Repeated patterns in regular expressions should not match the empty string | βœ… | | | πŸ’­ | | -| [encryption](https://sonarsource.github.io/rspec/#/rspec/S4787/javascript) | Encrypting data is security-sensitive | | | | | ❌ | -| [encryption-secure-mode](https://sonarsource.github.io/rspec/#/rspec/S5542/javascript) | Encryption algorithms should be used with secure mode and padding scheme | βœ… | | | | | -| [enforce-trailing-comma](https://sonarsource.github.io/rspec/#/rspec/S3723/javascript) | Trailing commas should be used | | πŸ”§ | | | ❌ | -| [existing-groups](https://sonarsource.github.io/rspec/#/rspec/S6328/javascript) | Replacement strings should reference existing regular expression groups | βœ… | | | πŸ’­ | | -| [expression-complexity](https://sonarsource.github.io/rspec/#/rspec/S1067/javascript) | Expressions should not be too complex | | | | | | -| [file-header](https://sonarsource.github.io/rspec/#/rspec/S1451/javascript) | Track lack of copyright and license headers | | | | | | -| [file-name-differ-from-class](https://sonarsource.github.io/rspec/#/rspec/S3317/javascript) | Default export names and file names should match | | | | | | -| [file-permissions](https://sonarsource.github.io/rspec/#/rspec/S2612/javascript) | Setting loose POSIX file permissions is security-sensitive | βœ… | | | | | -| [file-uploads](https://sonarsource.github.io/rspec/#/rspec/S2598/javascript) | File uploads should be restricted | βœ… | | | | | -| [fixme-tag](https://sonarsource.github.io/rspec/#/rspec/S1134/javascript) | Track uses of "FIXME" tags | βœ… | | | | | -| [for-in](https://sonarsource.github.io/rspec/#/rspec/S1535/javascript) | "for...in" loops should filter properties before acting on them | | | | | | -| [for-loop-increment-sign](https://sonarsource.github.io/rspec/#/rspec/S2251/javascript) | A "for" loop update clause should move the counter in the right direction | βœ… | | | | | -| [frame-ancestors](https://sonarsource.github.io/rspec/#/rspec/S5732/javascript) | Disabling content security policy frame-ancestors directive is security-sensitive | βœ… | | | | | -| [function-inside-loop](https://sonarsource.github.io/rspec/#/rspec/S1515/javascript) | Functions should not be defined inside loops | βœ… | | | | | -| [function-name](https://sonarsource.github.io/rspec/#/rspec/S100/javascript) | Function and method names should comply with a naming convention | | | | | | -| [function-return-type](https://sonarsource.github.io/rspec/#/rspec/S3800/javascript) | Functions should always return the same type | βœ… | | | πŸ’­ | | -| [future-reserved-words](https://sonarsource.github.io/rspec/#/rspec/S1527/javascript) | Future reserved words should not be used as identifiers | βœ… | | | | | -| [generator-without-yield](https://sonarsource.github.io/rspec/#/rspec/S3531/javascript) | Generators should explicitly "yield" a value | βœ… | | | | | -| [hashing](https://sonarsource.github.io/rspec/#/rspec/S4790/javascript) | Using weak hashing algorithms is security-sensitive | βœ… | | | | | -| [hidden-files](https://sonarsource.github.io/rspec/#/rspec/S5691/javascript) | Statically serving hidden files is security-sensitive | βœ… | | | | | -| [hook-use-state](https://sonarsource.github.io/rspec/#/rspec/S6754/javascript) | The return value of "useState" should be destructured and named symmetrically | βœ… | | πŸ’‘ | | | -| [html-has-lang](https://sonarsource.github.io/rspec/#/rspec/S5254/javascript) | HTML elements should have a valid language attribute | βœ… | | πŸ’‘ | | | -| [in-operator-type-error](https://sonarsource.github.io/rspec/#/rspec/S3785/javascript) | "in" should not be used with primitive types | βœ… | | | πŸ’­ | | -| [inconsistent-function-call](https://sonarsource.github.io/rspec/#/rspec/S3686/javascript) | Functions should be called consistently with or without "new" | βœ… | | | | | -| [index-of-compare-to-positive-number](https://sonarsource.github.io/rspec/#/rspec/S2692/javascript) | "indexOf" checks should not be for positive numbers | βœ… | | | πŸ’­ | | -| [insecure-cookie](https://sonarsource.github.io/rspec/#/rspec/S2092/javascript) | Creating cookies without the "secure" flag is security-sensitive | βœ… | | | | | -| [insecure-jwt-token](https://sonarsource.github.io/rspec/#/rspec/S5659/javascript) | JWT should be signed and verified with strong cipher algorithms | βœ… | | | | | -| [inverted-assertion-arguments](https://sonarsource.github.io/rspec/#/rspec/S3415/javascript) | Assertion arguments should be passed in the correct order | βœ… | | πŸ’‘ | | | -| [jsx-key](https://sonarsource.github.io/rspec/#/rspec/S6477/javascript) | JSX list components should have a key property | βœ… | | | | | -| [jsx-no-constructed-context-values](https://sonarsource.github.io/rspec/#/rspec/S6481/javascript) | React Context Provider values should have stable identities | βœ… | | | | | -| [jsx-no-useless-fragment](https://sonarsource.github.io/rspec/#/rspec/S6749/javascript) | Redundant React fragments should be removed | βœ… | πŸ”§ | πŸ’‘ | | | -| [label-has-associated-control](https://sonarsource.github.io/rspec/#/rspec/S6853/javascript) | Label elements should have a text label and an associated control | βœ… | | | | | -| [label-position](https://sonarsource.github.io/rspec/#/rspec/S1439/javascript) | Only "while", "do", "for" and "switch" statements should be labelled | βœ… | | | | | -| [link-with-target-blank](https://sonarsource.github.io/rspec/#/rspec/S5148/javascript) | Authorizing an opened window to access back to the originating window is security-sensitive | βœ… | | | | | -| [max-switch-cases](https://sonarsource.github.io/rspec/#/rspec/S1479/javascript) | "switch" statements should not have too many "case" clauses | βœ… | | | | | -| [max-union-size](https://sonarsource.github.io/rspec/#/rspec/S4622/javascript) | Union types should not have too many elements | | | | | | -| [media-has-caption](https://sonarsource.github.io/rspec/#/rspec/S4084/javascript) | Media elements should have captions | βœ… | | | | | -| [misplaced-loop-counter](https://sonarsource.github.io/rspec/#/rspec/S1994/javascript) | "for" loop increment clauses should modify the loops' counters | βœ… | | | | | -| [mouse-events-a11y](https://sonarsource.github.io/rspec/#/rspec/S1082/javascript) | Mouse events should have corresponding keyboard events | βœ… | | πŸ’‘ | | | -| [nested-control-flow](https://sonarsource.github.io/rspec/#/rspec/S134/javascript) | Control flow statements "if", "for", "while", "switch" and "try" should not be nested too deeply | | | | | | -| [new-cap](https://sonarsource.github.io/rspec/#/rspec/S2430/javascript) | Constructor names should start with an upper case letter | βœ… | | | | | -| [new-operator-misuse](https://sonarsource.github.io/rspec/#/rspec/S2999/javascript) | "new" should only be used with functions and classes | βœ… | | | πŸ’­ | | -| [no-accessor-field-mismatch](https://sonarsource.github.io/rspec/#/rspec/S4275/javascript) | Getters and setters should access the expected fields | βœ… | | | | | -| [no-all-duplicated-branches](https://sonarsource.github.io/rspec/#/rspec/S3923/javascript) | All branches in a conditional structure should not have exactly the same implementation | βœ… | | | | | -| [no-alphabetical-sort](https://sonarsource.github.io/rspec/#/rspec/S2871/javascript) | "Array.prototype.sort()" and "Array.prototype.toSorted()" should use a compare function | βœ… | | πŸ’‘ | πŸ’­ | | -| [no-angular-bypass-sanitization](https://sonarsource.github.io/rspec/#/rspec/S6268/javascript) | Disabling Angular built-in sanitization is security-sensitive | βœ… | | | | | -| [no-array-delete](https://sonarsource.github.io/rspec/#/rspec/S2870/javascript) | "delete" should not be used on arrays | βœ… | | | πŸ’­ | | -| [no-array-index-key](https://sonarsource.github.io/rspec/#/rspec/S6479/javascript) | JSX list components should not use array indexes as key | βœ… | | | | | -| [no-associative-arrays](https://sonarsource.github.io/rspec/#/rspec/S3579/javascript) | Array indexes should be numeric | βœ… | | | πŸ’­ | | -| [no-async-constructor](https://sonarsource.github.io/rspec/#/rspec/S7059/javascript) | Constructors should not contain asynchronous operations | βœ… | | | | | -| [no-base-to-string](https://sonarsource.github.io/rspec/#/rspec/S6551/javascript) | Objects and classes converted or coerced to strings should define a "toString()" method | βœ… | | | πŸ’­ | | -| [no-built-in-override](https://sonarsource.github.io/rspec/#/rspec/S2424/javascript) | Built-in objects should not be overridden | | | | | | -| [no-case-label-in-switch](https://sonarsource.github.io/rspec/#/rspec/S1219/javascript) | "switch" statements should not contain non-case labels | βœ… | | | | | -| [no-clear-text-protocols](https://sonarsource.github.io/rspec/#/rspec/S5332/javascript) | Using clear-text protocols is security-sensitive | βœ… | | | | | -| [no-code-after-done](https://sonarsource.github.io/rspec/#/rspec/S6079/javascript) | Tests should not execute any code after "done()" is called | βœ… | | | | | -| [no-collapsible-if](https://sonarsource.github.io/rspec/#/rspec/S1066/javascript) | Mergeable "if" statements should be combined | | | | | | -| [no-collection-size-mischeck](https://sonarsource.github.io/rspec/#/rspec/S3981/javascript) | Collection size and array length comparisons should make sense | βœ… | | πŸ’‘ | πŸ’­ | | -| [no-commented-code](https://sonarsource.github.io/rspec/#/rspec/S125/javascript) | Sections of code should not be commented out | βœ… | | πŸ’‘ | | | -| [no-dead-store](https://sonarsource.github.io/rspec/#/rspec/S1854/javascript) | Unused assignments should be removed | βœ… | | | | | -| [no-delete-var](https://sonarsource.github.io/rspec/#/rspec/S3001/javascript) | "delete" should be used only with object properties | βœ… | | | | | -| [no-deprecated-react](https://sonarsource.github.io/rspec/#/rspec/S6957/javascript) | Deprecated React APIs should not be used | βœ… | | | | | -| [no-duplicate-in-composite](https://sonarsource.github.io/rspec/#/rspec/S4621/javascript) | Union and intersection types should not include duplicated constituents | βœ… | | πŸ’‘ | | | -| [no-duplicate-string](https://sonarsource.github.io/rspec/#/rspec/S1192/javascript) | String literals should not be duplicated | | | | | | -| [no-duplicated-branches](https://sonarsource.github.io/rspec/#/rspec/S1871/javascript) | Two branches in a conditional structure should not have exactly the same implementation | βœ… | | | | | -| [no-element-overwrite](https://sonarsource.github.io/rspec/#/rspec/S4143/javascript) | Collection elements should not be replaced unconditionally | βœ… | | | | | -| [no-empty-after-reluctant](https://sonarsource.github.io/rspec/#/rspec/S6019/javascript) | Reluctant quantifiers in regular expressions should be followed by an expression that can't match the empty string | βœ… | | | πŸ’­ | | -| [no-empty-alternatives](https://sonarsource.github.io/rspec/#/rspec/S6323/javascript) | Alternation in regular expressions should not contain empty alternatives | βœ… | | | πŸ’­ | | -| [no-empty-collection](https://sonarsource.github.io/rspec/#/rspec/S4158/javascript) | Empty collections should not be accessed or iterated | βœ… | | | | | -| [no-empty-function](https://sonarsource.github.io/rspec/#/rspec/S1186/javascript) | Functions should not be empty | βœ… | | πŸ’‘ | | | -| [no-empty-group](https://sonarsource.github.io/rspec/#/rspec/S6331/javascript) | Regular expressions should not contain empty groups | βœ… | | | πŸ’­ | | -| [no-empty-interface](https://sonarsource.github.io/rspec/#/rspec/S4023/javascript) | Interfaces should not be empty | | πŸ”§ | πŸ’‘ | | | -| [no-empty-test-file](https://sonarsource.github.io/rspec/#/rspec/S2187/javascript) | Test files should contain at least one test case | βœ… | | | | | -| [no-equals-in-for-termination](https://sonarsource.github.io/rspec/#/rspec/S888/javascript) | Equality operators should not be used in "for" loop termination conditions | βœ… | | | | | -| [no-exclusive-tests](https://sonarsource.github.io/rspec/#/rspec/S6426/javascript) | Exclusive tests should not be commited to version control | βœ… | | πŸ’‘ | | | -| [no-extend-native](https://sonarsource.github.io/rspec/#/rspec/S6643/javascript) | Prototypes of builtin objects should not be modified | βœ… | | | | | -| [no-extra-arguments](https://sonarsource.github.io/rspec/#/rspec/S930/javascript) | Function calls should not pass extra arguments | βœ… | | | | | -| [no-extra-semi](https://sonarsource.github.io/rspec/#/rspec/S1116/javascript) | Extra semicolons should be removed | | πŸ”§ | | | ❌ | -| [no-find-dom-node](https://sonarsource.github.io/rspec/#/rspec/S6788/javascript) | React's "findDOMNode" should not be used | βœ… | | | | | -| [no-for-in-iterable](https://sonarsource.github.io/rspec/#/rspec/S4139/javascript) | "for in" should not be used with iterables | | | | πŸ’­ | | -| [no-function-declaration-in-block](https://sonarsource.github.io/rspec/#/rspec/S1530/javascript) | Function declarations should not be made within blocks | | | | | | -| [no-global-this](https://sonarsource.github.io/rspec/#/rspec/S2990/javascript) | The global "this" object should not be used | βœ… | | πŸ’‘ | | | -| [no-globals-shadowing](https://sonarsource.github.io/rspec/#/rspec/S2137/javascript) | Special identifiers should not be bound or assigned | βœ… | | | | | -| [no-gratuitous-expressions](https://sonarsource.github.io/rspec/#/rspec/S2589/javascript) | Boolean expressions should not be gratuitous | βœ… | | | | | -| [no-hardcoded-ip](https://sonarsource.github.io/rspec/#/rspec/S1313/javascript) | Using hardcoded IP addresses is security-sensitive | βœ… | | | | | -| [no-hardcoded-passwords](https://sonarsource.github.io/rspec/#/rspec/S2068/javascript) | Hard-coded passwords are security-sensitive | βœ… | | | | | -| [no-hardcoded-secrets](https://sonarsource.github.io/rspec/#/rspec/S6418/javascript) | Hard-coded secrets are security-sensitive | βœ… | | | | | -| [no-hook-setter-in-body](https://sonarsource.github.io/rspec/#/rspec/S6442/javascript) | React's useState hook should not be used directly in the render function or body of a component | βœ… | | | | | -| [no-identical-conditions](https://sonarsource.github.io/rspec/#/rspec/S1862/javascript) | "if/else if" chains and "switch" cases should not have the same condition | βœ… | | | | | -| [no-identical-expressions](https://sonarsource.github.io/rspec/#/rspec/S1764/javascript) | Identical expressions should not be used on both sides of a binary operator | βœ… | | | | | -| [no-identical-functions](https://sonarsource.github.io/rspec/#/rspec/S4144/javascript) | Functions should not have identical implementations | βœ… | | | | | -| [no-ignored-exceptions](https://sonarsource.github.io/rspec/#/rspec/S2486/javascript) | Exceptions should not be ignored | βœ… | | | | | -| [no-ignored-return](https://sonarsource.github.io/rspec/#/rspec/S2201/javascript) | Return values from functions without side effects should not be ignored | βœ… | | | πŸ’­ | | -| [no-implicit-dependencies](https://sonarsource.github.io/rspec/#/rspec/S4328/javascript) | Dependencies should be explicit | | | | | | -| [no-implicit-global](https://sonarsource.github.io/rspec/#/rspec/S2703/javascript) | Variables should be declared explicitly | βœ… | | | | | -| [no-in-misuse](https://sonarsource.github.io/rspec/#/rspec/S4619/javascript) | "in" should not be used on arrays | βœ… | | πŸ’‘ | πŸ’­ | | -| [no-incomplete-assertions](https://sonarsource.github.io/rspec/#/rspec/S2970/javascript) | Assertions should be complete | βœ… | | | | | -| [no-inconsistent-returns](https://sonarsource.github.io/rspec/#/rspec/S3801/javascript) | Functions should use "return" consistently | | | | | | -| [no-incorrect-string-concat](https://sonarsource.github.io/rspec/#/rspec/S3402/javascript) | Strings and non-strings should not be added | | | | πŸ’­ | | -| [no-infinite-loop](https://sonarsource.github.io/rspec/#/rspec/S2189/javascript) | Loops should not be infinite | βœ… | | | | | -| [no-internal-api-use](https://sonarsource.github.io/rspec/#/rspec/S6627/javascript) | Users should not use internal APIs | βœ… | | | | | -| [no-intrusive-permissions](https://sonarsource.github.io/rspec/#/rspec/S5604/javascript) | Using intrusive permissions is security-sensitive | βœ… | | | | | -| [no-invalid-await](https://sonarsource.github.io/rspec/#/rspec/S4123/javascript) | "await" should only be used with promises | βœ… | | | πŸ’­ | | -| [no-invariant-returns](https://sonarsource.github.io/rspec/#/rspec/S3516/javascript) | Function returns should not be invariant | βœ… | | | | | -| [no-inverted-boolean-check](https://sonarsource.github.io/rspec/#/rspec/S1940/javascript) | Boolean checks should not be inverted | βœ… | πŸ”§ | πŸ’‘ | | | -| [no-ip-forward](https://sonarsource.github.io/rspec/#/rspec/S5759/javascript) | Forwarding client IP address is security-sensitive | βœ… | | | | | -| [no-labels](https://sonarsource.github.io/rspec/#/rspec/S1119/javascript) | Labels should not be used | βœ… | | | | | -| [no-literal-call](https://sonarsource.github.io/rspec/#/rspec/S6958/javascript) | Literals should not be used as functions | βœ… | | | | | -| [no-lonely-if](https://sonarsource.github.io/rspec/#/rspec/S6660/javascript) | If statements should not be the only statement in else blocks | βœ… | πŸ”§ | | | | -| [no-mime-sniff](https://sonarsource.github.io/rspec/#/rspec/S5734/javascript) | Allowing browsers to sniff MIME types is security-sensitive | βœ… | | | | | -| [no-misleading-array-reverse](https://sonarsource.github.io/rspec/#/rspec/S4043/javascript) | Array-mutating methods should not be used misleadingly | βœ… | | πŸ’‘ | πŸ’­ | | -| [no-misused-promises](https://sonarsource.github.io/rspec/#/rspec/S6544/javascript) | Promises should not be misused | βœ… | | πŸ’‘ | πŸ’­ | | -| [no-mixed-content](https://sonarsource.github.io/rspec/#/rspec/S5730/javascript) | Allowing mixed-content is security-sensitive | βœ… | | | | | -| [no-nested-assignment](https://sonarsource.github.io/rspec/#/rspec/S1121/javascript) | Assignments should not be made from within sub-expressions | βœ… | | | | | -| [no-nested-conditional](https://sonarsource.github.io/rspec/#/rspec/S3358/javascript) | Ternary operators should not be nested | βœ… | | | | | -| [no-nested-functions](https://sonarsource.github.io/rspec/#/rspec/S2004/javascript) | Functions should not be nested too deeply | βœ… | | | | | -| [no-nested-incdec](https://sonarsource.github.io/rspec/#/rspec/S881/javascript) | Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression | | | | | | -| [no-nested-switch](https://sonarsource.github.io/rspec/#/rspec/S1821/javascript) | "switch" statements should not be nested | | | | | | -| [no-nested-template-literals](https://sonarsource.github.io/rspec/#/rspec/S4624/javascript) | Template literals should not be nested | βœ… | | | | | -| [no-one-iteration-loop](https://sonarsource.github.io/rspec/#/rspec/S1751/javascript) | Loops with at most one iteration should be refactored | βœ… | | | | | -| [no-os-command-from-path](https://sonarsource.github.io/rspec/#/rspec/S4036/javascript) | Searching OS commands in PATH is security-sensitive | βœ… | | | | | -| [no-parameter-reassignment](https://sonarsource.github.io/rspec/#/rspec/S1226/javascript) | Initial values of parameters, caught exceptions, and loop variables should not be ignored | βœ… | | | | | -| [no-primitive-wrappers](https://sonarsource.github.io/rspec/#/rspec/S1533/javascript) | Wrapper objects should not be used for primitive types | βœ… | | πŸ’‘ | | | -| [no-redeclare](https://sonarsource.github.io/rspec/#/rspec/S2814/javascript) | Variables and functions should not be redeclared | βœ… | | | | | -| [no-redundant-assignments](https://sonarsource.github.io/rspec/#/rspec/S4165/javascript) | Assignments should not be redundant | βœ… | | | | | -| [no-redundant-boolean](https://sonarsource.github.io/rspec/#/rspec/S1125/javascript) | Boolean literals should not be used in comparisons | βœ… | | | | | -| [no-redundant-jump](https://sonarsource.github.io/rspec/#/rspec/S3626/javascript) | Jump statements should not be redundant | βœ… | | πŸ’‘ | | | -| [no-redundant-optional](https://sonarsource.github.io/rspec/#/rspec/S4782/javascript) | Optional property declarations should not use both '?' and 'undefined' syntax | βœ… | | πŸ’‘ | πŸ’­ | | -| [no-redundant-parentheses](https://sonarsource.github.io/rspec/#/rspec/S1110/javascript) | Redundant pairs of parentheses should be removed | | | πŸ’‘ | | ❌ | -| [no-redundant-type-constituents](https://sonarsource.github.io/rspec/#/rspec/S6571/javascript) | Type constituents of unions and intersections should not be redundant | βœ… | | | πŸ’­ | | -| [no-reference-error](https://sonarsource.github.io/rspec/#/rspec/S3827/javascript) | Variables should be defined before being used | | | | | | -| [no-referrer-policy](https://sonarsource.github.io/rspec/#/rspec/S5736/javascript) | Disabling strict HTTP no-referrer policy is security-sensitive | βœ… | | | | | -| [no-require-or-define](https://sonarsource.github.io/rspec/#/rspec/S3533/javascript) | "import" should be used to include external code | | | | πŸ’­ | | -| [no-return-type-any](https://sonarsource.github.io/rspec/#/rspec/S4324/javascript) | Primitive return types should be used | | | | πŸ’­ | | -| [no-same-argument-assert](https://sonarsource.github.io/rspec/#/rspec/S5863/javascript) | Assertions should not be given twice the same argument | βœ… | | | | | -| [no-same-line-conditional](https://sonarsource.github.io/rspec/#/rspec/S3972/javascript) | Conditionals should start on new lines | βœ… | | πŸ’‘ | | | -| [no-selector-parameter](https://sonarsource.github.io/rspec/#/rspec/S2301/javascript) | Methods should not contain selector parameters | βœ… | | | πŸ’­ | | -| [no-self-compare](https://sonarsource.github.io/rspec/#/rspec/S6679/javascript) | "Number.isNaN()" should be used to check for "NaN" value | βœ… | | πŸ’‘ | | | -| [no-self-import](https://sonarsource.github.io/rspec/#/rspec/S7060/javascript) | Module should not import itself | βœ… | | πŸ’‘ | | | -| [no-skipped-test](https://sonarsource.github.io/rspec/#/rspec/S1607/javascript) | Tests should not be skipped without providing a reason | βœ… | | | | | -| [no-small-switch](https://sonarsource.github.io/rspec/#/rspec/S1301/javascript) | "if" statements should be preferred over "switch" when simpler | βœ… | | | | | -| [no-sonar-comments](https://sonarsource.github.io/rspec/#/rspec/S1291/javascript) | Track uses of "NOSONAR" comments | | | | | | -| [no-tab](https://sonarsource.github.io/rspec/#/rspec/S105/javascript) | Tabulation characters should not be used | | | | | ❌ | -| [no-table-as-layout](https://sonarsource.github.io/rspec/#/rspec/S5257/javascript) | HTML "<table>" should not be used for layout purposes | βœ… | | | | | -| [no-this-alias](https://sonarsource.github.io/rspec/#/rspec/S4327/javascript) | "this" should not be assigned to variables | | | | | | -| [no-throw-literal](https://sonarsource.github.io/rspec/#/rspec/S3696/javascript) | Literals should not be thrown | βœ… | | πŸ’‘ | πŸ’­ | | -| [no-try-promise](https://sonarsource.github.io/rspec/#/rspec/S4822/javascript) | Promise rejections should not be caught by "try" blocks | βœ… | | | πŸ’­ | | -| [no-undefined-argument](https://sonarsource.github.io/rspec/#/rspec/S4623/javascript) | "undefined" should not be passed as the value of optional parameters | βœ… | | πŸ’‘ | πŸ’­ | | -| [no-undefined-assignment](https://sonarsource.github.io/rspec/#/rspec/S2138/javascript) | "undefined" should not be assigned | | | | | | -| [no-unenclosed-multiline-block](https://sonarsource.github.io/rspec/#/rspec/S2681/javascript) | Multiline blocks should be enclosed in curly braces | βœ… | | | | | -| [no-uniq-key](https://sonarsource.github.io/rspec/#/rspec/S6486/javascript) | JSX list components keys should match up between renders | βœ… | | | | | -| [no-unknown-property](https://sonarsource.github.io/rspec/#/rspec/S6747/javascript) | JSX elements should not use unknown properties and attributes | βœ… | | πŸ’‘ | | | -| [no-unreachable](https://sonarsource.github.io/rspec/#/rspec/S1763/javascript) | All code should be reachable | βœ… | | πŸ’‘ | | | -| [no-unsafe](https://sonarsource.github.io/rspec/#/rspec/S6791/javascript) | React legacy lifecycle methods should not be used | βœ… | | | | | -| [no-unsafe-unzip](https://sonarsource.github.io/rspec/#/rspec/S5042/javascript) | Expanding archive files without controlling resource consumption is security-sensitive | βœ… | | | | | -| [no-unstable-nested-components](https://sonarsource.github.io/rspec/#/rspec/S6478/javascript) | React components should not be nested | βœ… | | | | | -| [no-unthrown-error](https://sonarsource.github.io/rspec/#/rspec/S3984/javascript) | Errors should not be created without being thrown | βœ… | | πŸ’‘ | | | -| [no-unused-collection](https://sonarsource.github.io/rspec/#/rspec/S4030/javascript) | Collection contents should be used | βœ… | | | | | -| [no-unused-expressions](https://sonarsource.github.io/rspec/#/rspec/S905/javascript) | Non-empty statements should change control flow or have at least one side-effect | βœ… | | | | | -| [no-unused-function-argument](https://sonarsource.github.io/rspec/#/rspec/S1172/javascript) | Unused function parameters should be removed | | | πŸ’‘ | | | -| [no-unused-private-class-members](https://sonarsource.github.io/rspec/#/rspec/S1068/javascript) | Unused private class members should be removed | βœ… | | πŸ’‘ | | | -| [no-use-of-empty-return-value](https://sonarsource.github.io/rspec/#/rspec/S3699/javascript) | The return value of void functions should not be used | βœ… | | | | | -| [no-useless-call](https://sonarsource.github.io/rspec/#/rspec/S6676/javascript) | Calls to ".call()" and ".apply()" methods should not be redundant | βœ… | | πŸ’‘ | | | -| [no-useless-catch](https://sonarsource.github.io/rspec/#/rspec/S2737/javascript) | "catch" clauses should do more than rethrow | βœ… | | | | | -| [no-useless-constructor](https://sonarsource.github.io/rspec/#/rspec/S6647/javascript) | Unnecessary constructors should be removed | βœ… | | πŸ’‘ | | | -| [no-useless-increment](https://sonarsource.github.io/rspec/#/rspec/S2123/javascript) | Values should not be uselessly incremented | βœ… | | | | | -| [no-useless-intersection](https://sonarsource.github.io/rspec/#/rspec/S4335/javascript) | Type intersections should use meaningful types | βœ… | | | πŸ’­ | | -| [no-useless-react-setstate](https://sonarsource.github.io/rspec/#/rspec/S6443/javascript) | React state setter function should not be called with its matching state variable | βœ… | | | | | -| [no-var](https://sonarsource.github.io/rspec/#/rspec/S3504/javascript) | Variables should be declared with "let" or "const" | βœ… | πŸ”§ | | | | -| [no-variable-usage-before-declaration](https://sonarsource.github.io/rspec/#/rspec/S1526/javascript) | Variables declared with "var" should be declared before they are used | | | | | | -| [no-vue-bypass-sanitization](https://sonarsource.github.io/rspec/#/rspec/S6299/javascript) | Disabling Vue.js built-in escaping is security-sensitive | βœ… | | | | | -| [no-weak-cipher](https://sonarsource.github.io/rspec/#/rspec/S5547/javascript) | Cipher algorithms should be robust | βœ… | | | | | -| [no-weak-keys](https://sonarsource.github.io/rspec/#/rspec/S4426/javascript) | Cryptographic keys should be robust | βœ… | | | | | -| [no-wildcard-import](https://sonarsource.github.io/rspec/#/rspec/S2208/javascript) | Wildcard imports should not be used | | | | | | -| [non-existent-operator](https://sonarsource.github.io/rspec/#/rspec/S2757/javascript) | Non-existent operators '=+', '=-' and '=!' should not be used | βœ… | | πŸ’‘ | | | -| [non-number-in-arithmetic-expression](https://sonarsource.github.io/rspec/#/rspec/S3760/javascript) | Arithmetic operators should only have numbers as operands | | | | πŸ’­ | | -| [null-dereference](https://sonarsource.github.io/rspec/#/rspec/S2259/javascript) | Properties of variables with "null" or "undefined" values should not be accessed | βœ… | | | πŸ’­ | | -| [object-alt-content](https://sonarsource.github.io/rspec/#/rspec/S5264/javascript) | "" tags should provide an alternative content | βœ… | | | | | -| [object-shorthand](https://sonarsource.github.io/rspec/#/rspec/S3498/javascript) | Object literal shorthand syntax should be used | | πŸ”§ | | | | -| [operation-returning-nan](https://sonarsource.github.io/rspec/#/rspec/S3757/javascript) | Arithmetic operations should not result in "NaN" | | | | πŸ’­ | | -| [os-command](https://sonarsource.github.io/rspec/#/rspec/S4721/javascript) | Using shell interpreter when executing OS commands is security-sensitive | βœ… | | | | | -| [post-message](https://sonarsource.github.io/rspec/#/rspec/S2819/javascript) | Origins should be verified during cross-origin communications | βœ… | | | πŸ’­ | | -| [prefer-default-last](https://sonarsource.github.io/rspec/#/rspec/S4524/javascript) | "default" clauses should be last | βœ… | | | | | -| [prefer-enum-initializers](https://sonarsource.github.io/rspec/#/rspec/S6572/javascript) | Enum member values should be either all initialized or none | βœ… | | πŸ’‘ | | | -| [prefer-for-of](https://sonarsource.github.io/rspec/#/rspec/S4138/javascript) | "for of" should be used with Iterables | βœ… | | πŸ’‘ | | | -| [prefer-function-type](https://sonarsource.github.io/rspec/#/rspec/S6598/javascript) | Function types should be preferred | βœ… | πŸ”§ | | | | -| [prefer-immediate-return](https://sonarsource.github.io/rspec/#/rspec/S1488/javascript) | Local variables should not be declared and then immediately returned or thrown | | πŸ”§ | | | | -| [prefer-namespace-keyword](https://sonarsource.github.io/rspec/#/rspec/S4156/javascript) | "module" should not be used | βœ… | πŸ”§ | | | | -| [prefer-nullish-coalescing](https://sonarsource.github.io/rspec/#/rspec/S6606/javascript) | Nullish coalescing should be preferred | βœ… | | πŸ’‘ | πŸ’­ | | -| [prefer-object-literal](https://sonarsource.github.io/rspec/#/rspec/S2428/javascript) | Object literal syntax should be used | | | | | | -| [prefer-object-spread](https://sonarsource.github.io/rspec/#/rspec/S6661/javascript) | Object spread syntax should be used instead of "Object.assign" | βœ… | πŸ”§ | | | | -| [prefer-promise-shorthand](https://sonarsource.github.io/rspec/#/rspec/S4634/javascript) | Shorthand promises should be used | βœ… | | πŸ’‘ | | | -| [prefer-single-boolean-return](https://sonarsource.github.io/rspec/#/rspec/S1126/javascript) | Return of boolean expressions should not be wrapped into an "if-then-else" statement | βœ… | | πŸ’‘ | | | -| [prefer-spread](https://sonarsource.github.io/rspec/#/rspec/S6666/javascript) | Spread syntax should be used instead of "apply()" | βœ… | | πŸ’‘ | | | -| [prefer-string-starts-ends-with](https://sonarsource.github.io/rspec/#/rspec/S6557/javascript) | Ends of strings should be checked with "startsWith()" and "endsWith()" | βœ… | πŸ”§ | πŸ’‘ | πŸ’­ | | -| [prefer-template](https://sonarsource.github.io/rspec/#/rspec/S3512/javascript) | Template strings should be used instead of concatenation | | πŸ”§ | | | | -| [prefer-type-guard](https://sonarsource.github.io/rspec/#/rspec/S4322/javascript) | Type predicates should be used | βœ… | | πŸ’‘ | | | -| [prefer-while](https://sonarsource.github.io/rspec/#/rspec/S1264/javascript) | A "while" loop should be used instead of a "for" loop | βœ… | πŸ”§ | | | | -| [process-argv](https://sonarsource.github.io/rspec/#/rspec/S4823/javascript) | Using command line arguments is security-sensitive | | | | | ❌ | -| [production-debug](https://sonarsource.github.io/rspec/#/rspec/S4507/javascript) | Delivering code in production with debug features activated is security-sensitive | βœ… | | | | | -| [pseudo-random](https://sonarsource.github.io/rspec/#/rspec/S2245/javascript) | Using pseudorandom number generators (PRNGs) is security-sensitive | βœ… | | | | | -| [public-static-readonly](https://sonarsource.github.io/rspec/#/rspec/S1444/javascript) | Public "static" fields should be read-only | βœ… | | πŸ’‘ | | | -| [publicly-writable-directories](https://sonarsource.github.io/rspec/#/rspec/S5443/javascript) | Using publicly writable directories is security-sensitive | βœ… | | | | | -| [reduce-initial-value](https://sonarsource.github.io/rspec/#/rspec/S6959/javascript) | "Array.reduce()" calls should include an initial value | βœ… | | | πŸ’­ | | -| [redundant-type-aliases](https://sonarsource.github.io/rspec/#/rspec/S6564/javascript) | Redundant type aliases should not be used | βœ… | | | | | -| [regex-complexity](https://sonarsource.github.io/rspec/#/rspec/S5843/javascript) | Regular expressions should not be too complicated | βœ… | | | πŸ’­ | | -| [regular-expr](https://sonarsource.github.io/rspec/#/rspec/S4784/javascript) | Using regular expressions is security-sensitive | | | | | ❌ | -| [rules-of-hooks](https://sonarsource.github.io/rspec/#/rspec/S6440/javascript) | React Hooks should be properly called | βœ… | | | | | -| [semi](https://sonarsource.github.io/rspec/#/rspec/S1438/javascript) | Statements should end with semicolons | | πŸ”§ | | | ❌ | -| [session-regeneration](https://sonarsource.github.io/rspec/#/rspec/S5876/javascript) | A new session should be created during user authentication | βœ… | | | | | -| [shorthand-property-grouping](https://sonarsource.github.io/rspec/#/rspec/S3499/javascript) | Shorthand object properties should be grouped at the beginning or end of an object declaration | | | | | | -| [single-char-in-character-classes](https://sonarsource.github.io/rspec/#/rspec/S6397/javascript) | Character classes in regular expressions should not contain only one character | βœ… | | | πŸ’­ | | -| [single-character-alternation](https://sonarsource.github.io/rspec/#/rspec/S6035/javascript) | Single-character alternations in regular expressions should be replaced with character classes | βœ… | | | πŸ’­ | | -| [slow-regex](https://sonarsource.github.io/rspec/#/rspec/S5852/javascript) | Using slow regular expressions is security-sensitive | βœ… | | | πŸ’­ | | -| [sockets](https://sonarsource.github.io/rspec/#/rspec/S4818/javascript) | Using Sockets is security-sensitive | | | | | ❌ | -| [sonar-block-scoped-var](https://sonarsource.github.io/rspec/#/rspec/S2392/javascript) | Variables should be used in the blocks where they are declared | βœ… | | | | | -| [sonar-jsx-no-leaked-render](https://sonarsource.github.io/rspec/#/rspec/S6439/javascript) | React components should not render non-boolean condition values | βœ… | | πŸ’‘ | πŸ’­ | | -| [sonar-max-lines](https://sonarsource.github.io/rspec/#/rspec/S104/javascript) | Files should not have too many lines of code | | | | | | -| [sonar-max-lines-per-function](https://sonarsource.github.io/rspec/#/rspec/S138/javascript) | Functions should not have too many lines of code | | | | | | -| [sonar-max-params](https://sonarsource.github.io/rspec/#/rspec/S107/javascript) | Functions should not have too many parameters | βœ… | | | | | -| [sonar-no-control-regex](https://sonarsource.github.io/rspec/#/rspec/S6324/javascript) | Regular expressions should not contain control characters | βœ… | | | πŸ’­ | | -| [sonar-no-dupe-keys](https://sonarsource.github.io/rspec/#/rspec/S1534/javascript) | Member names should not be duplicated within a class or object literal | βœ… | | πŸ’‘ | | | -| [sonar-no-empty-character-class](https://sonarsource.github.io/rspec/#/rspec/S2639/javascript) | Empty character classes should not be used | βœ… | | | πŸ’­ | | -| [sonar-no-fallthrough](https://sonarsource.github.io/rspec/#/rspec/S128/javascript) | Switch cases should end with an unconditional "break" statement | βœ… | | | | | -| [sonar-no-invalid-regexp](https://sonarsource.github.io/rspec/#/rspec/S5856/javascript) | Regular expressions should be syntactically valid | βœ… | | | πŸ’­ | | -| [sonar-no-magic-numbers](https://sonarsource.github.io/rspec/#/rspec/S109/javascript) | Magic numbers should not be used | | | | | | -| [sonar-no-misleading-character-class](https://sonarsource.github.io/rspec/#/rspec/S5868/javascript) | Unicode Grapheme Clusters should be avoided inside regex character classes | βœ… | | πŸ’‘ | πŸ’­ | | -| [sonar-no-regex-spaces](https://sonarsource.github.io/rspec/#/rspec/S6326/javascript) | Regular expressions should not contain multiple spaces | βœ… | | πŸ’‘ | πŸ’­ | | -| [sonar-no-unused-class-component-methods](https://sonarsource.github.io/rspec/#/rspec/S6441/javascript) | Unused methods of React components should be removed | βœ… | | | | | -| [sonar-no-unused-vars](https://sonarsource.github.io/rspec/#/rspec/S1481/javascript) | Unused local variables and functions should be removed | βœ… | | | | | -| [sonar-prefer-optional-chain](https://sonarsource.github.io/rspec/#/rspec/S6582/javascript) | Optional chaining should be preferred | βœ… | πŸ”§ | πŸ’‘ | | | -| [sonar-prefer-read-only-props](https://sonarsource.github.io/rspec/#/rspec/S6759/javascript) | React props should be read-only | βœ… | | πŸ’‘ | πŸ’­ | | -| [sonar-prefer-regexp-exec](https://sonarsource.github.io/rspec/#/rspec/S6594/javascript) | "RegExp.exec()" should be preferred over "String.match()" | βœ… | | πŸ’‘ | πŸ’­ | | -| [sql-queries](https://sonarsource.github.io/rspec/#/rspec/S2077/javascript) | Formatting SQL queries is security-sensitive | βœ… | | | | | -| [stable-tests](https://sonarsource.github.io/rspec/#/rspec/S5973/javascript) | Tests should be stable | βœ… | | | | | -| [standard-input](https://sonarsource.github.io/rspec/#/rspec/S4829/javascript) | Reading the Standard Input is security-sensitive | | | | | ❌ | -| [stateful-regex](https://sonarsource.github.io/rspec/#/rspec/S6351/javascript) | Regular expressions with the global flag should be used with caution | βœ… | | | | | -| [strict-transport-security](https://sonarsource.github.io/rspec/#/rspec/S5739/javascript) | Disabling Strict-Transport-Security policy is security-sensitive | βœ… | | | | | -| [strings-comparison](https://sonarsource.github.io/rspec/#/rspec/S3003/javascript) | Comparison operators should not be used with strings | | | | πŸ’­ | | -| [super-invocation](https://sonarsource.github.io/rspec/#/rspec/S3854/javascript) | "super()" should be invoked appropriately | βœ… | | | | | -| [switch-without-default](https://sonarsource.github.io/rspec/#/rspec/S131/javascript) | "switch" statements should have "default" clauses | | | πŸ’‘ | πŸ’­ | | -| [table-header](https://sonarsource.github.io/rspec/#/rspec/S5256/javascript) | Tables should have headers | βœ… | | | | | -| [table-header-reference](https://sonarsource.github.io/rspec/#/rspec/S5260/javascript) | Table cells should reference their headers | βœ… | | | | | -| [test-check-exception](https://sonarsource.github.io/rspec/#/rspec/S5958/javascript) | Tests should check which exception is thrown | βœ… | | | | | -| [todo-tag](https://sonarsource.github.io/rspec/#/rspec/S1135/javascript) | Track uses of "TODO" tags | βœ… | | | | | -| [too-many-break-or-continue-in-loop](https://sonarsource.github.io/rspec/#/rspec/S135/javascript) | Loops should not contain more than a single "break" or "continue" statement | | | | | | -| [unicode-aware-regex](https://sonarsource.github.io/rspec/#/rspec/S5867/javascript) | Regular expressions using Unicode character classes or property escapes should enable the unicode flag | | | | πŸ’­ | | -| [unnecessary-character-escapes](https://sonarsource.github.io/rspec/#/rspec/S6535/javascript) | Unnecessary character escapes should be removed | βœ… | | πŸ’‘ | | | -| [unused-import](https://sonarsource.github.io/rspec/#/rspec/S1128/javascript) | Unnecessary imports should be removed | βœ… | | πŸ’‘ | πŸ’­ | | -| [unused-named-groups](https://sonarsource.github.io/rspec/#/rspec/S5860/javascript) | Names of regular expressions named groups should be used | βœ… | | | πŸ’­ | | -| [unverified-certificate](https://sonarsource.github.io/rspec/#/rspec/S4830/javascript) | Server certificates should be verified during SSL/TLS connections | βœ… | | | | | -| [unverified-hostname](https://sonarsource.github.io/rspec/#/rspec/S5527/javascript) | Server hostnames should be verified during SSL/TLS connections | βœ… | | | | | -| [updated-const-var](https://sonarsource.github.io/rspec/#/rspec/S3500/javascript) | "const" variables should not be reassigned | βœ… | | | | | -| [updated-loop-counter](https://sonarsource.github.io/rspec/#/rspec/S2310/javascript) | Loop counters should not be assigned within the loop body | βœ… | | | | | -| [use-isnan](https://sonarsource.github.io/rspec/#/rspec/S2688/javascript) | "NaN" should not be used in comparisons | βœ… | | πŸ’‘ | | | -| [use-type-alias](https://sonarsource.github.io/rspec/#/rspec/S4323/javascript) | Type aliases should be used | βœ… | | | | | -| [useless-string-operation](https://sonarsource.github.io/rspec/#/rspec/S1154/javascript) | Results of operations on strings should not be ignored | | | | πŸ’­ | ❌ | -| [values-not-convertible-to-numbers](https://sonarsource.github.io/rspec/#/rspec/S3758/javascript) | Values not convertible to numbers should not be used in numeric comparisons | | | | πŸ’­ | | -| [variable-name](https://sonarsource.github.io/rspec/#/rspec/S117/javascript) | Variable, property and parameter names should comply with a naming convention | | | | | | -| [void-use](https://sonarsource.github.io/rspec/#/rspec/S3735/javascript) | "void" should not be used | βœ… | | | πŸ’­ | | -| [weak-ssl](https://sonarsource.github.io/rspec/#/rspec/S4423/javascript) | Weak SSL/TLS protocols should not be used | βœ… | | | | | -| [web-sql-database](https://sonarsource.github.io/rspec/#/rspec/S2817/javascript) | Web SQL databases should not be used | | | | πŸ’­ | ❌ | -| [x-powered-by](https://sonarsource.github.io/rspec/#/rspec/S5689/javascript) | Disclosing fingerprints from web application technologies is security-sensitive | βœ… | | | | | -| [xml-parser-xxe](https://sonarsource.github.io/rspec/#/rspec/S2755/javascript) | XML parsers should not be vulnerable to XXE attacks | βœ… | | | | | -| [xpath](https://sonarsource.github.io/rspec/#/rspec/S4817/javascript) | Executing XPath expressions is security-sensitive | | | | | ❌ | +| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ | +| :--------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------- | :-- | :-- | :-- | :-- | :-- | +| [anchor-precedence](https://sonarsource.github.io/rspec/#/rspec/S5850/javascript) | Alternatives in regular expressions should be grouped when used with anchors | βœ… | | | πŸ’­ | | +| [argument-type](https://sonarsource.github.io/rspec/#/rspec/S3782/javascript) | Arguments to built-in functions should match documented types | βœ… | | | πŸ’­ | | +| [arguments-order](https://sonarsource.github.io/rspec/#/rspec/S2234/javascript) | Parameters should be passed in the correct order | βœ… | | | πŸ’­ | | +| [arguments-usage](https://sonarsource.github.io/rspec/#/rspec/S3513/javascript) | "arguments" should not be accessed directly | | | | | | +| [array-callback-without-return](https://sonarsource.github.io/rspec/#/rspec/S3796/javascript) | Callbacks of array methods should have return statements | βœ… | | | πŸ’­ | | +| [array-constructor](https://sonarsource.github.io/rspec/#/rspec/S1528/javascript) | Array constructors should not be used | | | πŸ’‘ | | | +| [arrow-function-convention](https://sonarsource.github.io/rspec/#/rspec/S3524/javascript) | Braces and parentheses should be used consistently with arrow functions | | | | | | +| [assertions-in-tests](https://sonarsource.github.io/rspec/#/rspec/S2699/javascript) | Tests should include assertions | βœ… | | | | | +| [aws-apigateway-public-api](https://sonarsource.github.io/rspec/#/rspec/S6333/javascript) | Creating public APIs is security-sensitive | βœ… | | | | | +| [aws-ec2-rds-dms-public](https://sonarsource.github.io/rspec/#/rspec/S6329/javascript) | Allowing public network access to cloud resources is security-sensitive | βœ… | | | | | +| [aws-ec2-unencrypted-ebs-volume](https://sonarsource.github.io/rspec/#/rspec/S6275/javascript) | Using unencrypted EBS volumes is security-sensitive | βœ… | | | | | +| [aws-efs-unencrypted](https://sonarsource.github.io/rspec/#/rspec/S6332/javascript) | Using unencrypted EFS file systems is security-sensitive | βœ… | | | | | +| [aws-iam-all-privileges](https://sonarsource.github.io/rspec/#/rspec/S6302/javascript) | Policies granting all privileges are security-sensitive | βœ… | | | | | +| [aws-iam-all-resources-accessible](https://sonarsource.github.io/rspec/#/rspec/S6304/javascript) | Policies granting access to all resources of an account are security-sensitive | | | | | | +| [aws-iam-privilege-escalation](https://sonarsource.github.io/rspec/#/rspec/S6317/javascript) | AWS IAM policies should limit the scope of permissions given | βœ… | | | | | +| [aws-iam-public-access](https://sonarsource.github.io/rspec/#/rspec/S6270/javascript) | Policies authorizing public access to resources are security-sensitive | βœ… | | | | | +| [aws-opensearchservice-domain](https://sonarsource.github.io/rspec/#/rspec/S6308/javascript) | Using unencrypted Elasticsearch domains is security-sensitive | βœ… | | | | | +| [aws-rds-unencrypted-databases](https://sonarsource.github.io/rspec/#/rspec/S6303/javascript) | Using unencrypted RDS DB resources is security-sensitive | βœ… | | | | | +| [aws-restricted-ip-admin-access](https://sonarsource.github.io/rspec/#/rspec/S6321/javascript) | Administration services access should be restricted to specific IP addresses | βœ… | | | | | +| [aws-s3-bucket-granted-access](https://sonarsource.github.io/rspec/#/rspec/S6265/javascript) | Granting access to S3 buckets to all or authenticated users is security-sensitive | βœ… | | | | | +| [aws-s3-bucket-insecure-http](https://sonarsource.github.io/rspec/#/rspec/S6249/javascript) | Authorizing HTTP communications with S3 buckets is security-sensitive | βœ… | | | | | +| [aws-s3-bucket-public-access](https://sonarsource.github.io/rspec/#/rspec/S6281/javascript) | Allowing public ACLs or policies on a S3 bucket is security-sensitive | βœ… | | | | | +| [aws-s3-bucket-server-encryption](https://sonarsource.github.io/rspec/#/rspec/S6245/javascript) | Disabling server-side encryption of S3 buckets is security-sensitive | | | | | ❌ | +| [aws-s3-bucket-versioning](https://sonarsource.github.io/rspec/#/rspec/S6252/javascript) | Disabling versioning of S3 buckets is security-sensitive | βœ… | | | | | +| [aws-sagemaker-unencrypted-notebook](https://sonarsource.github.io/rspec/#/rspec/S6319/javascript) | Using unencrypted SageMaker notebook instances is security-sensitive | βœ… | | | | | +| [aws-sns-unencrypted-topics](https://sonarsource.github.io/rspec/#/rspec/S6327/javascript) | Using unencrypted SNS topics is security-sensitive | βœ… | | | | | +| [aws-sqs-unencrypted-queue](https://sonarsource.github.io/rspec/#/rspec/S6330/javascript) | Using unencrypted SQS queues is security-sensitive | βœ… | | | | | +| [bitwise-operators](https://sonarsource.github.io/rspec/#/rspec/S1529/javascript) | Bitwise operators should not be used in boolean contexts | βœ… | | | | | +| [block-scoped-var](https://sonarsource.github.io/rspec/#/rspec/S2392/javascript) | Variables should be used in the blocks where they are declared | βœ… | | | | | +| [bool-param-default](https://sonarsource.github.io/rspec/#/rspec/S4798/javascript) | Optional boolean parameters should have default value | | | | | | +| [call-argument-line](https://sonarsource.github.io/rspec/#/rspec/S1472/javascript) | Function call arguments should not start on new lines | βœ… | | | | | +| [certificate-transparency](https://sonarsource.github.io/rspec/#/rspec/S5742/javascript) | Disabling Certificate Transparency monitoring is security-sensitive | βœ… | | | | | +| [chai-determinate-assertion](https://sonarsource.github.io/rspec/#/rspec/S6092/javascript) | Chai assertions should have only one reason to succeed | βœ… | | | | | +| [class-name](https://sonarsource.github.io/rspec/#/rspec/S101/javascript) | Class names should comply with a naming convention | βœ… | | | | | +| [class-prototype](https://sonarsource.github.io/rspec/#/rspec/S3525/javascript) | Class methods should be used instead of "prototype" assignments | | | | πŸ’­ | | +| [code-eval](https://sonarsource.github.io/rspec/#/rspec/S1523/javascript) | Dynamically executing code is security-sensitive | βœ… | | | | | +| [cognitive-complexity](https://sonarsource.github.io/rspec/#/rspec/S3776/javascript) | Cognitive Complexity of functions should not be too high | βœ… | | | | | +| [comma-or-logical-or-case](https://sonarsource.github.io/rspec/#/rspec/S3616/javascript) | Comma and logical OR operators should not be used in switch cases | βœ… | | | | | +| [comment-regex](https://sonarsource.github.io/rspec/#/rspec/S124/javascript) | Track comments matching a regular expression | | | | | | +| [concise-regex](https://sonarsource.github.io/rspec/#/rspec/S6353/javascript) | Regular expression quantifiers and character classes should be used concisely | βœ… | | | πŸ’­ | | +| [conditional-indentation](https://sonarsource.github.io/rspec/#/rspec/S3973/javascript) | A conditionally executed single line should be denoted by indentation | | | | | ❌ | +| [confidential-information-logging](https://sonarsource.github.io/rspec/#/rspec/S5757/javascript) | Allowing confidential information to be logged is security-sensitive | βœ… | | | | | +| [constructor-for-side-effects](https://sonarsource.github.io/rspec/#/rspec/S1848/javascript) | Objects should not be created to be dropped immediately without being used | βœ… | | | | | +| [content-length](https://sonarsource.github.io/rspec/#/rspec/S5693/javascript) | Allowing requests with excessive content length is security-sensitive | βœ… | | | | | +| [content-security-policy](https://sonarsource.github.io/rspec/#/rspec/S5728/javascript) | Disabling content security policy fetch directives is security-sensitive | βœ… | | | | | +| [cookie-no-httponly](https://sonarsource.github.io/rspec/#/rspec/S3330/javascript) | Creating cookies without the "HttpOnly" flag is security-sensitive | βœ… | | | | | +| [cookies](https://sonarsource.github.io/rspec/#/rspec/S2255/javascript) | Writing cookies is security-sensitive | | | | | ❌ | +| [cors](https://sonarsource.github.io/rspec/#/rspec/S5122/javascript) | Having a permissive Cross-Origin Resource Sharing policy is security-sensitive | βœ… | | | | | +| [csrf](https://sonarsource.github.io/rspec/#/rspec/S4502/javascript) | Disabling CSRF protections is security-sensitive | βœ… | | | | | +| [cyclomatic-complexity](https://sonarsource.github.io/rspec/#/rspec/S1541/javascript) | Cyclomatic Complexity of functions should not be too high | | | | | | +| [declarations-in-global-scope](https://sonarsource.github.io/rspec/#/rspec/S3798/javascript) | Variables and functions should not be declared in the global scope | | | | | | +| [deprecation](https://sonarsource.github.io/rspec/#/rspec/S1874/javascript) | Deprecated APIs should not be used | βœ… | | | πŸ’­ | | +| [destructuring-assignment-syntax](https://sonarsource.github.io/rspec/#/rspec/S3514/javascript) | Destructuring syntax should be used for assignments | | | | | | +| [different-types-comparison](https://sonarsource.github.io/rspec/#/rspec/S3403/javascript) | Strict equality operators should not be used with dissimilar types | βœ… | | πŸ’‘ | πŸ’­ | | +| [disabled-auto-escaping](https://sonarsource.github.io/rspec/#/rspec/S5247/javascript) | Disabling auto-escaping in template engines is security-sensitive | βœ… | | | πŸ’­ | | +| [disabled-resource-integrity](https://sonarsource.github.io/rspec/#/rspec/S5725/javascript) | Using remote artifacts without integrity checks is security-sensitive | βœ… | | | πŸ’­ | | +| [disabled-timeout](https://sonarsource.github.io/rspec/#/rspec/S6080/javascript) | Disabling Mocha timeouts should be explicit | βœ… | | | | | +| [dns-prefetching](https://sonarsource.github.io/rspec/#/rspec/S5743/javascript) | Allowing browsers to perform DNS prefetching is security-sensitive | | | | | ❌ | +| [duplicates-in-character-class](https://sonarsource.github.io/rspec/#/rspec/S5869/javascript) | Character classes in regular expressions should not contain the same character twice | βœ… | | | πŸ’­ | | +| [elseif-without-else](https://sonarsource.github.io/rspec/#/rspec/S126/javascript) | "if ... else if" constructs should end with "else" clauses | | | | | | +| [empty-string-repetition](https://sonarsource.github.io/rspec/#/rspec/S5842/javascript) | Repeated patterns in regular expressions should not match the empty string | βœ… | | | πŸ’­ | | +| [encryption](https://sonarsource.github.io/rspec/#/rspec/S4787/javascript) | Encrypting data is security-sensitive | | | | | ❌ | +| [encryption-secure-mode](https://sonarsource.github.io/rspec/#/rspec/S5542/javascript) | Encryption algorithms should be used with secure mode and padding scheme | βœ… | | | | | +| [enforce-trailing-comma](https://sonarsource.github.io/rspec/#/rspec/S3723/javascript) | Trailing commas should be used | | πŸ”§ | | | ❌ | +| [existing-groups](https://sonarsource.github.io/rspec/#/rspec/S6328/javascript) | Replacement strings should reference existing regular expression groups | βœ… | | | πŸ’­ | | +| [expression-complexity](https://sonarsource.github.io/rspec/#/rspec/S1067/javascript) | Expressions should not be too complex | | | | | | +| [file-header](https://sonarsource.github.io/rspec/#/rspec/S1451/javascript) | Track lack of copyright and license headers | | | | | | +| [file-name-differ-from-class](https://sonarsource.github.io/rspec/#/rspec/S3317/javascript) | Default export names and file names should match | | | | | | +| [file-permissions](https://sonarsource.github.io/rspec/#/rspec/S2612/javascript) | Setting loose POSIX file permissions is security-sensitive | βœ… | | | | | +| [file-uploads](https://sonarsource.github.io/rspec/#/rspec/S2598/javascript) | File uploads should be restricted | βœ… | | | | | +| [fixme-tag](https://sonarsource.github.io/rspec/#/rspec/S1134/javascript) | Track uses of "FIXME" tags | βœ… | | | | | +| [for-in](https://sonarsource.github.io/rspec/#/rspec/S1535/javascript) | "for...in" loops should filter properties before acting on them | | | | | | +| [for-loop-increment-sign](https://sonarsource.github.io/rspec/#/rspec/S2251/javascript) | A "for" loop update clause should move the counter in the right direction | βœ… | | | | | +| [frame-ancestors](https://sonarsource.github.io/rspec/#/rspec/S5732/javascript) | Disabling content security policy frame-ancestors directive is security-sensitive | βœ… | | | | | +| [function-inside-loop](https://sonarsource.github.io/rspec/#/rspec/S1515/javascript) | Functions should not be defined inside loops | βœ… | | | | | +| [function-name](https://sonarsource.github.io/rspec/#/rspec/S100/javascript) | Function and method names should comply with a naming convention | | | | | | +| [function-return-type](https://sonarsource.github.io/rspec/#/rspec/S3800/javascript) | Functions should always return the same type | βœ… | | | πŸ’­ | | +| [future-reserved-words](https://sonarsource.github.io/rspec/#/rspec/S1527/javascript) | Future reserved words should not be used as identifiers | βœ… | | | | | +| [generator-without-yield](https://sonarsource.github.io/rspec/#/rspec/S3531/javascript) | Generators should explicitly "yield" a value | βœ… | | | | | +| [hashing](https://sonarsource.github.io/rspec/#/rspec/S4790/javascript) | Using weak hashing algorithms is security-sensitive | βœ… | | | | | +| [hidden-files](https://sonarsource.github.io/rspec/#/rspec/S5691/javascript) | Statically serving hidden files is security-sensitive | βœ… | | | | | +| [in-operator-type-error](https://sonarsource.github.io/rspec/#/rspec/S3785/javascript) | "in" should not be used with primitive types | βœ… | | | πŸ’­ | | +| [inconsistent-function-call](https://sonarsource.github.io/rspec/#/rspec/S3686/javascript) | Functions should be called consistently with or without "new" | βœ… | | | | | +| [index-of-compare-to-positive-number](https://sonarsource.github.io/rspec/#/rspec/S2692/javascript) | "indexOf" checks should not be for positive numbers | βœ… | | | πŸ’­ | | +| [insecure-cookie](https://sonarsource.github.io/rspec/#/rspec/S2092/javascript) | Creating cookies without the "secure" flag is security-sensitive | βœ… | | | | | +| [insecure-jwt-token](https://sonarsource.github.io/rspec/#/rspec/S5659/javascript) | JWT should be signed and verified with strong cipher algorithms | βœ… | | | | | +| [inverted-assertion-arguments](https://sonarsource.github.io/rspec/#/rspec/S3415/javascript) | Assertion arguments should be passed in the correct order | βœ… | | πŸ’‘ | | | +| [jsx-no-leaked-render](https://sonarsource.github.io/rspec/#/rspec/S6439/javascript) | React components should not render non-boolean condition values | βœ… | | πŸ’‘ | πŸ’­ | | +| [label-position](https://sonarsource.github.io/rspec/#/rspec/S1439/javascript) | Only "while", "do", "for" and "switch" statements should be labelled | βœ… | | | | | +| [link-with-target-blank](https://sonarsource.github.io/rspec/#/rspec/S5148/javascript) | Authorizing an opened window to access back to the originating window is security-sensitive | βœ… | | | | | +| [max-lines](https://sonarsource.github.io/rspec/#/rspec/S104/javascript) | Files should not have too many lines of code | | | | | | +| [max-lines-per-function](https://sonarsource.github.io/rspec/#/rspec/S138/javascript) | Functions should not have too many lines of code | | | | | | +| [max-switch-cases](https://sonarsource.github.io/rspec/#/rspec/S1479/javascript) | "switch" statements should not have too many "case" clauses | βœ… | | | | | +| [max-union-size](https://sonarsource.github.io/rspec/#/rspec/S4622/javascript) | Union types should not have too many elements | | | | | | +| [misplaced-loop-counter](https://sonarsource.github.io/rspec/#/rspec/S1994/javascript) | "for" loop increment clauses should modify the loops' counters | βœ… | | | | | +| [nested-control-flow](https://sonarsource.github.io/rspec/#/rspec/S134/javascript) | Control flow statements "if", "for", "while", "switch" and "try" should not be nested too deeply | | | | | | +| [new-operator-misuse](https://sonarsource.github.io/rspec/#/rspec/S2999/javascript) | "new" should only be used with functions and classes | βœ… | | | πŸ’­ | | +| [no-all-duplicated-branches](https://sonarsource.github.io/rspec/#/rspec/S3923/javascript) | All branches in a conditional structure should not have exactly the same implementation | βœ… | | | | | +| [no-alphabetical-sort](https://sonarsource.github.io/rspec/#/rspec/S2871/javascript) | "Array.prototype.sort()" and "Array.prototype.toSorted()" should use a compare function | βœ… | | πŸ’‘ | πŸ’­ | | +| [no-angular-bypass-sanitization](https://sonarsource.github.io/rspec/#/rspec/S6268/javascript) | Disabling Angular built-in sanitization is security-sensitive | βœ… | | | | | +| [no-array-delete](https://sonarsource.github.io/rspec/#/rspec/S2870/javascript) | "delete" should not be used on arrays | βœ… | | | πŸ’­ | | +| [no-associative-arrays](https://sonarsource.github.io/rspec/#/rspec/S3579/javascript) | Array indexes should be numeric | βœ… | | | πŸ’­ | | +| [no-async-constructor](https://sonarsource.github.io/rspec/#/rspec/S7059/javascript) | Constructors should not contain asynchronous operations | βœ… | | | | | +| [no-built-in-override](https://sonarsource.github.io/rspec/#/rspec/S2424/javascript) | Built-in objects should not be overridden | | | | | | +| [no-case-label-in-switch](https://sonarsource.github.io/rspec/#/rspec/S1219/javascript) | "switch" statements should not contain non-case labels | βœ… | | | | | +| [no-clear-text-protocols](https://sonarsource.github.io/rspec/#/rspec/S5332/javascript) | Using clear-text protocols is security-sensitive | βœ… | | | | | +| [no-code-after-done](https://sonarsource.github.io/rspec/#/rspec/S6079/javascript) | Tests should not execute any code after "done()" is called | βœ… | | | | | +| [no-collapsible-if](https://sonarsource.github.io/rspec/#/rspec/S1066/javascript) | Mergeable "if" statements should be combined | | | | | | +| [no-collection-size-mischeck](https://sonarsource.github.io/rspec/#/rspec/S3981/javascript) | Collection size and array length comparisons should make sense | βœ… | | πŸ’‘ | πŸ’­ | | +| [no-commented-code](https://sonarsource.github.io/rspec/#/rspec/S125/javascript) | Sections of code should not be commented out | βœ… | | πŸ’‘ | | | +| [no-control-regex](https://sonarsource.github.io/rspec/#/rspec/S6324/javascript) | Regular expressions should not contain control characters | βœ… | | | πŸ’­ | | +| [no-dead-store](https://sonarsource.github.io/rspec/#/rspec/S1854/javascript) | Unused assignments should be removed | βœ… | | | | | +| [no-delete-var](https://sonarsource.github.io/rspec/#/rspec/S3001/javascript) | "delete" should be used only with object properties | βœ… | | | | | +| [no-duplicate-in-composite](https://sonarsource.github.io/rspec/#/rspec/S4621/javascript) | Union and intersection types should not include duplicated constituents | βœ… | | πŸ’‘ | | | +| [no-duplicate-string](https://sonarsource.github.io/rspec/#/rspec/S1192/javascript) | String literals should not be duplicated | | | | | | +| [no-duplicated-branches](https://sonarsource.github.io/rspec/#/rspec/S1871/javascript) | Two branches in a conditional structure should not have exactly the same implementation | βœ… | | | | | +| [no-element-overwrite](https://sonarsource.github.io/rspec/#/rspec/S4143/javascript) | Collection elements should not be replaced unconditionally | βœ… | | | | | +| [no-empty-after-reluctant](https://sonarsource.github.io/rspec/#/rspec/S6019/javascript) | Reluctant quantifiers in regular expressions should be followed by an expression that can't match the empty string | βœ… | | | πŸ’­ | | +| [no-empty-alternatives](https://sonarsource.github.io/rspec/#/rspec/S6323/javascript) | Alternation in regular expressions should not contain empty alternatives | βœ… | | | πŸ’­ | | +| [no-empty-character-class](https://sonarsource.github.io/rspec/#/rspec/S2639/javascript) | Empty character classes should not be used | βœ… | | | πŸ’­ | | +| [no-empty-collection](https://sonarsource.github.io/rspec/#/rspec/S4158/javascript) | Empty collections should not be accessed or iterated | βœ… | | | | | +| [no-empty-group](https://sonarsource.github.io/rspec/#/rspec/S6331/javascript) | Regular expressions should not contain empty groups | βœ… | | | πŸ’­ | | +| [no-empty-test-file](https://sonarsource.github.io/rspec/#/rspec/S2187/javascript) | Test files should contain at least one test case | βœ… | | | | | +| [no-equals-in-for-termination](https://sonarsource.github.io/rspec/#/rspec/S888/javascript) | Equality operators should not be used in "for" loop termination conditions | βœ… | | | | | +| [no-exclusive-tests](https://sonarsource.github.io/rspec/#/rspec/S6426/javascript) | Exclusive tests should not be commited to version control | βœ… | | πŸ’‘ | | | +| [no-extra-arguments](https://sonarsource.github.io/rspec/#/rspec/S930/javascript) | Function calls should not pass extra arguments | βœ… | | | | | +| [no-fallthrough](https://sonarsource.github.io/rspec/#/rspec/S128/javascript) | Switch cases should end with an unconditional "break" statement | βœ… | | | | | +| [no-for-in-iterable](https://sonarsource.github.io/rspec/#/rspec/S4139/javascript) | "for in" should not be used with iterables | | | | πŸ’­ | | +| [no-function-declaration-in-block](https://sonarsource.github.io/rspec/#/rspec/S1530/javascript) | Function declarations should not be made within blocks | | | | | | +| [no-global-this](https://sonarsource.github.io/rspec/#/rspec/S2990/javascript) | The global "this" object should not be used | βœ… | | πŸ’‘ | | | +| [no-globals-shadowing](https://sonarsource.github.io/rspec/#/rspec/S2137/javascript) | Special identifiers should not be bound or assigned | βœ… | | | | | +| [no-gratuitous-expressions](https://sonarsource.github.io/rspec/#/rspec/S2589/javascript) | Boolean expressions should not be gratuitous | βœ… | | | | | +| [no-hardcoded-ip](https://sonarsource.github.io/rspec/#/rspec/S1313/javascript) | Using hardcoded IP addresses is security-sensitive | βœ… | | | | | +| [no-hardcoded-passwords](https://sonarsource.github.io/rspec/#/rspec/S2068/javascript) | Hard-coded passwords are security-sensitive | βœ… | | | | | +| [no-hardcoded-secrets](https://sonarsource.github.io/rspec/#/rspec/S6418/javascript) | Hard-coded secrets are security-sensitive | βœ… | | | | | +| [no-hook-setter-in-body](https://sonarsource.github.io/rspec/#/rspec/S6442/javascript) | React's useState hook should not be used directly in the render function or body of a component | βœ… | | | | | +| [no-identical-conditions](https://sonarsource.github.io/rspec/#/rspec/S1862/javascript) | "if/else if" chains and "switch" cases should not have the same condition | βœ… | | | | | +| [no-identical-expressions](https://sonarsource.github.io/rspec/#/rspec/S1764/javascript) | Identical expressions should not be used on both sides of a binary operator | βœ… | | | | | +| [no-identical-functions](https://sonarsource.github.io/rspec/#/rspec/S4144/javascript) | Functions should not have identical implementations | βœ… | | | | | +| [no-ignored-exceptions](https://sonarsource.github.io/rspec/#/rspec/S2486/javascript) | Exceptions should not be ignored | βœ… | | | | | +| [no-ignored-return](https://sonarsource.github.io/rspec/#/rspec/S2201/javascript) | Return values from functions without side effects should not be ignored | βœ… | | | πŸ’­ | | +| [no-implicit-dependencies](https://sonarsource.github.io/rspec/#/rspec/S4328/javascript) | Dependencies should be explicit | | | | | | +| [no-implicit-global](https://sonarsource.github.io/rspec/#/rspec/S2703/javascript) | Variables should be declared explicitly | βœ… | | | | | +| [no-in-misuse](https://sonarsource.github.io/rspec/#/rspec/S4619/javascript) | "in" should not be used on arrays | βœ… | | πŸ’‘ | πŸ’­ | | +| [no-incomplete-assertions](https://sonarsource.github.io/rspec/#/rspec/S2970/javascript) | Assertions should be complete | βœ… | | | | | +| [no-inconsistent-returns](https://sonarsource.github.io/rspec/#/rspec/S3801/javascript) | Functions should use "return" consistently | | | | | | +| [no-incorrect-string-concat](https://sonarsource.github.io/rspec/#/rspec/S3402/javascript) | Strings and non-strings should not be added | | | | πŸ’­ | | +| [no-internal-api-use](https://sonarsource.github.io/rspec/#/rspec/S6627/javascript) | Users should not use internal APIs | βœ… | | | | | +| [no-intrusive-permissions](https://sonarsource.github.io/rspec/#/rspec/S5604/javascript) | Using intrusive permissions is security-sensitive | βœ… | | | | | +| [no-invalid-await](https://sonarsource.github.io/rspec/#/rspec/S4123/javascript) | "await" should only be used with promises | βœ… | | | πŸ’­ | | +| [no-invalid-regexp](https://sonarsource.github.io/rspec/#/rspec/S5856/javascript) | Regular expressions should be syntactically valid | βœ… | | | πŸ’­ | | +| [no-invariant-returns](https://sonarsource.github.io/rspec/#/rspec/S3516/javascript) | Function returns should not be invariant | βœ… | | | | | +| [no-inverted-boolean-check](https://sonarsource.github.io/rspec/#/rspec/S1940/javascript) | Boolean checks should not be inverted | βœ… | πŸ”§ | πŸ’‘ | | | +| [no-ip-forward](https://sonarsource.github.io/rspec/#/rspec/S5759/javascript) | Forwarding client IP address is security-sensitive | βœ… | | | | | +| [no-labels](https://sonarsource.github.io/rspec/#/rspec/S1119/javascript) | Labels should not be used | βœ… | | | | | +| [no-literal-call](https://sonarsource.github.io/rspec/#/rspec/S6958/javascript) | Literals should not be used as functions | βœ… | | | | | +| [no-mime-sniff](https://sonarsource.github.io/rspec/#/rspec/S5734/javascript) | Allowing browsers to sniff MIME types is security-sensitive | βœ… | | | | | +| [no-misleading-array-reverse](https://sonarsource.github.io/rspec/#/rspec/S4043/javascript) | Array-mutating methods should not be used misleadingly | βœ… | | πŸ’‘ | πŸ’­ | | +| [no-misleading-character-class](https://sonarsource.github.io/rspec/#/rspec/S5868/javascript) | Unicode Grapheme Clusters should be avoided inside regex character classes | βœ… | | πŸ’‘ | πŸ’­ | | +| [no-mixed-content](https://sonarsource.github.io/rspec/#/rspec/S5730/javascript) | Allowing mixed-content is security-sensitive | βœ… | | | | | +| [no-nested-assignment](https://sonarsource.github.io/rspec/#/rspec/S1121/javascript) | Assignments should not be made from within sub-expressions | βœ… | | | | | +| [no-nested-conditional](https://sonarsource.github.io/rspec/#/rspec/S3358/javascript) | Ternary operators should not be nested | βœ… | | | | | +| [no-nested-functions](https://sonarsource.github.io/rspec/#/rspec/S2004/javascript) | Functions should not be nested too deeply | βœ… | | | | | +| [no-nested-incdec](https://sonarsource.github.io/rspec/#/rspec/S881/javascript) | Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression | | | | | | +| [no-nested-switch](https://sonarsource.github.io/rspec/#/rspec/S1821/javascript) | "switch" statements should not be nested | | | | | | +| [no-nested-template-literals](https://sonarsource.github.io/rspec/#/rspec/S4624/javascript) | Template literals should not be nested | βœ… | | | | | +| [no-one-iteration-loop](https://sonarsource.github.io/rspec/#/rspec/S1751/javascript) | Loops with at most one iteration should be refactored | βœ… | | | | | +| [no-os-command-from-path](https://sonarsource.github.io/rspec/#/rspec/S4036/javascript) | Searching OS commands in PATH is security-sensitive | βœ… | | | | | +| [no-parameter-reassignment](https://sonarsource.github.io/rspec/#/rspec/S1226/javascript) | Initial values of parameters, caught exceptions, and loop variables should not be ignored | βœ… | | | | | +| [no-primitive-wrappers](https://sonarsource.github.io/rspec/#/rspec/S1533/javascript) | Wrapper objects should not be used for primitive types | βœ… | | πŸ’‘ | | | +| [no-redundant-assignments](https://sonarsource.github.io/rspec/#/rspec/S4165/javascript) | Assignments should not be redundant | βœ… | | | | | +| [no-redundant-boolean](https://sonarsource.github.io/rspec/#/rspec/S1125/javascript) | Boolean literals should not be used in comparisons | βœ… | | | | | +| [no-redundant-jump](https://sonarsource.github.io/rspec/#/rspec/S3626/javascript) | Jump statements should not be redundant | βœ… | | πŸ’‘ | | | +| [no-redundant-optional](https://sonarsource.github.io/rspec/#/rspec/S4782/javascript) | Optional property declarations should not use both '?' and 'undefined' syntax | βœ… | | πŸ’‘ | πŸ’­ | | +| [no-redundant-parentheses](https://sonarsource.github.io/rspec/#/rspec/S1110/javascript) | Redundant pairs of parentheses should be removed | | | πŸ’‘ | | ❌ | +| [no-reference-error](https://sonarsource.github.io/rspec/#/rspec/S3827/javascript) | Variables should be defined before being used | | | | | | +| [no-referrer-policy](https://sonarsource.github.io/rspec/#/rspec/S5736/javascript) | Disabling strict HTTP no-referrer policy is security-sensitive | βœ… | | | | | +| [no-regex-spaces](https://sonarsource.github.io/rspec/#/rspec/S6326/javascript) | Regular expressions should not contain multiple spaces | βœ… | | πŸ’‘ | πŸ’­ | | +| [no-require-or-define](https://sonarsource.github.io/rspec/#/rspec/S3533/javascript) | "import" should be used to include external code | | | | πŸ’­ | | +| [no-return-type-any](https://sonarsource.github.io/rspec/#/rspec/S4324/javascript) | Primitive return types should be used | | | | πŸ’­ | | +| [no-same-argument-assert](https://sonarsource.github.io/rspec/#/rspec/S5863/javascript) | Assertions should not be given twice the same argument | βœ… | | | | | +| [no-same-line-conditional](https://sonarsource.github.io/rspec/#/rspec/S3972/javascript) | Conditionals should start on new lines | βœ… | | πŸ’‘ | | | +| [no-selector-parameter](https://sonarsource.github.io/rspec/#/rspec/S2301/javascript) | Methods should not contain selector parameters | βœ… | | | πŸ’­ | | +| [no-skipped-tests](https://sonarsource.github.io/rspec/#/rspec/S1607/javascript) | Tests should not be skipped without providing a reason | βœ… | | | | | +| [no-small-switch](https://sonarsource.github.io/rspec/#/rspec/S1301/javascript) | "if" statements should be preferred over "switch" when simpler | βœ… | | | | | +| [no-sonar-comments](https://sonarsource.github.io/rspec/#/rspec/S1291/javascript) | Track uses of "NOSONAR" comments | | | | | | +| [no-tab](https://sonarsource.github.io/rspec/#/rspec/S105/javascript) | Tabulation characters should not be used | | | | | ❌ | +| [no-table-as-layout](https://sonarsource.github.io/rspec/#/rspec/S5257/javascript) | HTML "<table>" should not be used for layout purposes | βœ… | | | | | +| [no-try-promise](https://sonarsource.github.io/rspec/#/rspec/S4822/javascript) | Promise rejections should not be caught by "try" blocks | βœ… | | | πŸ’­ | | +| [no-undefined-argument](https://sonarsource.github.io/rspec/#/rspec/S4623/javascript) | "undefined" should not be passed as the value of optional parameters | βœ… | | πŸ’‘ | πŸ’­ | | +| [no-undefined-assignment](https://sonarsource.github.io/rspec/#/rspec/S2138/javascript) | "undefined" should not be assigned | | | | | | +| [no-unenclosed-multiline-block](https://sonarsource.github.io/rspec/#/rspec/S2681/javascript) | Multiline blocks should be enclosed in curly braces | βœ… | | | | | +| [no-uniq-key](https://sonarsource.github.io/rspec/#/rspec/S6486/javascript) | JSX list components keys should match up between renders | βœ… | | | | | +| [no-unsafe-unzip](https://sonarsource.github.io/rspec/#/rspec/S5042/javascript) | Expanding archive files without controlling resource consumption is security-sensitive | βœ… | | | | | +| [no-unthrown-error](https://sonarsource.github.io/rspec/#/rspec/S3984/javascript) | Errors should not be created without being thrown | βœ… | | πŸ’‘ | | | +| [no-unused-collection](https://sonarsource.github.io/rspec/#/rspec/S4030/javascript) | Collection contents should be used | βœ… | | | | | +| [no-unused-function-argument](https://sonarsource.github.io/rspec/#/rspec/S1172/javascript) | Unused function parameters should be removed | | | πŸ’‘ | | | +| [no-unused-vars](https://sonarsource.github.io/rspec/#/rspec/S1481/javascript) | Unused local variables and functions should be removed | βœ… | | | | | +| [no-use-of-empty-return-value](https://sonarsource.github.io/rspec/#/rspec/S3699/javascript) | The return value of void functions should not be used | βœ… | | | | | +| [no-useless-catch](https://sonarsource.github.io/rspec/#/rspec/S2737/javascript) | "catch" clauses should do more than rethrow | βœ… | | | | | +| [no-useless-increment](https://sonarsource.github.io/rspec/#/rspec/S2123/javascript) | Values should not be uselessly incremented | βœ… | | | | | +| [no-useless-intersection](https://sonarsource.github.io/rspec/#/rspec/S4335/javascript) | Type intersections should use meaningful types | βœ… | | | πŸ’­ | | +| [no-useless-react-setstate](https://sonarsource.github.io/rspec/#/rspec/S6443/javascript) | React state setter function should not be called with its matching state variable | βœ… | | | | | +| [no-variable-usage-before-declaration](https://sonarsource.github.io/rspec/#/rspec/S1526/javascript) | Variables declared with "var" should be declared before they are used | | | | | | +| [no-vue-bypass-sanitization](https://sonarsource.github.io/rspec/#/rspec/S6299/javascript) | Disabling Vue.js built-in escaping is security-sensitive | βœ… | | | | | +| [no-weak-cipher](https://sonarsource.github.io/rspec/#/rspec/S5547/javascript) | Cipher algorithms should be robust | βœ… | | | | | +| [no-weak-keys](https://sonarsource.github.io/rspec/#/rspec/S4426/javascript) | Cryptographic keys should be robust | βœ… | | | | | +| [no-wildcard-import](https://sonarsource.github.io/rspec/#/rspec/S2208/javascript) | Wildcard imports should not be used | | | | | | +| [non-existent-operator](https://sonarsource.github.io/rspec/#/rspec/S2757/javascript) | Non-existent operators '=+', '=-' and '=!' should not be used | βœ… | | πŸ’‘ | | | +| [non-number-in-arithmetic-expression](https://sonarsource.github.io/rspec/#/rspec/S3760/javascript) | Arithmetic operators should only have numbers as operands | | | | πŸ’­ | | +| [null-dereference](https://sonarsource.github.io/rspec/#/rspec/S2259/javascript) | Properties of variables with "null" or "undefined" values should not be accessed | βœ… | | | πŸ’­ | | +| [object-alt-content](https://sonarsource.github.io/rspec/#/rspec/S5264/javascript) | "" tags should provide an alternative content | βœ… | | | | | +| [operation-returning-nan](https://sonarsource.github.io/rspec/#/rspec/S3757/javascript) | Arithmetic operations should not result in "NaN" | | | | πŸ’­ | | +| [os-command](https://sonarsource.github.io/rspec/#/rspec/S4721/javascript) | Using shell interpreter when executing OS commands is security-sensitive | βœ… | | | | | +| [post-message](https://sonarsource.github.io/rspec/#/rspec/S2819/javascript) | Origins should be verified during cross-origin communications | βœ… | | | πŸ’­ | | +| [prefer-default-last](https://sonarsource.github.io/rspec/#/rspec/S4524/javascript) | "default" clauses should be last | βœ… | | | | | +| [prefer-immediate-return](https://sonarsource.github.io/rspec/#/rspec/S1488/javascript) | Local variables should not be declared and then immediately returned or thrown | | πŸ”§ | | | | +| [prefer-object-literal](https://sonarsource.github.io/rspec/#/rspec/S2428/javascript) | Object literal syntax should be used | | | | | | +| [prefer-promise-shorthand](https://sonarsource.github.io/rspec/#/rspec/S4634/javascript) | Shorthand promises should be used | βœ… | | πŸ’‘ | | | +| [prefer-read-only-props](https://sonarsource.github.io/rspec/#/rspec/S6759/javascript) | React props should be read-only | βœ… | | πŸ’‘ | πŸ’­ | | +| [prefer-regexp-exec](https://sonarsource.github.io/rspec/#/rspec/S6594/javascript) | "RegExp.exec()" should be preferred over "String.match()" | βœ… | | πŸ’‘ | πŸ’­ | | +| [prefer-single-boolean-return](https://sonarsource.github.io/rspec/#/rspec/S1126/javascript) | Return of boolean expressions should not be wrapped into an "if-then-else" statement | βœ… | | πŸ’‘ | | | +| [prefer-type-guard](https://sonarsource.github.io/rspec/#/rspec/S4322/javascript) | Type predicates should be used | βœ… | | πŸ’‘ | | | +| [prefer-while](https://sonarsource.github.io/rspec/#/rspec/S1264/javascript) | A "while" loop should be used instead of a "for" loop | βœ… | πŸ”§ | | | | +| [process-argv](https://sonarsource.github.io/rspec/#/rspec/S4823/javascript) | Using command line arguments is security-sensitive | | | | | ❌ | +| [production-debug](https://sonarsource.github.io/rspec/#/rspec/S4507/javascript) | Delivering code in production with debug features activated is security-sensitive | βœ… | | | | | +| [pseudo-random](https://sonarsource.github.io/rspec/#/rspec/S2245/javascript) | Using pseudorandom number generators (PRNGs) is security-sensitive | βœ… | | | | | +| [public-static-readonly](https://sonarsource.github.io/rspec/#/rspec/S1444/javascript) | Public "static" fields should be read-only | βœ… | | πŸ’‘ | | | +| [publicly-writable-directories](https://sonarsource.github.io/rspec/#/rspec/S5443/javascript) | Using publicly writable directories is security-sensitive | βœ… | | | | | +| [reduce-initial-value](https://sonarsource.github.io/rspec/#/rspec/S6959/javascript) | "Array.reduce()" calls should include an initial value | βœ… | | | πŸ’­ | | +| [redundant-type-aliases](https://sonarsource.github.io/rspec/#/rspec/S6564/javascript) | Redundant type aliases should not be used | βœ… | | | | | +| [regex-complexity](https://sonarsource.github.io/rspec/#/rspec/S5843/javascript) | Regular expressions should not be too complicated | βœ… | | | πŸ’­ | | +| [regular-expr](https://sonarsource.github.io/rspec/#/rspec/S4784/javascript) | Using regular expressions is security-sensitive | | | | | ❌ | +| [session-regeneration](https://sonarsource.github.io/rspec/#/rspec/S5876/javascript) | A new session should be created during user authentication | βœ… | | | | | +| [shorthand-property-grouping](https://sonarsource.github.io/rspec/#/rspec/S3499/javascript) | Shorthand object properties should be grouped at the beginning or end of an object declaration | | | | | | +| [single-char-in-character-classes](https://sonarsource.github.io/rspec/#/rspec/S6397/javascript) | Character classes in regular expressions should not contain only one character | βœ… | | | πŸ’­ | | +| [single-character-alternation](https://sonarsource.github.io/rspec/#/rspec/S6035/javascript) | Single-character alternations in regular expressions should be replaced with character classes | βœ… | | | πŸ’­ | | +| [slow-regex](https://sonarsource.github.io/rspec/#/rspec/S5852/javascript) | Using slow regular expressions is security-sensitive | βœ… | | | πŸ’­ | | +| [sockets](https://sonarsource.github.io/rspec/#/rspec/S4818/javascript) | Using Sockets is security-sensitive | | | | | ❌ | +| [sql-queries](https://sonarsource.github.io/rspec/#/rspec/S2077/javascript) | Formatting SQL queries is security-sensitive | βœ… | | | | | +| [stable-tests](https://sonarsource.github.io/rspec/#/rspec/S5973/javascript) | Tests should be stable | βœ… | | | | | +| [standard-input](https://sonarsource.github.io/rspec/#/rspec/S4829/javascript) | Reading the Standard Input is security-sensitive | | | | | ❌ | +| [stateful-regex](https://sonarsource.github.io/rspec/#/rspec/S6351/javascript) | Regular expressions with the global flag should be used with caution | βœ… | | | | | +| [strict-transport-security](https://sonarsource.github.io/rspec/#/rspec/S5739/javascript) | Disabling Strict-Transport-Security policy is security-sensitive | βœ… | | | | | +| [strings-comparison](https://sonarsource.github.io/rspec/#/rspec/S3003/javascript) | Comparison operators should not be used with strings | | | | πŸ’­ | | +| [super-invocation](https://sonarsource.github.io/rspec/#/rspec/S3854/javascript) | "super()" should be invoked appropriately | βœ… | | | | | +| [table-header](https://sonarsource.github.io/rspec/#/rspec/S5256/javascript) | Tables should have headers | βœ… | | | | | +| [table-header-reference](https://sonarsource.github.io/rspec/#/rspec/S5260/javascript) | Table cells should reference their headers | βœ… | | | | | +| [test-check-exception](https://sonarsource.github.io/rspec/#/rspec/S5958/javascript) | Tests should check which exception is thrown | βœ… | | | | | +| [todo-tag](https://sonarsource.github.io/rspec/#/rspec/S1135/javascript) | Track uses of "TODO" tags | βœ… | | | | | +| [too-many-break-or-continue-in-loop](https://sonarsource.github.io/rspec/#/rspec/S135/javascript) | Loops should not contain more than a single "break" or "continue" statement | | | | | | +| [unicode-aware-regex](https://sonarsource.github.io/rspec/#/rspec/S5867/javascript) | Regular expressions using Unicode character classes or property escapes should enable the unicode flag | | | | πŸ’­ | | +| [unused-import](https://sonarsource.github.io/rspec/#/rspec/S1128/javascript) | Unnecessary imports should be removed | βœ… | | πŸ’‘ | πŸ’­ | | +| [unused-named-groups](https://sonarsource.github.io/rspec/#/rspec/S5860/javascript) | Names of regular expressions named groups should be used | βœ… | | | πŸ’­ | | +| [unverified-certificate](https://sonarsource.github.io/rspec/#/rspec/S4830/javascript) | Server certificates should be verified during SSL/TLS connections | βœ… | | | | | +| [unverified-hostname](https://sonarsource.github.io/rspec/#/rspec/S5527/javascript) | Server hostnames should be verified during SSL/TLS connections | βœ… | | | | | +| [updated-const-var](https://sonarsource.github.io/rspec/#/rspec/S3500/javascript) | "const" variables should not be reassigned | βœ… | | | | | +| [updated-loop-counter](https://sonarsource.github.io/rspec/#/rspec/S2310/javascript) | Loop counters should not be assigned within the loop body | βœ… | | | | | +| [use-type-alias](https://sonarsource.github.io/rspec/#/rspec/S4323/javascript) | Type aliases should be used | βœ… | | | | | +| [useless-string-operation](https://sonarsource.github.io/rspec/#/rspec/S1154/javascript) | Results of operations on strings should not be ignored | | | | πŸ’­ | ❌ | +| [values-not-convertible-to-numbers](https://sonarsource.github.io/rspec/#/rspec/S3758/javascript) | Values not convertible to numbers should not be used in numeric comparisons | | | | πŸ’­ | | +| [variable-name](https://sonarsource.github.io/rspec/#/rspec/S117/javascript) | Variable, property and parameter names should comply with a naming convention | | | | | | +| [void-use](https://sonarsource.github.io/rspec/#/rspec/S3735/javascript) | "void" should not be used | βœ… | | | πŸ’­ | | +| [weak-ssl](https://sonarsource.github.io/rspec/#/rspec/S4423/javascript) | Weak SSL/TLS protocols should not be used | βœ… | | | | | +| [web-sql-database](https://sonarsource.github.io/rspec/#/rspec/S2817/javascript) | Web SQL databases should not be used | | | | πŸ’­ | ❌ | +| [x-powered-by](https://sonarsource.github.io/rspec/#/rspec/S5689/javascript) | Disclosing fingerprints from web application technologies is security-sensitive | βœ… | | | | | +| [xml-parser-xxe](https://sonarsource.github.io/rspec/#/rspec/S2755/javascript) | XML parsers should not be vulnerable to XXE attacks | βœ… | | | | | +| [xpath](https://sonarsource.github.io/rspec/#/rspec/S4817/javascript) | Executing XPath expressions is security-sensitive | | | | | ❌ | + +## ESLint rules + +Some rules are not shipped in this ESLint plugin to avoid duplication with already existing rules from ESLint core and third-party ESLint plugins. + +The following rules are used directly, without modifying the original behavior: + + + +| SonarJS rule ID | Rule implemented by | +| :-------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [S103](https://sonarsource.github.io/rspec/#/rspec/S103/javascript) | [eslint/max-len](https://eslint.org/docs/latest/rules/max-len) | +| [S106](https://sonarsource.github.io/rspec/#/rspec/S106/javascript) | [eslint/no-console](https://eslint.org/docs/latest/rules/no-console) | +| [S108](https://sonarsource.github.io/rspec/#/rspec/S108/javascript) | [eslint/no-empty](https://eslint.org/docs/latest/rules/no-empty) | +| [S113](https://sonarsource.github.io/rspec/#/rspec/S113/javascript) | [eslint/eol-last](https://eslint.org/docs/latest/rules/eol-last) | +| [S121](https://sonarsource.github.io/rspec/#/rspec/S121/javascript) | [eslint/curly](https://eslint.org/docs/latest/rules/curly) | +| [S122](https://sonarsource.github.io/rspec/#/rspec/S122/javascript) | [eslint/max-statements-per-line](https://eslint.org/docs/latest/rules/max-statements-per-line) | +| [S139](https://sonarsource.github.io/rspec/#/rspec/S139/javascript) | [eslint/line-comment-position](https://eslint.org/docs/latest/rules/line-comment-position) | +| [S878](https://sonarsource.github.io/rspec/#/rspec/S878/javascript) | [eslint/no-sequences](https://eslint.org/docs/latest/rules/no-sequences) | +| [S909](https://sonarsource.github.io/rspec/#/rspec/S909/javascript) | [eslint/no-continue](https://eslint.org/docs/latest/rules/no-continue) | +| [S1090](https://sonarsource.github.io/rspec/#/rspec/S1090/javascript) | [jsx-a11y/iframe-has-title](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/iframe-has-title.md) | +| [S1117](https://sonarsource.github.io/rspec/#/rspec/S1117/javascript) | [typescript-eslint/no-shadow](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-shadow.mdx) | +| [S1131](https://sonarsource.github.io/rspec/#/rspec/S1131/javascript) | [eslint/no-trailing-spaces](https://eslint.org/docs/latest/rules/no-trailing-spaces) | +| [S1143](https://sonarsource.github.io/rspec/#/rspec/S1143/javascript) | [eslint/no-unsafe-finally](https://eslint.org/docs/latest/rules/no-unsafe-finally) | +| [S1199](https://sonarsource.github.io/rspec/#/rspec/S1199/javascript) | [eslint/no-lone-blocks](https://eslint.org/docs/latest/rules/no-lone-blocks) | +| [S1314](https://sonarsource.github.io/rspec/#/rspec/S1314/javascript) | [eslint/no-octal](https://eslint.org/docs/latest/rules/no-octal) | +| [S1321](https://sonarsource.github.io/rspec/#/rspec/S1321/javascript) | [eslint/no-with](https://eslint.org/docs/latest/rules/no-with) | +| [S1440](https://sonarsource.github.io/rspec/#/rspec/S1440/javascript) | [eslint/eqeqeq](https://eslint.org/docs/latest/rules/eqeqeq) | +| [S1441](https://sonarsource.github.io/rspec/#/rspec/S1441/javascript) | [eslint/quotes](https://eslint.org/docs/latest/rules/quotes) | +| [S1442](https://sonarsource.github.io/rspec/#/rspec/S1442/javascript) | [eslint/no-alert](https://eslint.org/docs/latest/rules/no-alert) | +| [S1516](https://sonarsource.github.io/rspec/#/rspec/S1516/javascript) | [eslint/no-multi-str](https://eslint.org/docs/latest/rules/no-multi-str) | +| [S1525](https://sonarsource.github.io/rspec/#/rspec/S1525/javascript) | [eslint/no-debugger](https://eslint.org/docs/latest/rules/no-debugger) | +| [S1536](https://sonarsource.github.io/rspec/#/rspec/S1536/javascript) | [eslint/no-dupe-args](https://eslint.org/docs/latest/rules/no-dupe-args) | +| [S1537](https://sonarsource.github.io/rspec/#/rspec/S1537/javascript) | [typescript-eslint/comma-dangle](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/comma-dangle.mdx) | +| [S1539](https://sonarsource.github.io/rspec/#/rspec/S1539/javascript) | [eslint/strict](https://eslint.org/docs/latest/rules/strict) | +| [S1656](https://sonarsource.github.io/rspec/#/rspec/S1656/javascript) | [eslint/no-self-assign](https://eslint.org/docs/latest/rules/no-self-assign) | +| [S1774](https://sonarsource.github.io/rspec/#/rspec/S1774/javascript) | [eslint/no-ternary](https://eslint.org/docs/latest/rules/no-ternary) | +| [S2094](https://sonarsource.github.io/rspec/#/rspec/S2094/javascript) | [typescript-eslint/no-extraneous-class](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-extraneous-class.mdx) | +| [S2427](https://sonarsource.github.io/rspec/#/rspec/S2427/javascript) | [eslint/radix](https://eslint.org/docs/latest/rules/radix) | +| [S2432](https://sonarsource.github.io/rspec/#/rspec/S2432/javascript) | [eslint/no-setter-return](https://eslint.org/docs/latest/rules/no-setter-return) | +| [S2685](https://sonarsource.github.io/rspec/#/rspec/S2685/javascript) | [eslint/no-caller](https://eslint.org/docs/latest/rules/no-caller) | +| [S2933](https://sonarsource.github.io/rspec/#/rspec/S2933/javascript) | [typescript-eslint/prefer-readonly](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/prefer-readonly.mdx) | +| [S2966](https://sonarsource.github.io/rspec/#/rspec/S2966/javascript) | [typescript-eslint/no-non-null-assertion](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-non-null-assertion.mdx) | +| [S3257](https://sonarsource.github.io/rspec/#/rspec/S3257/javascript) | [typescript-eslint/no-inferrable-types](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-inferrable-types.mdx) | +| [S3353](https://sonarsource.github.io/rspec/#/rspec/S3353/javascript) | [eslint/prefer-const](https://eslint.org/docs/latest/rules/prefer-const) | +| [S3523](https://sonarsource.github.io/rspec/#/rspec/S3523/javascript) | [eslint/no-new-func](https://eslint.org/docs/latest/rules/no-new-func) | +| [S3786](https://sonarsource.github.io/rspec/#/rspec/S3786/javascript) | [eslint/no-template-curly-in-string](https://eslint.org/docs/latest/rules/no-template-curly-in-string) | +| [S3799](https://sonarsource.github.io/rspec/#/rspec/S3799/javascript) | [eslint/no-empty-pattern](https://eslint.org/docs/latest/rules/no-empty-pattern) | +| [S3812](https://sonarsource.github.io/rspec/#/rspec/S3812/javascript) | [eslint/no-unsafe-negation](https://eslint.org/docs/latest/rules/no-unsafe-negation) | +| [S3834](https://sonarsource.github.io/rspec/#/rspec/S3834/javascript) | [eslint/no-new-native-nonconstructor](https://eslint.org/docs/latest/rules/no-new-native-nonconstructor) | +| [S3863](https://sonarsource.github.io/rspec/#/rspec/S3863/javascript) | [import/no-duplicates](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-duplicates.md) | +| [S4124](https://sonarsource.github.io/rspec/#/rspec/S4124/javascript) | [typescript-eslint/no-misused-new](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-misused-new.mdx) | +| [S4125](https://sonarsource.github.io/rspec/#/rspec/S4125/javascript) | [eslint/valid-typeof](https://eslint.org/docs/latest/rules/valid-typeof) | +| [S4136](https://sonarsource.github.io/rspec/#/rspec/S4136/javascript) | [typescript-eslint/adjacent-overload-signatures](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.mdx) | +| [S4137](https://sonarsource.github.io/rspec/#/rspec/S4137/javascript) | [typescript-eslint/consistent-type-assertions](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/consistent-type-assertions.mdx) | +| [S4140](https://sonarsource.github.io/rspec/#/rspec/S4140/javascript) | [eslint/no-sparse-arrays](https://eslint.org/docs/latest/rules/no-sparse-arrays) | +| [S4157](https://sonarsource.github.io/rspec/#/rspec/S4157/javascript) | [typescript-eslint/no-unnecessary-type-arguments](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.mdx) | +| [S4204](https://sonarsource.github.io/rspec/#/rspec/S4204/javascript) | [typescript-eslint/no-explicit-any](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-explicit-any.mdx) | +| [S4325](https://sonarsource.github.io/rspec/#/rspec/S4325/javascript) | [typescript-eslint/no-unnecessary-type-assertion](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.mdx) | +| [S4326](https://sonarsource.github.io/rspec/#/rspec/S4326/javascript) | [eslint/no-return-await](https://eslint.org/docs/latest/rules/no-return-await) | +| [S6325](https://sonarsource.github.io/rspec/#/rspec/S6325/javascript) | [eslint/prefer-regex-literals](https://eslint.org/docs/latest/rules/prefer-regex-literals) | +| [S6435](https://sonarsource.github.io/rspec/#/rspec/S6435/javascript) | [react/require-render-return](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/require-render-return.md) | +| [S6438](https://sonarsource.github.io/rspec/#/rspec/S6438/javascript) | [react/jsx-no-comment-textnodes](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/jsx-no-comment-textnodes.md) | +| [S6480](https://sonarsource.github.io/rspec/#/rspec/S6480/javascript) | [react/jsx-no-bind](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/jsx-no-bind.md) | +| [S6509](https://sonarsource.github.io/rspec/#/rspec/S6509/javascript) | [eslint/no-extra-boolean-cast](https://eslint.org/docs/latest/rules/no-extra-boolean-cast) | +| [S6522](https://sonarsource.github.io/rspec/#/rspec/S6522/javascript) | [eslint/no-import-assign](https://eslint.org/docs/latest/rules/no-import-assign) | +| [S6523](https://sonarsource.github.io/rspec/#/rspec/S6523/javascript) | [eslint/no-unsafe-optional-chaining](https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining) | +| [S6534](https://sonarsource.github.io/rspec/#/rspec/S6534/javascript) | [eslint/no-loss-of-precision](https://eslint.org/docs/latest/rules/no-loss-of-precision) | +| [S6550](https://sonarsource.github.io/rspec/#/rspec/S6550/javascript) | [typescript-eslint/prefer-literal-enum-member](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.mdx) | +| [S6565](https://sonarsource.github.io/rspec/#/rspec/S6565/javascript) | [typescript-eslint/prefer-return-this-type](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/prefer-return-this-type.mdx) | +| [S6568](https://sonarsource.github.io/rspec/#/rspec/S6568/javascript) | [typescript-eslint/no-confusing-non-null-assertion](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.mdx) | +| [S6569](https://sonarsource.github.io/rspec/#/rspec/S6569/javascript) | [typescript-eslint/no-unnecessary-type-constraint](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.mdx) | +| [S6578](https://sonarsource.github.io/rspec/#/rspec/S6578/javascript) | [typescript-eslint/no-duplicate-enum-values](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.mdx) | +| [S6583](https://sonarsource.github.io/rspec/#/rspec/S6583/javascript) | [typescript-eslint/no-mixed-enums](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-mixed-enums.mdx) | +| [S6590](https://sonarsource.github.io/rspec/#/rspec/S6590/javascript) | [typescript-eslint/prefer-as-const](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/prefer-as-const.mdx) | +| [S6635](https://sonarsource.github.io/rspec/#/rspec/S6635/javascript) | [eslint/no-constructor-return](https://eslint.org/docs/latest/rules/no-constructor-return) | +| [S6637](https://sonarsource.github.io/rspec/#/rspec/S6637/javascript) | [eslint/no-extra-bind](https://eslint.org/docs/latest/rules/no-extra-bind) | +| [S6638](https://sonarsource.github.io/rspec/#/rspec/S6638/javascript) | [eslint/no-constant-binary-expression](https://eslint.org/docs/latest/rules/no-constant-binary-expression) | +| [S6644](https://sonarsource.github.io/rspec/#/rspec/S6644/javascript) | [eslint/no-unneeded-ternary](https://eslint.org/docs/latest/rules/no-unneeded-ternary) | +| [S6645](https://sonarsource.github.io/rspec/#/rspec/S6645/javascript) | [eslint/no-undef-init](https://eslint.org/docs/latest/rules/no-undef-init) | +| [S6650](https://sonarsource.github.io/rspec/#/rspec/S6650/javascript) | [eslint/no-useless-rename](https://eslint.org/docs/latest/rules/no-useless-rename) | +| [S6653](https://sonarsource.github.io/rspec/#/rspec/S6653/javascript) | [eslint/prefer-object-has-own](https://eslint.org/docs/latest/rules/prefer-object-has-own) | +| [S6654](https://sonarsource.github.io/rspec/#/rspec/S6654/javascript) | [eslint/no-proto](https://eslint.org/docs/latest/rules/no-proto) | +| [S6657](https://sonarsource.github.io/rspec/#/rspec/S6657/javascript) | [eslint/no-octal-escape](https://eslint.org/docs/latest/rules/no-octal-escape) | +| [S6671](https://sonarsource.github.io/rspec/#/rspec/S6671/javascript) | [typescript-eslint/prefer-promise-reject-errors](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/prefer-promise-reject-errors.mdx) | +| [S6746](https://sonarsource.github.io/rspec/#/rspec/S6746/javascript) | [react/no-direct-mutation-state](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-direct-mutation-state.md) | +| [S6748](https://sonarsource.github.io/rspec/#/rspec/S6748/javascript) | [react/no-children-prop](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-children-prop.md) | +| [S6750](https://sonarsource.github.io/rspec/#/rspec/S6750/javascript) | [react/no-render-return-value](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-render-return-value.md) | +| [S6756](https://sonarsource.github.io/rspec/#/rspec/S6756/javascript) | [react/no-access-state-in-setstate](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-access-state-in-setstate.md) | +| [S6757](https://sonarsource.github.io/rspec/#/rspec/S6757/javascript) | [react/no-this-in-sfc](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-this-in-sfc.md) | +| [S6761](https://sonarsource.github.io/rspec/#/rspec/S6761/javascript) | [react/no-danger-with-children](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-danger-with-children.md) | +| [S6763](https://sonarsource.github.io/rspec/#/rspec/S6763/javascript) | [react/no-redundant-should-component-update](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-redundant-should-component-update.md) | +| [S6766](https://sonarsource.github.io/rspec/#/rspec/S6766/javascript) | [react/no-unescaped-entities](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-unescaped-entities.md) | +| [S6767](https://sonarsource.github.io/rspec/#/rspec/S6767/javascript) | [react/no-unused-prop-types](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-unused-prop-types.md) | +| [S6770](https://sonarsource.github.io/rspec/#/rspec/S6770/javascript) | [react/jsx-pascal-case](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/jsx-pascal-case.md) | +| [S6772](https://sonarsource.github.io/rspec/#/rspec/S6772/javascript) | [react/jsx-child-element-spacing](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/jsx-child-element-spacing.md) | +| [S6774](https://sonarsource.github.io/rspec/#/rspec/S6774/javascript) | [react/prop-types](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/prop-types.md) | +| [S6775](https://sonarsource.github.io/rspec/#/rspec/S6775/javascript) | [react/default-props-match-prop-types](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/default-props-match-prop-types.md) | +| [S6789](https://sonarsource.github.io/rspec/#/rspec/S6789/javascript) | [react/no-is-mounted](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-is-mounted.md) | +| [S6790](https://sonarsource.github.io/rspec/#/rspec/S6790/javascript) | [react/no-string-refs](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-string-refs.md) | +| [S6793](https://sonarsource.github.io/rspec/#/rspec/S6793/javascript) | [jsx-a11y/aria-proptypes](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/aria-proptypes.md) | +| [S6807](https://sonarsource.github.io/rspec/#/rspec/S6807/javascript) | [jsx-a11y/role-has-required-aria-props](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/role-has-required-aria-props.md) | +| [S6811](https://sonarsource.github.io/rspec/#/rspec/S6811/javascript) | [jsx-a11y/role-supports-aria-props](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/role-supports-aria-props.md) | +| [S6819](https://sonarsource.github.io/rspec/#/rspec/S6819/javascript) | [jsx-a11y/prefer-tag-over-role](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/prefer-tag-over-role.md) | +| [S6821](https://sonarsource.github.io/rspec/#/rspec/S6821/javascript) | [jsx-a11y/aria-role](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/aria-role.md) | +| [S6822](https://sonarsource.github.io/rspec/#/rspec/S6822/javascript) | [jsx-a11y/no-redundant-roles](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-redundant-roles.md) | +| [S6823](https://sonarsource.github.io/rspec/#/rspec/S6823/javascript) | [jsx-a11y/aria-activedescendant-has-tabindex](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/aria-activedescendant-has-tabindex.md) | +| [S6824](https://sonarsource.github.io/rspec/#/rspec/S6824/javascript) | [jsx-a11y/aria-unsupported-elements](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/aria-unsupported-elements.md) | +| [S6825](https://sonarsource.github.io/rspec/#/rspec/S6825/javascript) | [jsx-a11y/no-aria-hidden-on-focusable](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-aria-hidden-on-focusable.md) | +| [S6836](https://sonarsource.github.io/rspec/#/rspec/S6836/javascript) | [eslint/no-case-declarations](https://eslint.org/docs/latest/rules/no-case-declarations) | +| [S6840](https://sonarsource.github.io/rspec/#/rspec/S6840/javascript) | [jsx-a11y/autocomplete-valid](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/autocomplete-valid.md) | +| [S6841](https://sonarsource.github.io/rspec/#/rspec/S6841/javascript) | [jsx-a11y/tabindex-no-positive](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/tabindex-no-positive.md) | +| [S6842](https://sonarsource.github.io/rspec/#/rspec/S6842/javascript) | [jsx-a11y/no-noninteractive-element-to-interactive-role](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-noninteractive-element-to-interactive-role.md) | +| [S6843](https://sonarsource.github.io/rspec/#/rspec/S6843/javascript) | [jsx-a11y/no-interactive-element-to-noninteractive-role](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-interactive-element-to-noninteractive-role.md) | +| [S6845](https://sonarsource.github.io/rspec/#/rspec/S6845/javascript) | [jsx-a11y/no-noninteractive-tabindex](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-noninteractive-tabindex.md) | +| [S6846](https://sonarsource.github.io/rspec/#/rspec/S6846/javascript) | [jsx-a11y/no-access-key](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-access-key.md) | +| [S6847](https://sonarsource.github.io/rspec/#/rspec/S6847/javascript) | [jsx-a11y/no-noninteractive-element-interactions](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-noninteractive-element-interactions.md) | +| [S6848](https://sonarsource.github.io/rspec/#/rspec/S6848/javascript) | [jsx-a11y/no-static-element-interactions](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-static-element-interactions.md) | +| [S6850](https://sonarsource.github.io/rspec/#/rspec/S6850/javascript) | [jsx-a11y/heading-has-content](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/heading-has-content.md) | +| [S6851](https://sonarsource.github.io/rspec/#/rspec/S6851/javascript) | [jsx-a11y/img-redundant-alt](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/img-redundant-alt.md) | +| [S6852](https://sonarsource.github.io/rspec/#/rspec/S6852/javascript) | [jsx-a11y/interactive-supports-focus](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/interactive-supports-focus.md) | +| [S6859](https://sonarsource.github.io/rspec/#/rspec/S6859/javascript) | [import/no-absolute-path](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-absolute-path.md) | +| [S6861](https://sonarsource.github.io/rspec/#/rspec/S6861/javascript) | [import/no-mutable-exports](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-mutable-exports.md) | + + + +## Improved ESLint rules + +Also not available in this ESLint plugin, but used in SonarJS, this list of rules have been modified, so your experience using them in your ESLint configuration may differ from the results you may get using SonarQube: + + + +| SonarJS rule ID | Rules used in the SonarJS implementation | +| :-------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [S107](https://sonarsource.github.io/rspec/#/rspec/S107/javascript) | [eslint/max-params](https://eslint.org/docs/latest/rules/max-params) | +| [S109](https://sonarsource.github.io/rspec/#/rspec/S109/javascript) | [typescript-eslint/no-magic-numbers](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-magic-numbers.mdx) | +| [S131](https://sonarsource.github.io/rspec/#/rspec/S131/javascript) | [typescript-eslint/switch-exhaustiveness-check](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.mdx) | +| [S905](https://sonarsource.github.io/rspec/#/rspec/S905/javascript) | [typescript-eslint/no-unused-expressions](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-unused-expressions.mdx) | +| [S1068](https://sonarsource.github.io/rspec/#/rspec/S1068/javascript) | [eslint/no-unused-private-class-members](https://eslint.org/docs/latest/rules/no-unused-private-class-members) | +| [S1077](https://sonarsource.github.io/rspec/#/rspec/S1077/javascript) | [jsx-a11y/alt-text](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/alt-text.md) | +| [S1082](https://sonarsource.github.io/rspec/#/rspec/S1082/javascript) | [jsx-a11y/mouse-events-have-key-events](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/mouse-events-have-key-events.md)
[jsx-a11y/click-events-have-key-events](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/click-events-have-key-events.md) | +| [S1105](https://sonarsource.github.io/rspec/#/rspec/S1105/javascript) | [eslint/brace-style](https://eslint.org/docs/latest/rules/brace-style) | +| [S1116](https://sonarsource.github.io/rspec/#/rspec/S1116/javascript) | [typescript-eslint/no-extra-semi](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-extra-semi.mdx) | +| [S1186](https://sonarsource.github.io/rspec/#/rspec/S1186/javascript) | [typescript-eslint/no-empty-function](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-empty-function.mdx) | +| [S1438](https://sonarsource.github.io/rspec/#/rspec/S1438/javascript) | [typescript-eslint/semi](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/semi.mdx) | +| [S1534](https://sonarsource.github.io/rspec/#/rspec/S1534/javascript) | [eslint/no-dupe-keys](https://eslint.org/docs/latest/rules/no-dupe-keys)
[typescript-eslint/no-dupe-class-members](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-dupe-class-members.mdx)
[react/jsx-no-duplicate-props](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/jsx-no-duplicate-props.md) | +| [S1763](https://sonarsource.github.io/rspec/#/rspec/S1763/javascript) | [eslint/no-unreachable](https://eslint.org/docs/latest/rules/no-unreachable) | +| [S1788](https://sonarsource.github.io/rspec/#/rspec/S1788/javascript) | [typescript-eslint/default-param-last](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/default-param-last.mdx) | +| [S2189](https://sonarsource.github.io/rspec/#/rspec/S2189/javascript) | [eslint/no-unmodified-loop-condition](https://eslint.org/docs/latest/rules/no-unmodified-loop-condition) | +| [S2376](https://sonarsource.github.io/rspec/#/rspec/S2376/javascript) | [eslint/accessor-pairs](https://eslint.org/docs/latest/rules/accessor-pairs) | +| [S2430](https://sonarsource.github.io/rspec/#/rspec/S2430/javascript) | [eslint/new-cap](https://eslint.org/docs/latest/rules/new-cap) | +| [S2688](https://sonarsource.github.io/rspec/#/rspec/S2688/javascript) | [eslint/use-isnan](https://eslint.org/docs/latest/rules/use-isnan) | +| [S2814](https://sonarsource.github.io/rspec/#/rspec/S2814/javascript) | [typescript-eslint/no-redeclare](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-redeclare.mdx) | +| [S3498](https://sonarsource.github.io/rspec/#/rspec/S3498/javascript) | [eslint/object-shorthand](https://eslint.org/docs/latest/rules/object-shorthand) | +| [S3504](https://sonarsource.github.io/rspec/#/rspec/S3504/javascript) | [eslint/no-var](https://eslint.org/docs/latest/rules/no-var) | +| [S3512](https://sonarsource.github.io/rspec/#/rspec/S3512/javascript) | [eslint/prefer-template](https://eslint.org/docs/latest/rules/prefer-template) | +| [S3696](https://sonarsource.github.io/rspec/#/rspec/S3696/javascript) | [eslint/no-throw-literal](https://eslint.org/docs/latest/rules/no-throw-literal) | +| [S4023](https://sonarsource.github.io/rspec/#/rspec/S4023/javascript) | [typescript-eslint/no-empty-interface](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-empty-interface.mdx) | +| [S4084](https://sonarsource.github.io/rspec/#/rspec/S4084/javascript) | [jsx-a11y/media-has-caption](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/media-has-caption.md) | +| [S4138](https://sonarsource.github.io/rspec/#/rspec/S4138/javascript) | [typescript-eslint/prefer-for-of](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/prefer-for-of.mdx) | +| [S4156](https://sonarsource.github.io/rspec/#/rspec/S4156/javascript) | [typescript-eslint/prefer-namespace-keyword](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.mdx) | +| [S4275](https://sonarsource.github.io/rspec/#/rspec/S4275/javascript) | [eslint/getter-return](https://eslint.org/docs/latest/rules/getter-return) | +| [S4327](https://sonarsource.github.io/rspec/#/rspec/S4327/javascript) | [typescript-eslint/no-this-alias](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-this-alias.mdx) | +| [S5254](https://sonarsource.github.io/rspec/#/rspec/S5254/javascript) | [jsx-a11y/lang](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/lang.md)
[jsx-a11y/html-has-lang](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/html-has-lang.md) | +| [S6440](https://sonarsource.github.io/rspec/#/rspec/S6440/javascript) | [react-hooks/rules-of-hooks](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/README.md) | +| [S6441](https://sonarsource.github.io/rspec/#/rspec/S6441/javascript) | [react/no-unused-class-component-methods](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-unused-class-component-methods.md) | +| [S6477](https://sonarsource.github.io/rspec/#/rspec/S6477/javascript) | [react/jsx-key](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/jsx-key.md) | +| [S6478](https://sonarsource.github.io/rspec/#/rspec/S6478/javascript) | [react/no-unstable-nested-components](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-unstable-nested-components.md) | +| [S6479](https://sonarsource.github.io/rspec/#/rspec/S6479/javascript) | [react/no-array-index-key](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-array-index-key.md) | +| [S6481](https://sonarsource.github.io/rspec/#/rspec/S6481/javascript) | [react/jsx-no-constructed-context-values](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/jsx-no-constructed-context-values.md) | +| [S6535](https://sonarsource.github.io/rspec/#/rspec/S6535/javascript) | [eslint/no-useless-escape](https://eslint.org/docs/latest/rules/no-useless-escape)
[eslint/no-nonoctal-decimal-escape](https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape) | +| [S6544](https://sonarsource.github.io/rspec/#/rspec/S6544/javascript) | [typescript-eslint/no-misused-promises](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-misused-promises.mdx)
[eslint/no-async-promise-executor](https://eslint.org/docs/latest/rules/no-async-promise-executor) | +| [S6551](https://sonarsource.github.io/rspec/#/rspec/S6551/javascript) | [typescript-eslint/no-base-to-string](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-base-to-string.mdx) | +| [S6557](https://sonarsource.github.io/rspec/#/rspec/S6557/javascript) | [typescript-eslint/prefer-string-starts-ends-with](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.mdx) | +| [S6571](https://sonarsource.github.io/rspec/#/rspec/S6571/javascript) | [typescript-eslint/no-redundant-type-constituents](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.mdx) | +| [S6572](https://sonarsource.github.io/rspec/#/rspec/S6572/javascript) | [typescript-eslint/prefer-enum-initializers](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/prefer-enum-initializers.mdx) | +| [S6582](https://sonarsource.github.io/rspec/#/rspec/S6582/javascript) | [typescript-eslint/prefer-optional-chain](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/prefer-optional-chain.mdx) | +| [S6598](https://sonarsource.github.io/rspec/#/rspec/S6598/javascript) | [typescript-eslint/prefer-function-type](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/prefer-function-type.mdx) | +| [S6606](https://sonarsource.github.io/rspec/#/rspec/S6606/javascript) | [typescript-eslint/prefer-nullish-coalescing](https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.mdx) | +| [S6643](https://sonarsource.github.io/rspec/#/rspec/S6643/javascript) | [eslint/no-extend-native](https://eslint.org/docs/latest/rules/no-extend-native) | +| [S6647](https://sonarsource.github.io/rspec/#/rspec/S6647/javascript) | [eslint/no-useless-constructor](https://eslint.org/docs/latest/rules/no-useless-constructor) | +| [S6660](https://sonarsource.github.io/rspec/#/rspec/S6660/javascript) | [eslint/no-lonely-if](https://eslint.org/docs/latest/rules/no-lonely-if) | +| [S6661](https://sonarsource.github.io/rspec/#/rspec/S6661/javascript) | [eslint/prefer-object-spread](https://eslint.org/docs/latest/rules/prefer-object-spread) | +| [S6666](https://sonarsource.github.io/rspec/#/rspec/S6666/javascript) | [eslint/prefer-spread](https://eslint.org/docs/latest/rules/prefer-spread) | +| [S6676](https://sonarsource.github.io/rspec/#/rspec/S6676/javascript) | [eslint/no-useless-call](https://eslint.org/docs/latest/rules/no-useless-call) | +| [S6679](https://sonarsource.github.io/rspec/#/rspec/S6679/javascript) | [eslint/no-self-compare](https://eslint.org/docs/latest/rules/no-self-compare) | +| [S6747](https://sonarsource.github.io/rspec/#/rspec/S6747/javascript) | [react/no-unknown-property](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-unknown-property.md)
[jsx-a11y/aria-props](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/aria-props.md) | +| [S6749](https://sonarsource.github.io/rspec/#/rspec/S6749/javascript) | [react/jsx-no-useless-fragment](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/jsx-no-useless-fragment.md) | +| [S6754](https://sonarsource.github.io/rspec/#/rspec/S6754/javascript) | [react/hook-use-state](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/hook-use-state.md) | +| [S6788](https://sonarsource.github.io/rspec/#/rspec/S6788/javascript) | [react/no-find-dom-node](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-find-dom-node.md) | +| [S6791](https://sonarsource.github.io/rspec/#/rspec/S6791/javascript) | [react/no-unsafe](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-unsafe.md) | +| [S6827](https://sonarsource.github.io/rspec/#/rspec/S6827/javascript) | [jsx-a11y/anchor-has-content](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-has-content.md) | +| [S6844](https://sonarsource.github.io/rspec/#/rspec/S6844/javascript) | [jsx-a11y/anchor-is-valid](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md) | +| [S6853](https://sonarsource.github.io/rspec/#/rspec/S6853/javascript) | [jsx-a11y/label-has-associated-control](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/label-has-associated-control.md) | +| [S6957](https://sonarsource.github.io/rspec/#/rspec/S6957/javascript) | [react/no-deprecated](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-deprecated.md) | +| [S7060](https://sonarsource.github.io/rspec/#/rspec/S7060/javascript) | [import/no-self-import](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-self-import.md) | + + diff --git a/packages/jsts/src/rules/S100/meta.ts b/packages/jsts/src/rules/S100/meta.ts index c7ab36a7d25..817f5a354a5 100644 --- a/packages/jsts/src/rules/S100/meta.ts +++ b/packages/jsts/src/rules/S100/meta.ts @@ -14,33 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Function and method names should comply with a naming convention', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S100/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S100'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - format: { - type: 'string', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'function-name'; diff --git a/packages/jsts/src/rules/S101/meta.ts b/packages/jsts/src/rules/S101/meta.ts index 765b6a024c7..53340360635 100644 --- a/packages/jsts/src/rules/S101/meta.ts +++ b/packages/jsts/src/rules/S101/meta.ts @@ -14,33 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Class names should comply with a naming convention', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S101/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S101'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - format: { - type: 'string', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'class-name'; diff --git a/packages/jsts/src/rules/S101/rule.ts b/packages/jsts/src/rules/S101/rule.ts index 68279da4422..8d30b9f8260 100644 --- a/packages/jsts/src/rules/S101/rule.ts +++ b/packages/jsts/src/rules/S101/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta } from '../helpers/index.js'; import { FromSchema } from 'json-schema-to-ts'; import { meta, schema } from './meta.js'; diff --git a/packages/jsts/src/rules/S103/index.ts b/packages/jsts/src/rules/S103/index.ts new file mode 100644 index 00000000000..f6320618ac3 --- /dev/null +++ b/packages/jsts/src/rules/S103/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('max-len'); diff --git a/packages/jsts/src/rules/S103/meta.ts b/packages/jsts/src/rules/S103/meta.ts new file mode 100644 index 00000000000..775c483682a --- /dev/null +++ b/packages/jsts/src/rules/S103/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'max-len'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S104/meta.ts b/packages/jsts/src/rules/S104/meta.ts index 6afa44bc0e7..f2fb2cb65d4 100644 --- a/packages/jsts/src/rules/S104/meta.ts +++ b/packages/jsts/src/rules/S104/meta.ts @@ -14,33 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Files should not have too many lines of code', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S104/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S104'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - maximum: { - type: 'integer', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'max-lines'; diff --git a/packages/jsts/src/rules/S105/meta.ts b/packages/jsts/src/rules/S105/meta.ts index 6f8724961e1..dbf2dc253a8 100644 --- a/packages/jsts/src/rules/S105/meta.ts +++ b/packages/jsts/src/rules/S105/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Tabulation characters should not be used', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S105/javascript', - requiresTypeChecking: false, - }, - deprecated: true, -}; - -export const sonarKey = 'S105'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-tab'; diff --git a/packages/jsts/src/rules/S106/index.ts b/packages/jsts/src/rules/S106/index.ts new file mode 100644 index 00000000000..7809961389b --- /dev/null +++ b/packages/jsts/src/rules/S106/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-console'); diff --git a/packages/jsts/src/rules/S106/meta.ts b/packages/jsts/src/rules/S106/meta.ts new file mode 100644 index 00000000000..cb5604c1ab8 --- /dev/null +++ b/packages/jsts/src/rules/S106/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-console'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1066/meta.ts b/packages/jsts/src/rules/S1066/meta.ts index a46ed077e1a..997c0a06522 100644 --- a/packages/jsts/src/rules/S1066/meta.ts +++ b/packages/jsts/src/rules/S1066/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Mergeable "if" statements should be combined', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1066/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1066'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-collapsible-if'; diff --git a/packages/jsts/src/rules/S1066/rule.ts b/packages/jsts/src/rules/S1066/rule.ts index 4f17179d3ac..aa1deee6e83 100644 --- a/packages/jsts/src/rules/S1066/rule.ts +++ b/packages/jsts/src/rules/S1066/rule.ts @@ -19,7 +19,6 @@ import type { Rule } from 'eslint'; import estree from 'estree'; import { generateMeta, report, toSecondaryLocation } from '../helpers/index.js'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { meta } from './meta.js'; const message = 'Merge this if statement with the nested one.'; @@ -38,7 +37,7 @@ export const rule: Rule.RuleModule = { return { IfStatement(node: estree.IfStatement) { let { consequent } = node; - if (consequent.type === AST_NODE_TYPES.BlockStatement && consequent.body.length === 1) { + if (consequent.type === 'BlockStatement' && consequent.body.length === 1) { consequent = consequent.body[0]; } if (isIfStatementWithoutElse(node) && isIfStatementWithoutElse(consequent)) { @@ -60,7 +59,7 @@ export const rule: Rule.RuleModule = { }; function isIfStatementWithoutElse(node: estree.Node): node is estree.IfStatement { - return node.type === AST_NODE_TYPES.IfStatement && !node.alternate; + return node.type === 'IfStatement' && !node.alternate; } }, }; diff --git a/packages/jsts/src/rules/S1067/meta.ts b/packages/jsts/src/rules/S1067/meta.ts index 184da3e8d0c..67f31efef19 100644 --- a/packages/jsts/src/rules/S1067/meta.ts +++ b/packages/jsts/src/rules/S1067/meta.ts @@ -14,33 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Expressions should not be too complex', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1067/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1067'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 2, - items: [ - { - type: 'object', - properties: { - max: { - type: 'integer', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'expression-complexity'; diff --git a/packages/jsts/src/rules/S1067/rule.ts b/packages/jsts/src/rules/S1067/rule.ts index 254dcc66a7b..af8438000d7 100644 --- a/packages/jsts/src/rules/S1067/rule.ts +++ b/packages/jsts/src/rules/S1067/rule.ts @@ -18,7 +18,7 @@ import { AST, Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, report, toSecondaryLocation } from '../helpers/index.js'; import { FromSchema } from 'json-schema-to-ts'; import { meta, schema } from './meta.js'; diff --git a/packages/jsts/src/rules/S1068/index.ts b/packages/jsts/src/rules/S1068/index.ts index b96cf4e43ad..19fdc91a3d8 100644 --- a/packages/jsts/src/rules/S1068/index.ts +++ b/packages/jsts/src/rules/S1068/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['no-unused-private-class-members']); +export const rule = decorate(getESLintCoreRule('no-unused-private-class-members')); diff --git a/packages/jsts/src/rules/S1068/meta.ts b/packages/jsts/src/rules/S1068/meta.ts index 7103e0a1cb8..9b2e80e01c9 100644 --- a/packages/jsts/src/rules/S1068/meta.ts +++ b/packages/jsts/src/rules/S1068/meta.ts @@ -14,17 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Unused private class members should be removed', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1068/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S1068'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-unused-private-class-members'; +export const externalRules = [ + { externalPlugin: 'eslint', externalRule: 'no-unused-private-class-members' }, +]; diff --git a/packages/jsts/src/rules/S107/meta.ts b/packages/jsts/src/rules/S107/meta.ts index ef677c1ac01..4dea1bf92ec 100644 --- a/packages/jsts/src/rules/S107/meta.ts +++ b/packages/jsts/src/rules/S107/meta.ts @@ -14,33 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Functions should not have too many parameters', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S107/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S107'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - max: { - type: 'integer', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'max-params'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'max-params' }]; diff --git a/packages/jsts/src/rules/S107/rule.ts b/packages/jsts/src/rules/S107/rule.ts index ff1ab7e6c64..1542f0899ef 100644 --- a/packages/jsts/src/rules/S107/rule.ts +++ b/packages/jsts/src/rules/S107/rule.ts @@ -18,8 +18,8 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; -import { eslintRules } from '../core/index.js'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { getESLintCoreRule } from '../external/core.js'; import { generateMeta, getFullyQualifiedName, @@ -31,7 +31,7 @@ import { import { FromSchema } from 'json-schema-to-ts'; import { meta, schema } from './meta.js'; -const eslintMaxParams = eslintRules['max-params']; +const eslintMaxParams = getESLintCoreRule('max-params'); const DEFAULT_MAXIMUM_FUNCTION_PARAMETERS = 7; diff --git a/packages/jsts/src/rules/S1077/decorator.ts b/packages/jsts/src/rules/S1077/decorator.ts index 4332bfc08c3..39a6054207f 100644 --- a/packages/jsts/src/rules/S1077/decorator.ts +++ b/packages/jsts/src/rules/S1077/decorator.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import { Node } from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, interceptReport } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S1077/index.ts b/packages/jsts/src/rules/S1077/index.ts index 5c5a9fa2e12..d279e4c7a3d 100644 --- a/packages/jsts/src/rules/S1077/index.ts +++ b/packages/jsts/src/rules/S1077/index.ts @@ -14,8 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import pkg from 'eslint-plugin-jsx-a11y'; -const { rules: jsxA11yRules } = pkg; +import { rules } from '../external/a11y.js'; import { decorate } from './decorator.js'; -export const rule = decorate(jsxA11yRules['alt-text']); +export const rule = decorate(rules['alt-text']); diff --git a/packages/jsts/src/rules/S1077/meta.ts b/packages/jsts/src/rules/S1077/meta.ts index f13b2b915c9..37b714f887c 100644 --- a/packages/jsts/src/rules/S1077/meta.ts +++ b/packages/jsts/src/rules/S1077/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: - 'Image, area, button with image and object elements should have an alternative text', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1077/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1077'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'alt-text'; +export const externalRules = [{ externalPlugin: 'jsx-a11y', externalRule: 'alt-text' }]; diff --git a/packages/jsts/src/rules/S108/index.ts b/packages/jsts/src/rules/S108/index.ts new file mode 100644 index 00000000000..b9739e6a820 --- /dev/null +++ b/packages/jsts/src/rules/S108/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-empty'); diff --git a/packages/jsts/src/rules/S108/meta.ts b/packages/jsts/src/rules/S108/meta.ts new file mode 100644 index 00000000000..404a5659343 --- /dev/null +++ b/packages/jsts/src/rules/S108/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-empty'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1082/meta.ts b/packages/jsts/src/rules/S1082/meta.ts index 9fbb06b5186..3c38dc15a99 100644 --- a/packages/jsts/src/rules/S1082/meta.ts +++ b/packages/jsts/src/rules/S1082/meta.ts @@ -14,16 +14,10 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Mouse events should have corresponding keyboard events', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1082/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1082'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'mouse-events-a11y'; +export const externalRules = [ + { externalPlugin: 'jsx-a11y', externalRule: 'mouse-events-have-key-events' }, + { externalPlugin: 'jsx-a11y', externalRule: 'click-events-have-key-events' }, +]; diff --git a/packages/jsts/src/rules/S1082/rule.ts b/packages/jsts/src/rules/S1082/rule.ts index 0d68c301de8..6eede6d0ce9 100644 --- a/packages/jsts/src/rules/S1082/rule.ts +++ b/packages/jsts/src/rules/S1082/rule.ts @@ -18,12 +18,11 @@ import type { Rule } from 'eslint'; import { generateMeta, mergeRules } from '../helpers/index.js'; -import pkg from 'eslint-plugin-jsx-a11y'; -const { rules: jsxA11yRules } = pkg; +import { rules } from '../external/a11y.js'; import { meta } from './meta.js'; -const mouseEventsHaveKeyEvents = jsxA11yRules['mouse-events-have-key-events']; -const clickEventsHaveKeyEvents = jsxA11yRules['click-events-have-key-events']; +const mouseEventsHaveKeyEvents = rules['mouse-events-have-key-events']; +const clickEventsHaveKeyEvents = rules['click-events-have-key-events']; export const rule: Rule.RuleModule = { meta: generateMeta(meta as Rule.RuleMetaData, { diff --git a/packages/jsts/src/rules/S109/meta.ts b/packages/jsts/src/rules/S109/meta.ts index 77b8f6b91b2..13d52b50b9e 100644 --- a/packages/jsts/src/rules/S109/meta.ts +++ b/packages/jsts/src/rules/S109/meta.ts @@ -14,16 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Magic numbers should not be used', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S109/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S109'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-magic-numbers'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'no-magic-numbers' }, +]; diff --git a/packages/jsts/src/rules/S109/rule.ts b/packages/jsts/src/rules/S109/rule.ts index 567acebacce..9af6d457973 100644 --- a/packages/jsts/src/rules/S109/rule.ts +++ b/packages/jsts/src/rules/S109/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { generateMeta, getNodeParent, isMethodInvocation } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S1090/index.ts b/packages/jsts/src/rules/S1090/index.ts new file mode 100644 index 00000000000..8b1a1a9769f --- /dev/null +++ b/packages/jsts/src/rules/S1090/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['iframe-has-title']; diff --git a/packages/jsts/src/rules/S1090/meta.ts b/packages/jsts/src/rules/S1090/meta.ts new file mode 100644 index 00000000000..c3c0432d69e --- /dev/null +++ b/packages/jsts/src/rules/S1090/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'iframe-has-title'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S1105/index.ts b/packages/jsts/src/rules/S1105/index.ts index 4a0a0eb1c5c..6c063e62458 100644 --- a/packages/jsts/src/rules/S1105/index.ts +++ b/packages/jsts/src/rules/S1105/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['brace-style']); +export const rule = decorate(getESLintCoreRule('brace-style')); diff --git a/packages/jsts/src/rules/S1105/meta.ts b/packages/jsts/src/rules/S1105/meta.ts index c8b6efaaac9..12493a54432 100644 --- a/packages/jsts/src/rules/S1105/meta.ts +++ b/packages/jsts/src/rules/S1105/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'An open curly brace should be located at the end of a line', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1105/javascript', - requiresTypeChecking: false, - }, - deprecated: true, -}; - -export const sonarKey = 'S1105'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'brace-style'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'brace-style' }]; diff --git a/packages/jsts/src/rules/S1110/meta.ts b/packages/jsts/src/rules/S1110/meta.ts index 306ca371c72..9d8995b1b0a 100644 --- a/packages/jsts/src/rules/S1110/meta.ts +++ b/packages/jsts/src/rules/S1110/meta.ts @@ -14,18 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Redundant pairs of parentheses should be removed', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1110/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', - deprecated: true, -}; - -export const sonarKey = 'S1110'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-redundant-parentheses'; diff --git a/packages/jsts/src/rules/S1116/index.ts b/packages/jsts/src/rules/S1116/index.ts index ccdaac9ac65..ce08f0408a3 100644 --- a/packages/jsts/src/rules/S1116/index.ts +++ b/packages/jsts/src/rules/S1116/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(tsEslintRules['no-extra-semi']); diff --git a/packages/jsts/src/rules/S1116/meta.ts b/packages/jsts/src/rules/S1116/meta.ts index 2dcb64d7602..54cab0e5631 100644 --- a/packages/jsts/src/rules/S1116/meta.ts +++ b/packages/jsts/src/rules/S1116/meta.ts @@ -14,18 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Extra semicolons should be removed', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1116/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', - deprecated: true, -}; - -export const sonarKey = 'S1116'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-extra-semi'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'no-extra-semi' }, +]; diff --git a/packages/jsts/src/rules/S1117/index.ts b/packages/jsts/src/rules/S1117/index.ts new file mode 100644 index 00000000000..6b437c0e62b --- /dev/null +++ b/packages/jsts/src/rules/S1117/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['no-shadow']; diff --git a/packages/jsts/src/rules/S1117/meta.ts b/packages/jsts/src/rules/S1117/meta.ts new file mode 100644 index 00000000000..e2de445a296 --- /dev/null +++ b/packages/jsts/src/rules/S1117/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-shadow'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S1119/meta.ts b/packages/jsts/src/rules/S1119/meta.ts index fbaae21f0dc..28f5466be4b 100644 --- a/packages/jsts/src/rules/S1119/meta.ts +++ b/packages/jsts/src/rules/S1119/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Labels should not be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1119/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1119'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-labels'; diff --git a/packages/jsts/src/rules/S1121/meta.ts b/packages/jsts/src/rules/S1121/meta.ts index baeb97ea0cd..976a48df856 100644 --- a/packages/jsts/src/rules/S1121/meta.ts +++ b/packages/jsts/src/rules/S1121/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Assignments should not be made from within sub-expressions', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1121/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1121'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-nested-assignment'; diff --git a/packages/jsts/src/rules/S1125/meta.ts b/packages/jsts/src/rules/S1125/meta.ts index ba5cc17587e..2442a70c322 100644 --- a/packages/jsts/src/rules/S1125/meta.ts +++ b/packages/jsts/src/rules/S1125/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Boolean literals should not be used in comparisons', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1125/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1125'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-redundant-boolean'; diff --git a/packages/jsts/src/rules/S1125/rule.ts b/packages/jsts/src/rules/S1125/rule.ts index ec098ba9594..50dea154e7e 100644 --- a/packages/jsts/src/rules/S1125/rule.ts +++ b/packages/jsts/src/rules/S1125/rule.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S1125 -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, isBooleanLiteral } from '../helpers/index.js'; import type { Rule } from 'eslint'; import estree from 'estree'; @@ -48,8 +48,8 @@ export const rule: Rule.RuleModule = { const parent = (expression as TSESTree.Node).parent as estree.Node; if ( expression.operator === '||' && - ((parent.type === AST_NODE_TYPES.ConditionalExpression && parent.test === expression) || - parent.type === AST_NODE_TYPES.IfStatement) + ((parent.type === 'ConditionalExpression' && parent.test === expression) || + parent.type === 'IfStatement') ) { checkBooleanLiteral(expression.right); } diff --git a/packages/jsts/src/rules/S1126/meta.ts b/packages/jsts/src/rules/S1126/meta.ts index 9602eb2a838..450e7e533bf 100644 --- a/packages/jsts/src/rules/S1126/meta.ts +++ b/packages/jsts/src/rules/S1126/meta.ts @@ -14,18 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: - 'Return of boolean expressions should not be wrapped into an "if-then-else" statement', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1126/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S1126'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'prefer-single-boolean-return'; diff --git a/packages/jsts/src/rules/S1126/rule.ts b/packages/jsts/src/rules/S1126/rule.ts index 60cade75e94..4dd47159425 100644 --- a/packages/jsts/src/rules/S1126/rule.ts +++ b/packages/jsts/src/rules/S1126/rule.ts @@ -15,7 +15,7 @@ * along with this program; if not, see https://sonarsource.com/license/ssal/ */ // https://sonarsource.github.io/rspec/#/rspec/S1126 -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import type { Rule } from 'eslint'; import estree from 'estree'; import { generateMeta } from '../helpers/index.js'; @@ -38,7 +38,7 @@ export const rule: Rule.RuleModule = { const parent = (node as TSESTree.IfStatement).parent as estree.Node; if ( // ignore `else if` - parent.type !== AST_NODE_TYPES.IfStatement && + parent.type !== 'IfStatement' && returnsBoolean(node.consequent) && alternateReturnsBoolean(node) ) { @@ -57,7 +57,7 @@ export const rule: Rule.RuleModule = { } const { parent } = node as TSESTree.IfStatement; - if (parent?.type === AST_NODE_TYPES.BlockStatement) { + if (parent?.type === 'BlockStatement') { const ifStmtIndex = parent.body.findIndex(stmt => stmt === node); return isSimpleReturnBooleanLiteral(parent.body[ifStmtIndex + 1] as estree.Statement); } @@ -74,7 +74,7 @@ export const rule: Rule.RuleModule = { function isBlockReturningBooleanLiteral(statement: estree.Statement) { return ( - statement.type === AST_NODE_TYPES.BlockStatement && + statement.type === 'BlockStatement' && statement.body.length === 1 && isSimpleReturnBooleanLiteral(statement.body[0]) ); @@ -82,8 +82,8 @@ export const rule: Rule.RuleModule = { function isSimpleReturnBooleanLiteral(statement: estree.Node) { return ( - statement?.type === AST_NODE_TYPES.ReturnStatement && - statement.argument?.type === AST_NODE_TYPES.Literal && + statement?.type === 'ReturnStatement' && + statement.argument?.type === 'Literal' && typeof statement.argument.value === 'boolean' ); } @@ -122,15 +122,14 @@ export const rule: Rule.RuleModule = { function isReturningFalse(stmt: estree.Statement): boolean { const returnStmt = ( - stmt.type === AST_NODE_TYPES.BlockStatement ? stmt.body[0] : stmt + stmt.type === 'BlockStatement' ? stmt.body[0] : stmt ) as estree.ReturnStatement; return (returnStmt.argument as estree.Literal).value === false; } function isBooleanExpression(expr: estree.Expression) { return ( - (expr.type === AST_NODE_TYPES.UnaryExpression || - expr.type === AST_NODE_TYPES.BinaryExpression) && + (expr.type === 'UnaryExpression' || expr.type === 'BinaryExpression') && ['!', '==', '===', '!=', '!==', '<', '<=', '>', '>=', 'in', 'instanceof'].includes( expr.operator, ) diff --git a/packages/jsts/src/rules/S1128/meta.ts b/packages/jsts/src/rules/S1128/meta.ts index b23305ad232..cc74a5d3598 100644 --- a/packages/jsts/src/rules/S1128/meta.ts +++ b/packages/jsts/src/rules/S1128/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Unnecessary imports should be removed', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1128/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S1128'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'unused-import'; diff --git a/packages/jsts/src/rules/S1128/rule.ts b/packages/jsts/src/rules/S1128/rule.ts index 50d7376441c..f7bdeb2957e 100644 --- a/packages/jsts/src/rules/S1128/rule.ts +++ b/packages/jsts/src/rules/S1128/rule.ts @@ -19,7 +19,7 @@ import { Rule, Scope } from 'eslint'; import estree from 'estree'; import { AST } from 'vue-eslint-parser'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, isInsideVueSetupScript, diff --git a/packages/jsts/src/rules/S113/index.ts b/packages/jsts/src/rules/S113/index.ts new file mode 100644 index 00000000000..6d089d92370 --- /dev/null +++ b/packages/jsts/src/rules/S113/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('eol-last'); diff --git a/packages/jsts/src/rules/S113/meta.ts b/packages/jsts/src/rules/S113/meta.ts new file mode 100644 index 00000000000..374bf62b174 --- /dev/null +++ b/packages/jsts/src/rules/S113/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'eol-last'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1131/index.ts b/packages/jsts/src/rules/S1131/index.ts new file mode 100644 index 00000000000..b3e77354420 --- /dev/null +++ b/packages/jsts/src/rules/S1131/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-trailing-spaces'); diff --git a/packages/jsts/src/rules/S1131/meta.ts b/packages/jsts/src/rules/S1131/meta.ts new file mode 100644 index 00000000000..069bd29dec9 --- /dev/null +++ b/packages/jsts/src/rules/S1131/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-trailing-spaces'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1134/meta.ts b/packages/jsts/src/rules/S1134/meta.ts index b819d694af6..586443642b0 100644 --- a/packages/jsts/src/rules/S1134/meta.ts +++ b/packages/jsts/src/rules/S1134/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Track uses of "FIXME" tags', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1134/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1134'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'fixme-tag'; diff --git a/packages/jsts/src/rules/S1135/meta.ts b/packages/jsts/src/rules/S1135/meta.ts index 547c9d36604..27987094aee 100644 --- a/packages/jsts/src/rules/S1135/meta.ts +++ b/packages/jsts/src/rules/S1135/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Track uses of "TODO" tags', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1135/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1135'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'todo-tag'; diff --git a/packages/jsts/src/rules/S1135/rule.ts b/packages/jsts/src/rules/S1135/rule.ts index 78f48e2a5a2..bcaf0fcc78e 100644 --- a/packages/jsts/src/rules/S1135/rule.ts +++ b/packages/jsts/src/rules/S1135/rule.ts @@ -17,7 +17,7 @@ // https://sonarsource.github.io/rspec/#/rspec/S1135/javascript import type { Rule } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S1143/index.ts b/packages/jsts/src/rules/S1143/index.ts new file mode 100644 index 00000000000..c8776936907 --- /dev/null +++ b/packages/jsts/src/rules/S1143/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-unsafe-finally'); diff --git a/packages/jsts/src/rules/S1143/meta.ts b/packages/jsts/src/rules/S1143/meta.ts new file mode 100644 index 00000000000..d16652acda3 --- /dev/null +++ b/packages/jsts/src/rules/S1143/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-unsafe-finally'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1154/meta.ts b/packages/jsts/src/rules/S1154/meta.ts index e68f1b44467..694209a3921 100644 --- a/packages/jsts/src/rules/S1154/meta.ts +++ b/packages/jsts/src/rules/S1154/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Results of operations on strings should not be ignored', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1154/javascript', - requiresTypeChecking: true, - }, - deprecated: true, -}; - -export const sonarKey = 'S1154'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'useless-string-operation'; diff --git a/packages/jsts/src/rules/S117/meta.ts b/packages/jsts/src/rules/S117/meta.ts index 0fd25f23067..9e1ff4c8957 100644 --- a/packages/jsts/src/rules/S117/meta.ts +++ b/packages/jsts/src/rules/S117/meta.ts @@ -14,33 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Variable, property and parameter names should comply with a naming convention', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S117/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S117'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - format: { - type: 'string', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'variable-name'; diff --git a/packages/jsts/src/rules/S117/rule.ts b/packages/jsts/src/rules/S117/rule.ts index 5acd1bb99e3..ac898df1f94 100644 --- a/packages/jsts/src/rules/S117/rule.ts +++ b/packages/jsts/src/rules/S117/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, resolveIdentifiers } from '../helpers/index.js'; import { FromSchema } from 'json-schema-to-ts'; import { meta, schema } from './meta.js'; diff --git a/packages/jsts/src/rules/S1172/meta.ts b/packages/jsts/src/rules/S1172/meta.ts index 10d05db8ddd..7495ba10622 100644 --- a/packages/jsts/src/rules/S1172/meta.ts +++ b/packages/jsts/src/rules/S1172/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Unused function parameters should be removed', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1172/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S1172'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-unused-function-argument'; diff --git a/packages/jsts/src/rules/S1172/rule.ts b/packages/jsts/src/rules/S1172/rule.ts index 37ed2668c49..35670caee42 100644 --- a/packages/jsts/src/rules/S1172/rule.ts +++ b/packages/jsts/src/rules/S1172/rule.ts @@ -18,7 +18,7 @@ import { Rule, Scope } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S1186/index.ts b/packages/jsts/src/rules/S1186/index.ts index c920fdc9458..a69f2f02e21 100644 --- a/packages/jsts/src/rules/S1186/index.ts +++ b/packages/jsts/src/rules/S1186/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(tsEslintRules['no-empty-function']); diff --git a/packages/jsts/src/rules/S1186/meta.ts b/packages/jsts/src/rules/S1186/meta.ts index 904f78e9b6e..364147cd0e3 100644 --- a/packages/jsts/src/rules/S1186/meta.ts +++ b/packages/jsts/src/rules/S1186/meta.ts @@ -14,17 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Functions should not be empty', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1186/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S1186'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-empty-function'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'no-empty-function' }, +]; diff --git a/packages/jsts/src/rules/S1192/meta.ts b/packages/jsts/src/rules/S1192/meta.ts index 0f3437d4df8..5a71d650130 100644 --- a/packages/jsts/src/rules/S1192/meta.ts +++ b/packages/jsts/src/rules/S1192/meta.ts @@ -14,37 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'String literals should not be duplicated', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1192/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1192'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 2, - items: [ - { - type: 'object', - properties: { - threshold: { - type: 'integer', - minimum: 2, - }, - ignoreStrings: { - type: 'string', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-duplicate-string'; diff --git a/packages/jsts/src/rules/S1192/rule.ts b/packages/jsts/src/rules/S1192/rule.ts index 5994006f4b6..8b3c25445c9 100644 --- a/packages/jsts/src/rules/S1192/rule.ts +++ b/packages/jsts/src/rules/S1192/rule.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S1192 -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, report, toSecondaryLocation } from '../helpers/index.js'; import type { Rule } from 'eslint'; import estree from 'estree'; @@ -119,5 +119,5 @@ function isRequireContext(parent: estree.Node, context: Rule.RuleContext) { } function isObjectPropertyKey(parent: estree.Node, literal: estree.Literal) { - return parent.type === AST_NODE_TYPES.Property && parent.key === literal; + return parent.type === 'Property' && parent.key === literal; } diff --git a/packages/jsts/src/rules/S1199/index.ts b/packages/jsts/src/rules/S1199/index.ts new file mode 100644 index 00000000000..27f2329ed6b --- /dev/null +++ b/packages/jsts/src/rules/S1199/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-lone-blocks'); diff --git a/packages/jsts/src/rules/S1199/meta.ts b/packages/jsts/src/rules/S1199/meta.ts new file mode 100644 index 00000000000..4bcb06a8110 --- /dev/null +++ b/packages/jsts/src/rules/S1199/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-lone-blocks'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S121/index.ts b/packages/jsts/src/rules/S121/index.ts new file mode 100644 index 00000000000..ecf088f59b9 --- /dev/null +++ b/packages/jsts/src/rules/S121/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('curly'); diff --git a/packages/jsts/src/rules/S121/meta.ts b/packages/jsts/src/rules/S121/meta.ts new file mode 100644 index 00000000000..26fc77e9890 --- /dev/null +++ b/packages/jsts/src/rules/S121/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'curly'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1219/meta.ts b/packages/jsts/src/rules/S1219/meta.ts index 774c8699ce2..694c4dbf0b6 100644 --- a/packages/jsts/src/rules/S1219/meta.ts +++ b/packages/jsts/src/rules/S1219/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"switch" statements should not contain non-case labels', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1219/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1219'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-case-label-in-switch'; diff --git a/packages/jsts/src/rules/S122/index.ts b/packages/jsts/src/rules/S122/index.ts new file mode 100644 index 00000000000..db0cccec403 --- /dev/null +++ b/packages/jsts/src/rules/S122/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('max-statements-per-line'); diff --git a/packages/jsts/src/rules/S122/meta.ts b/packages/jsts/src/rules/S122/meta.ts new file mode 100644 index 00000000000..e97fc5c46b5 --- /dev/null +++ b/packages/jsts/src/rules/S122/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'max-statements-per-line'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1226/meta.ts b/packages/jsts/src/rules/S1226/meta.ts index c9ec33e8300..ca5554966ec 100644 --- a/packages/jsts/src/rules/S1226/meta.ts +++ b/packages/jsts/src/rules/S1226/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: - 'Initial values of parameters, caught exceptions, and loop variables should not be ignored', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1226/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1226'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-parameter-reassignment'; diff --git a/packages/jsts/src/rules/S1226/rule.ts b/packages/jsts/src/rules/S1226/rule.ts index a9417bc9c15..0fb10db8ffa 100644 --- a/packages/jsts/src/rules/S1226/rule.ts +++ b/packages/jsts/src/rules/S1226/rule.ts @@ -18,7 +18,7 @@ import { AST, Rule, Scope } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, getParent, resolveIdentifiers } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S124/meta.ts b/packages/jsts/src/rules/S124/meta.ts index 4d0eccc8a63..9a2b4dba4c6 100644 --- a/packages/jsts/src/rules/S124/meta.ts +++ b/packages/jsts/src/rules/S124/meta.ts @@ -14,39 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Track comments matching a regular expression', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S124/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S124'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - regularExpression: { - type: 'string', - }, - message: { - type: 'string', - }, - flags: { - type: 'string', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'comment-regex'; diff --git a/packages/jsts/src/rules/S124/rule.ts b/packages/jsts/src/rules/S124/rule.ts index 2a9ae65be0f..66c59d06453 100644 --- a/packages/jsts/src/rules/S124/rule.ts +++ b/packages/jsts/src/rules/S124/rule.ts @@ -17,7 +17,7 @@ // https://sonarsource.github.io/rspec/#/rspec/S124/javascript import type { Rule } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta } from '../helpers/index.js'; import { FromSchema } from 'json-schema-to-ts'; import { meta, schema } from './meta.js'; diff --git a/packages/jsts/src/rules/S125/meta.ts b/packages/jsts/src/rules/S125/meta.ts index 99c592e1e9d..1104c197cd4 100644 --- a/packages/jsts/src/rules/S125/meta.ts +++ b/packages/jsts/src/rules/S125/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Sections of code should not be commented out', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S125/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S125'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-commented-code'; diff --git a/packages/jsts/src/rules/S125/rule.ts b/packages/jsts/src/rules/S125/rule.ts index 26932394e8b..b5c981070b0 100644 --- a/packages/jsts/src/rules/S125/rule.ts +++ b/packages/jsts/src/rules/S125/rule.ts @@ -18,7 +18,7 @@ import { Rule, SourceCode } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import babel from '@babel/eslint-parser'; import { generateMeta } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S126/meta.ts b/packages/jsts/src/rules/S126/meta.ts index a0a9e5581fd..5c4f8b9ad3b 100644 --- a/packages/jsts/src/rules/S126/meta.ts +++ b/packages/jsts/src/rules/S126/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"if ... else if" constructs should end with "else" clauses', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S126/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S126'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'elseif-without-else'; diff --git a/packages/jsts/src/rules/S126/rule.ts b/packages/jsts/src/rules/S126/rule.ts index a00fb5ebb4f..3cef78cb581 100644 --- a/packages/jsts/src/rules/S126/rule.ts +++ b/packages/jsts/src/rules/S126/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S1264/meta.ts b/packages/jsts/src/rules/S1264/meta.ts index ab1c739535f..47acd2f01f0 100644 --- a/packages/jsts/src/rules/S1264/meta.ts +++ b/packages/jsts/src/rules/S1264/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'A "while" loop should be used instead of a "for" loop', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1264/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S1264'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'prefer-while'; diff --git a/packages/jsts/src/rules/S128/meta.ts b/packages/jsts/src/rules/S128/meta.ts index 4c4b3230e05..b2821a18c80 100644 --- a/packages/jsts/src/rules/S128/meta.ts +++ b/packages/jsts/src/rules/S128/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Switch cases should end with an unconditional "break" statement', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S128/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S128'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-fallthrough'; diff --git a/packages/jsts/src/rules/S1291/meta.ts b/packages/jsts/src/rules/S1291/meta.ts index 1a9b534c321..f9b47a89583 100644 --- a/packages/jsts/src/rules/S1291/meta.ts +++ b/packages/jsts/src/rules/S1291/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ - -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Track uses of "NOSONAR" comments', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1291/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1291'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-sonar-comments'; diff --git a/packages/jsts/src/rules/S1301/meta.ts b/packages/jsts/src/rules/S1301/meta.ts index 928da47826a..dd5cfc5c9f1 100644 --- a/packages/jsts/src/rules/S1301/meta.ts +++ b/packages/jsts/src/rules/S1301/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"if" statements should be preferred over "switch" when simpler', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1301/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1301'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-small-switch'; diff --git a/packages/jsts/src/rules/S131/meta.ts b/packages/jsts/src/rules/S131/meta.ts index 1a4c1b09270..916bcbc1d2b 100644 --- a/packages/jsts/src/rules/S131/meta.ts +++ b/packages/jsts/src/rules/S131/meta.ts @@ -14,17 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"switch" statements should have "default" clauses', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S131/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S131'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'switch-without-default'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'switch-exhaustiveness-check' }, +]; diff --git a/packages/jsts/src/rules/S131/rule.ts b/packages/jsts/src/rules/S131/rule.ts index a0d6ca522b7..3a62076fef6 100644 --- a/packages/jsts/src/rules/S131/rule.ts +++ b/packages/jsts/src/rules/S131/rule.ts @@ -18,7 +18,7 @@ import estree from 'estree'; import { Rule, SourceCode } from 'eslint'; -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules } from '../external/typescript-eslint/index.js'; import { generateMeta, interceptReport, @@ -78,7 +78,7 @@ const switchWithoutDefaultRule: Rule.RuleModule = { * rule is executed to prevent runtime errors. Furthermore, we need to decorate the rule so that * it raises issues at the same location, that is, the `switch` keyword. */ -const switchExhaustivenessRule = tsEslintRules['switch-exhaustiveness-check']; +const switchExhaustivenessRule = rules['switch-exhaustiveness-check']; const decoratedSwitchExhaustivenessRule: Rule.RuleModule = interceptReport( switchExhaustivenessRule, function (context: Rule.RuleContext, descriptor: Rule.ReportDescriptor) { diff --git a/packages/jsts/src/rules/S1313/meta.ts b/packages/jsts/src/rules/S1313/meta.ts index 07fbd002c9a..b1ebd6ba572 100644 --- a/packages/jsts/src/rules/S1313/meta.ts +++ b/packages/jsts/src/rules/S1313/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using hardcoded IP addresses is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1313/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1313'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-hardcoded-ip'; diff --git a/packages/jsts/src/rules/S1314/index.ts b/packages/jsts/src/rules/S1314/index.ts new file mode 100644 index 00000000000..191622bf95c --- /dev/null +++ b/packages/jsts/src/rules/S1314/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-octal'); diff --git a/packages/jsts/src/rules/S1314/meta.ts b/packages/jsts/src/rules/S1314/meta.ts new file mode 100644 index 00000000000..0e8413eb979 --- /dev/null +++ b/packages/jsts/src/rules/S1314/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-octal'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1321/index.ts b/packages/jsts/src/rules/S1321/index.ts new file mode 100644 index 00000000000..5e51e07ed96 --- /dev/null +++ b/packages/jsts/src/rules/S1321/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-with'); diff --git a/packages/jsts/src/rules/S1321/meta.ts b/packages/jsts/src/rules/S1321/meta.ts new file mode 100644 index 00000000000..b3d0b75f33c --- /dev/null +++ b/packages/jsts/src/rules/S1321/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-with'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S134/meta.ts b/packages/jsts/src/rules/S134/meta.ts index b2049ad1425..fd9fcdb857a 100644 --- a/packages/jsts/src/rules/S134/meta.ts +++ b/packages/jsts/src/rules/S134/meta.ts @@ -14,34 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: - 'Control flow statements "if", "for", "while", "switch" and "try" should not be nested too deeply', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S134/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S134'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 2, - items: [ - { - type: 'object', - properties: { - maximumNestingLevel: { - type: 'integer', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'nested-control-flow'; diff --git a/packages/jsts/src/rules/S135/meta.ts b/packages/jsts/src/rules/S135/meta.ts index 88ff0a5e337..70bb903984c 100644 --- a/packages/jsts/src/rules/S135/meta.ts +++ b/packages/jsts/src/rules/S135/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Loops should not contain more than a single "break" or "continue" statement', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S135/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S135'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'too-many-break-or-continue-in-loop'; diff --git a/packages/jsts/src/rules/S138/meta.ts b/packages/jsts/src/rules/S138/meta.ts index c1adbefac74..7ad3260246b 100644 --- a/packages/jsts/src/rules/S138/meta.ts +++ b/packages/jsts/src/rules/S138/meta.ts @@ -14,33 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Functions should not have too many lines of code', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S138/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S138'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - maximum: { - type: 'integer', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'max-lines-per-function'; diff --git a/packages/jsts/src/rules/S138/rule.ts b/packages/jsts/src/rules/S138/rule.ts index 70b3ce067d4..6f32bb4fd5c 100644 --- a/packages/jsts/src/rules/S138/rule.ts +++ b/packages/jsts/src/rules/S138/rule.ts @@ -21,7 +21,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, getMainFunctionTokenLocation, diff --git a/packages/jsts/src/rules/S139/index.ts b/packages/jsts/src/rules/S139/index.ts new file mode 100644 index 00000000000..adc6d48f95b --- /dev/null +++ b/packages/jsts/src/rules/S139/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('line-comment-position'); diff --git a/packages/jsts/src/rules/S139/meta.ts b/packages/jsts/src/rules/S139/meta.ts new file mode 100644 index 00000000000..a8465034cbb --- /dev/null +++ b/packages/jsts/src/rules/S139/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'line-comment-position'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1438/index.ts b/packages/jsts/src/rules/S1438/index.ts index d530ba9f4fb..711c6fb4c1b 100644 --- a/packages/jsts/src/rules/S1438/index.ts +++ b/packages/jsts/src/rules/S1438/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(tsEslintRules['semi']); diff --git a/packages/jsts/src/rules/S1438/meta.ts b/packages/jsts/src/rules/S1438/meta.ts index 2191909b5c9..22eebe4c2fc 100644 --- a/packages/jsts/src/rules/S1438/meta.ts +++ b/packages/jsts/src/rules/S1438/meta.ts @@ -14,18 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Statements should end with semicolons', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1438/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', - deprecated: true, -}; - -export const sonarKey = 'S1438'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'semi'; +export const externalRules = [{ externalPlugin: 'typescript-eslint', externalRule: 'semi' }]; diff --git a/packages/jsts/src/rules/S1439/meta.ts b/packages/jsts/src/rules/S1439/meta.ts index 57810ea2771..68fccc0f6d2 100644 --- a/packages/jsts/src/rules/S1439/meta.ts +++ b/packages/jsts/src/rules/S1439/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Only "while", "do", "for" and "switch" statements should be labelled', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1439/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1439'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'label-position'; diff --git a/packages/jsts/src/rules/S1440/index.ts b/packages/jsts/src/rules/S1440/index.ts new file mode 100644 index 00000000000..1ef37d3e12b --- /dev/null +++ b/packages/jsts/src/rules/S1440/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('eqeqeq'); diff --git a/packages/jsts/src/rules/S1440/meta.ts b/packages/jsts/src/rules/S1440/meta.ts new file mode 100644 index 00000000000..d9935e62d31 --- /dev/null +++ b/packages/jsts/src/rules/S1440/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'eqeqeq'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1441/index.ts b/packages/jsts/src/rules/S1441/index.ts new file mode 100644 index 00000000000..e9566c9e58a --- /dev/null +++ b/packages/jsts/src/rules/S1441/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('quotes'); diff --git a/packages/jsts/src/rules/S1441/meta.ts b/packages/jsts/src/rules/S1441/meta.ts new file mode 100644 index 00000000000..454f089c438 --- /dev/null +++ b/packages/jsts/src/rules/S1441/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'quotes'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1442/index.ts b/packages/jsts/src/rules/S1442/index.ts new file mode 100644 index 00000000000..e1ebfc38f0e --- /dev/null +++ b/packages/jsts/src/rules/S1442/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-alert'); diff --git a/packages/jsts/src/rules/S1442/meta.ts b/packages/jsts/src/rules/S1442/meta.ts new file mode 100644 index 00000000000..bd4eaf179a3 --- /dev/null +++ b/packages/jsts/src/rules/S1442/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-alert'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1444/meta.ts b/packages/jsts/src/rules/S1444/meta.ts index fed2d86022e..3a7d8affcff 100644 --- a/packages/jsts/src/rules/S1444/meta.ts +++ b/packages/jsts/src/rules/S1444/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Public "static" fields should be read-only', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1444/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S1444'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'public-static-readonly'; diff --git a/packages/jsts/src/rules/S1451/meta.ts b/packages/jsts/src/rules/S1451/meta.ts index 4a24490b222..4bf0adbd3f7 100644 --- a/packages/jsts/src/rules/S1451/meta.ts +++ b/packages/jsts/src/rules/S1451/meta.ts @@ -14,36 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Track lack of copyright and license headers', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1451/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1451'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - headerFormat: { - type: 'string', - }, - isRegularExpression: { - type: 'boolean', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'file-header'; diff --git a/packages/jsts/src/rules/S1472/meta.ts b/packages/jsts/src/rules/S1472/meta.ts index 176cea4685d..f1561c162f6 100644 --- a/packages/jsts/src/rules/S1472/meta.ts +++ b/packages/jsts/src/rules/S1472/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Function call arguments should not start on new lines', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1472/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1472'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'call-argument-line'; diff --git a/packages/jsts/src/rules/S1472/rule.ts b/packages/jsts/src/rules/S1472/rule.ts index a138d6022d9..a27a7deb0b9 100644 --- a/packages/jsts/src/rules/S1472/rule.ts +++ b/packages/jsts/src/rules/S1472/rule.ts @@ -18,7 +18,7 @@ import { AST, Rule } from 'eslint'; import estree, { type Position } from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S1479/meta.ts b/packages/jsts/src/rules/S1479/meta.ts index 57ed4ddee8a..552a1ee7a0f 100644 --- a/packages/jsts/src/rules/S1479/meta.ts +++ b/packages/jsts/src/rules/S1479/meta.ts @@ -14,28 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"switch" statements should not have too many "case" clauses', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1479/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1479'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'integer', - minimum: 0, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'max-switch-cases'; diff --git a/packages/jsts/src/rules/S1481/meta.ts b/packages/jsts/src/rules/S1481/meta.ts index 67ff24bb9b4..05ccbf274e1 100644 --- a/packages/jsts/src/rules/S1481/meta.ts +++ b/packages/jsts/src/rules/S1481/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Unused local variables and functions should be removed', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1481/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1481'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-unused-vars'; diff --git a/packages/jsts/src/rules/S1488/meta.ts b/packages/jsts/src/rules/S1488/meta.ts index 97cae4a6559..1aa20edba55 100644 --- a/packages/jsts/src/rules/S1488/meta.ts +++ b/packages/jsts/src/rules/S1488/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Local variables should not be declared and then immediately returned or thrown', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1488/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S1488'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'prefer-immediate-return'; diff --git a/packages/jsts/src/rules/S1488/rule.ts b/packages/jsts/src/rules/S1488/rule.ts index 15ad7a03a87..453b4940cca 100644 --- a/packages/jsts/src/rules/S1488/rule.ts +++ b/packages/jsts/src/rules/S1488/rule.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S1488 -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, isIdentifier } from '../helpers/index.js'; import type { Rule } from 'eslint'; import estree from 'estree'; @@ -63,7 +63,7 @@ export const rule: Rule.RuleModule = { context.report({ messageId: 'doImmediateAction', data: { - action: last.type === AST_NODE_TYPES.ReturnStatement ? 'return' : 'throw', + action: last.type === 'ReturnStatement' ? 'return' : 'throw', variable: returnedIdentifier.name, }, node: declaredIdentifier.init, @@ -96,8 +96,7 @@ export const rule: Rule.RuleModule = { } function getOnlyReturnedVariable(node: estree.Statement) { - return (node.type === AST_NODE_TYPES.ReturnStatement || - node.type === AST_NODE_TYPES.ThrowStatement) && + return (node.type === 'ReturnStatement' || node.type === 'ThrowStatement') && node.argument && isIdentifier(node.argument) ? node.argument @@ -105,13 +104,9 @@ export const rule: Rule.RuleModule = { } function getOnlyDeclaredVariable(node: estree.Statement) { - if (node.type === AST_NODE_TYPES.VariableDeclaration && node.declarations.length === 1) { + if (node.type === 'VariableDeclaration' && node.declarations.length === 1) { const { id, init } = node.declarations[0]; - if ( - id.type === AST_NODE_TYPES.Identifier && - init && - !(id as TSESTree.Identifier).typeAnnotation - ) { + if (id.type === 'Identifier' && init && !(id as TSESTree.Identifier).typeAnnotation) { return { id, init }; } } diff --git a/packages/jsts/src/rules/S1515/meta.ts b/packages/jsts/src/rules/S1515/meta.ts index fd68f636083..5718664c64a 100644 --- a/packages/jsts/src/rules/S1515/meta.ts +++ b/packages/jsts/src/rules/S1515/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Functions should not be defined inside loops', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1515/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1515'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'function-inside-loop'; diff --git a/packages/jsts/src/rules/S1515/rule.ts b/packages/jsts/src/rules/S1515/rule.ts index 951da550e12..7732234666c 100644 --- a/packages/jsts/src/rules/S1515/rule.ts +++ b/packages/jsts/src/rules/S1515/rule.ts @@ -18,7 +18,7 @@ import { AST, Rule, Scope } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { findFirstMatchingAncestor, generateMeta, diff --git a/packages/jsts/src/rules/S1516/index.ts b/packages/jsts/src/rules/S1516/index.ts new file mode 100644 index 00000000000..018781b1b7a --- /dev/null +++ b/packages/jsts/src/rules/S1516/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-multi-str'); diff --git a/packages/jsts/src/rules/S1516/meta.ts b/packages/jsts/src/rules/S1516/meta.ts new file mode 100644 index 00000000000..f2169b8ded6 --- /dev/null +++ b/packages/jsts/src/rules/S1516/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-multi-str'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1523/meta.ts b/packages/jsts/src/rules/S1523/meta.ts index 640314f30e3..2fedea3d8fa 100644 --- a/packages/jsts/src/rules/S1523/meta.ts +++ b/packages/jsts/src/rules/S1523/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Dynamically executing code is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1523/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1523'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'code-eval'; diff --git a/packages/jsts/src/rules/S1523/rule.ts b/packages/jsts/src/rules/S1523/rule.ts index a7fa9b2e26c..c1c21d9af23 100644 --- a/packages/jsts/src/rules/S1523/rule.ts +++ b/packages/jsts/src/rules/S1523/rule.ts @@ -19,11 +19,11 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { generateMeta } from '../helpers/index.js'; import { meta } from './meta.js'; -const noScriptUrlRule = eslintRules['no-script-url']; +const noScriptUrlRule = getESLintCoreRule('no-script-url'); export const rule: Rule.RuleModule = { meta: generateMeta(meta as Rule.RuleMetaData, { diff --git a/packages/jsts/src/rules/S1525/index.ts b/packages/jsts/src/rules/S1525/index.ts new file mode 100644 index 00000000000..37f569415d7 --- /dev/null +++ b/packages/jsts/src/rules/S1525/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-debugger'); diff --git a/packages/jsts/src/rules/S1525/meta.ts b/packages/jsts/src/rules/S1525/meta.ts new file mode 100644 index 00000000000..c967d3784b0 --- /dev/null +++ b/packages/jsts/src/rules/S1525/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-debugger'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1526/meta.ts b/packages/jsts/src/rules/S1526/meta.ts index 1e4347c6093..d68dab2896f 100644 --- a/packages/jsts/src/rules/S1526/meta.ts +++ b/packages/jsts/src/rules/S1526/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Variables declared with "var" should be declared before they are used', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1526/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1526'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-variable-usage-before-declaration'; diff --git a/packages/jsts/src/rules/S1527/meta.ts b/packages/jsts/src/rules/S1527/meta.ts index 704f4fac9be..0883fc84760 100644 --- a/packages/jsts/src/rules/S1527/meta.ts +++ b/packages/jsts/src/rules/S1527/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Future reserved words should not be used as identifiers', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1527/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1527'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'future-reserved-words'; diff --git a/packages/jsts/src/rules/S1528/meta.ts b/packages/jsts/src/rules/S1528/meta.ts index 1a434135265..fa3818ee035 100644 --- a/packages/jsts/src/rules/S1528/meta.ts +++ b/packages/jsts/src/rules/S1528/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Array constructors should not be used', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1528/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S1528'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'array-constructor'; diff --git a/packages/jsts/src/rules/S1529/meta.ts b/packages/jsts/src/rules/S1529/meta.ts index 32e0c6a8488..7f60dd1f41f 100644 --- a/packages/jsts/src/rules/S1529/meta.ts +++ b/packages/jsts/src/rules/S1529/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Bitwise operators should not be used in boolean contexts', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1529/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1529'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'bitwise-operators'; diff --git a/packages/jsts/src/rules/S1530/meta.ts b/packages/jsts/src/rules/S1530/meta.ts index 110d2fdcaa0..495f5a418df 100644 --- a/packages/jsts/src/rules/S1530/meta.ts +++ b/packages/jsts/src/rules/S1530/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Function declarations should not be made within blocks', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1530/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1530'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-function-declaration-in-block'; diff --git a/packages/jsts/src/rules/S1530/rule.ts b/packages/jsts/src/rules/S1530/rule.ts index c34ccbf2a83..a84297b9a75 100644 --- a/packages/jsts/src/rules/S1530/rule.ts +++ b/packages/jsts/src/rules/S1530/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, getMainFunctionTokenLocation, diff --git a/packages/jsts/src/rules/S1533/meta.ts b/packages/jsts/src/rules/S1533/meta.ts index fd2aae909da..1d4369e47de 100644 --- a/packages/jsts/src/rules/S1533/meta.ts +++ b/packages/jsts/src/rules/S1533/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Wrapper objects should not be used for primitive types', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1533/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S1533'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-primitive-wrappers'; diff --git a/packages/jsts/src/rules/S1534/meta.ts b/packages/jsts/src/rules/S1534/meta.ts index e24902f3421..529ef603cfc 100644 --- a/packages/jsts/src/rules/S1534/meta.ts +++ b/packages/jsts/src/rules/S1534/meta.ts @@ -14,17 +14,11 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Member names should not be duplicated within a class or object literal', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1534/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S1534'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-dupe-keys'; +export const externalRules = [ + { externalPlugin: 'eslint', externalRule: 'no-dupe-keys' }, + { externalPlugin: 'typescript-eslint', externalRule: 'no-dupe-class-members' }, + { externalPlugin: 'react', externalRule: 'jsx-no-duplicate-props' }, +]; diff --git a/packages/jsts/src/rules/S1534/rule.ts b/packages/jsts/src/rules/S1534/rule.ts index 0784f6b7eb8..66355ad7c7b 100644 --- a/packages/jsts/src/rules/S1534/rule.ts +++ b/packages/jsts/src/rules/S1534/rule.ts @@ -17,15 +17,14 @@ // https://sonarsource.github.io/rspec/#/rspec/S1534/javascript import type { Rule } from 'eslint'; -import { eslintRules } from '../core/index.js'; -import { tsEslintRules } from '../typescript-eslint/index.js'; -import pkg from 'eslint-plugin-react'; -const { rules: reactRules } = pkg; +import { getESLintCoreRule } from '../external/core.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; +import { rules as reactRules } from '../external/react.js'; import { generateMeta, mergeRules } from '../helpers/index.js'; import { decorate } from './decorator.js'; import { meta } from './meta.js'; -const noDupeKeysRule = decorate(eslintRules['no-dupe-keys']); +const noDupeKeysRule = decorate(getESLintCoreRule('no-dupe-keys')); const noDupeClassMembersRule = tsEslintRules['no-dupe-class-members']; const jsxNoDuplicatePropsRule = reactRules['jsx-no-duplicate-props']; diff --git a/packages/jsts/src/rules/S1535/meta.ts b/packages/jsts/src/rules/S1535/meta.ts index 42da549dcd4..c1ff9ff6888 100644 --- a/packages/jsts/src/rules/S1535/meta.ts +++ b/packages/jsts/src/rules/S1535/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: '"for...in" loops should filter properties before acting on them', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1535/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1535'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'for-in'; diff --git a/packages/jsts/src/rules/S1536/index.ts b/packages/jsts/src/rules/S1536/index.ts new file mode 100644 index 00000000000..a6f596f03a9 --- /dev/null +++ b/packages/jsts/src/rules/S1536/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-dupe-args'); diff --git a/packages/jsts/src/rules/S1536/meta.ts b/packages/jsts/src/rules/S1536/meta.ts new file mode 100644 index 00000000000..6bb7e3f492f --- /dev/null +++ b/packages/jsts/src/rules/S1536/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-dupe-args'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1537/index.ts b/packages/jsts/src/rules/S1537/index.ts new file mode 100644 index 00000000000..56df653cc4f --- /dev/null +++ b/packages/jsts/src/rules/S1537/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['comma-dangle']; diff --git a/packages/jsts/src/rules/S1537/meta.ts b/packages/jsts/src/rules/S1537/meta.ts new file mode 100644 index 00000000000..1eb18848dcd --- /dev/null +++ b/packages/jsts/src/rules/S1537/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'comma-dangle'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S1539/index.ts b/packages/jsts/src/rules/S1539/index.ts new file mode 100644 index 00000000000..6fbdee94128 --- /dev/null +++ b/packages/jsts/src/rules/S1539/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('strict'); diff --git a/packages/jsts/src/rules/S1539/meta.ts b/packages/jsts/src/rules/S1539/meta.ts new file mode 100644 index 00000000000..c1067fc2b9c --- /dev/null +++ b/packages/jsts/src/rules/S1539/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'strict'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1541/meta.ts b/packages/jsts/src/rules/S1541/meta.ts index 280e93a1e8f..5ed749c5913 100644 --- a/packages/jsts/src/rules/S1541/meta.ts +++ b/packages/jsts/src/rules/S1541/meta.ts @@ -14,33 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Cyclomatic Complexity of functions should not be too high', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1541/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1541'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 2, - items: [ - { - type: 'object', - properties: { - threshold: { - type: 'integer', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'cyclomatic-complexity'; diff --git a/packages/jsts/src/rules/S1541/rule.ts b/packages/jsts/src/rules/S1541/rule.ts index c067d5407f5..29ed3c544a9 100644 --- a/packages/jsts/src/rules/S1541/rule.ts +++ b/packages/jsts/src/rules/S1541/rule.ts @@ -29,7 +29,7 @@ import { IssueLocation, RuleContext, } from '../helpers/index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { FromSchema } from 'json-schema-to-ts'; import { meta, schema } from './meta.js'; diff --git a/packages/jsts/src/rules/S1607/meta.ts b/packages/jsts/src/rules/S1607/meta.ts index 4139733be4c..580c6698163 100644 --- a/packages/jsts/src/rules/S1607/meta.ts +++ b/packages/jsts/src/rules/S1607/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Tests should not be skipped without providing a reason', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1607/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1607'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-skipped-tests'; diff --git a/packages/jsts/src/rules/S1607/rule.ts b/packages/jsts/src/rules/S1607/rule.ts index 0351dc60a46..3fcf457cbbe 100644 --- a/packages/jsts/src/rules/S1607/rule.ts +++ b/packages/jsts/src/rules/S1607/rule.ts @@ -33,7 +33,7 @@ import { toUnixPath, } from '../helpers/index.js'; import { meta } from './meta.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { dirname } from 'path/posix'; export const rule: Rule.RuleModule = { diff --git a/packages/jsts/src/rules/S1656/index.ts b/packages/jsts/src/rules/S1656/index.ts new file mode 100644 index 00000000000..dc313929608 --- /dev/null +++ b/packages/jsts/src/rules/S1656/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-self-assign'); diff --git a/packages/jsts/src/rules/S1656/meta.ts b/packages/jsts/src/rules/S1656/meta.ts new file mode 100644 index 00000000000..b949d3fe831 --- /dev/null +++ b/packages/jsts/src/rules/S1656/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-self-assign'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1751/meta.ts b/packages/jsts/src/rules/S1751/meta.ts index 75937a0a126..b60eeaaa037 100644 --- a/packages/jsts/src/rules/S1751/meta.ts +++ b/packages/jsts/src/rules/S1751/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Loops with at most one iteration should be refactored', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1751/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1751'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-one-iteration-loop'; diff --git a/packages/jsts/src/rules/S1751/rule.ts b/packages/jsts/src/rules/S1751/rule.ts index 2ce0863970a..a90a6daf0b0 100644 --- a/packages/jsts/src/rules/S1751/rule.ts +++ b/packages/jsts/src/rules/S1751/rule.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S1751 -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import type { Rule } from 'eslint'; import estree from 'estree'; import { generateMeta } from '../helpers/index.js'; @@ -69,7 +69,7 @@ export const rule: Rule.RuleModule = { visitLoopChild((node as TSESTree.Node).parent as estree.ForStatement); }, onCodePathSegmentLoop(_: unknown, toSegment: Rule.CodePathSegment, node: estree.Node) { - if (node.type === AST_NODE_TYPES.ContinueStatement) { + if (node.type === 'ContinueStatement') { loopsAndTheirSegments.forEach(({ segments, loop }) => { if (segments.includes(toSegment)) { loopingNodes.add(loop); diff --git a/packages/jsts/src/rules/S1763/index.ts b/packages/jsts/src/rules/S1763/index.ts index 553abf49c91..bf510ad181d 100644 --- a/packages/jsts/src/rules/S1763/index.ts +++ b/packages/jsts/src/rules/S1763/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['no-unreachable']); +export const rule = decorate(getESLintCoreRule('no-unreachable')); diff --git a/packages/jsts/src/rules/S1763/meta.ts b/packages/jsts/src/rules/S1763/meta.ts index 8601d086116..18190adfe06 100644 --- a/packages/jsts/src/rules/S1763/meta.ts +++ b/packages/jsts/src/rules/S1763/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'All code should be reachable', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1763/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S1763'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-unreachable'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'no-unreachable' }]; diff --git a/packages/jsts/src/rules/S1764/meta.ts b/packages/jsts/src/rules/S1764/meta.ts index d430f887916..1b8e6ffda5c 100644 --- a/packages/jsts/src/rules/S1764/meta.ts +++ b/packages/jsts/src/rules/S1764/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Identical expressions should not be used on both sides of a binary operator', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1764/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1764'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-identical-expressions'; diff --git a/packages/jsts/src/rules/S1774/index.ts b/packages/jsts/src/rules/S1774/index.ts new file mode 100644 index 00000000000..b53138e2c49 --- /dev/null +++ b/packages/jsts/src/rules/S1774/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-ternary'); diff --git a/packages/jsts/src/rules/S1774/meta.ts b/packages/jsts/src/rules/S1774/meta.ts new file mode 100644 index 00000000000..5fdaa7e6a06 --- /dev/null +++ b/packages/jsts/src/rules/S1774/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-ternary'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S1788/index.ts b/packages/jsts/src/rules/S1788/index.ts index c82c779198a..b1fde7a187e 100644 --- a/packages/jsts/src/rules/S1788/index.ts +++ b/packages/jsts/src/rules/S1788/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(tsEslintRules['default-param-last']); diff --git a/packages/jsts/src/rules/S1788/meta.ts b/packages/jsts/src/rules/S1788/meta.ts index dc05de122fb..ddde242e1dc 100644 --- a/packages/jsts/src/rules/S1788/meta.ts +++ b/packages/jsts/src/rules/S1788/meta.ts @@ -14,16 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Function parameters with default values should be last', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1788/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1788'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'default-param-last'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'default-param-last' }, +]; diff --git a/packages/jsts/src/rules/S1821/meta.ts b/packages/jsts/src/rules/S1821/meta.ts index 9597e4b9bf5..f02e59beb71 100644 --- a/packages/jsts/src/rules/S1821/meta.ts +++ b/packages/jsts/src/rules/S1821/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"switch" statements should not be nested', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1821/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1821'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-nested-switch'; diff --git a/packages/jsts/src/rules/S1848/meta.ts b/packages/jsts/src/rules/S1848/meta.ts index ba6c717a280..ba6e7b5488a 100644 --- a/packages/jsts/src/rules/S1848/meta.ts +++ b/packages/jsts/src/rules/S1848/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Objects should not be created to be dropped immediately without being used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1848/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1848'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'constructor-for-side-effects'; diff --git a/packages/jsts/src/rules/S1854/meta.ts b/packages/jsts/src/rules/S1854/meta.ts index b1fd7289667..bf026c493e4 100644 --- a/packages/jsts/src/rules/S1854/meta.ts +++ b/packages/jsts/src/rules/S1854/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Unused assignments should be removed', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1854/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1854'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-dead-store'; diff --git a/packages/jsts/src/rules/S1854/rule.ts b/packages/jsts/src/rules/S1854/rule.ts index 2b7255e24fe..14f82903b9e 100644 --- a/packages/jsts/src/rules/S1854/rule.ts +++ b/packages/jsts/src/rules/S1854/rule.ts @@ -18,7 +18,7 @@ import type { Rule, Scope } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, isNullLiteral, diff --git a/packages/jsts/src/rules/S1862/meta.ts b/packages/jsts/src/rules/S1862/meta.ts index 6b9896b5bb5..c923d204749 100644 --- a/packages/jsts/src/rules/S1862/meta.ts +++ b/packages/jsts/src/rules/S1862/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: '"if/else if" chains and "switch" cases should not have the same condition', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1862/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1862'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-identical-conditions'; diff --git a/packages/jsts/src/rules/S1862/rule.ts b/packages/jsts/src/rules/S1862/rule.ts index 71caa08788c..27304a08752 100644 --- a/packages/jsts/src/rules/S1862/rule.ts +++ b/packages/jsts/src/rules/S1862/rule.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S1862 -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { Rule, SourceCode } from 'eslint'; import { areEquivalent, generateMeta, report, toSecondaryLocation } from '../helpers/index.js'; import estree from 'estree'; @@ -111,7 +111,7 @@ const splitByOr = splitByLogicalOperator.bind(null, '||'); const splitByAnd = splitByLogicalOperator.bind(null, '&&'); function splitByLogicalOperator(operator: '??' | '&&' | '||', node: estree.Node): estree.Node[] { - if (node.type === AST_NODE_TYPES.LogicalExpression && node.operator === operator) { + if (node.type === 'LogicalExpression' && node.operator === operator) { return [ ...splitByLogicalOperator(operator, node.left), ...splitByLogicalOperator(operator, node.right), @@ -128,7 +128,7 @@ function isSubset(first: estree.Node[], second: estree.Node[], sourceCode: Sourc return false; } - if (first.type === AST_NODE_TYPES.LogicalExpression) { + if (first.type === 'LogicalExpression') { const second1 = second as estree.LogicalExpression; if ( (first.operator === '||' || first.operator === '&&') && diff --git a/packages/jsts/src/rules/S1871/meta.ts b/packages/jsts/src/rules/S1871/meta.ts index 5834dffa00c..4fa39b2300b 100644 --- a/packages/jsts/src/rules/S1871/meta.ts +++ b/packages/jsts/src/rules/S1871/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: - 'Two branches in a conditional structure should not have exactly the same implementation', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1871/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1871'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-duplicated-branches'; diff --git a/packages/jsts/src/rules/S1871/rule.ts b/packages/jsts/src/rules/S1871/rule.ts index f7f20db3fd0..2635a0d9c38 100644 --- a/packages/jsts/src/rules/S1871/rule.ts +++ b/packages/jsts/src/rules/S1871/rule.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S1871 -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { areEquivalent, collectIfBranches, @@ -139,7 +139,7 @@ export const rule: Rule.RuleModule = { function expandSingleBlockStatement(nodes: estree.Statement[]) { if (nodes.length === 1) { const node = nodes[0]; - if (node.type === AST_NODE_TYPES.BlockStatement) { + if (node.type === 'BlockStatement') { return node.body; } } diff --git a/packages/jsts/src/rules/S1874/meta.ts b/packages/jsts/src/rules/S1874/meta.ts index 933e0a66ad2..3c4d7872a50 100644 --- a/packages/jsts/src/rules/S1874/meta.ts +++ b/packages/jsts/src/rules/S1874/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Deprecated APIs should not be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1874/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S1874'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'deprecation'; diff --git a/packages/jsts/src/rules/S1940/meta.ts b/packages/jsts/src/rules/S1940/meta.ts index 842882cc0c6..4bd0479d19a 100644 --- a/packages/jsts/src/rules/S1940/meta.ts +++ b/packages/jsts/src/rules/S1940/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Boolean checks should not be inverted', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1940/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S1940'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-inverted-boolean-check'; diff --git a/packages/jsts/src/rules/S1940/rule.ts b/packages/jsts/src/rules/S1940/rule.ts index 007327f65f3..ceae2ac9cf8 100644 --- a/packages/jsts/src/rules/S1940/rule.ts +++ b/packages/jsts/src/rules/S1940/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta } from '../helpers/index.js'; import { meta } from './meta.js'; @@ -50,10 +50,7 @@ export const rule: Rule.RuleModule = { }; function visitUnaryExpression(unaryExpression: estree.UnaryExpression, context: Rule.RuleContext) { - if ( - unaryExpression.operator === '!' && - unaryExpression.argument.type === AST_NODE_TYPES.BinaryExpression - ) { + if (unaryExpression.operator === '!' && unaryExpression.argument.type === 'BinaryExpression') { const condition: estree.BinaryExpression = unaryExpression.argument; const invertedOperator = invertedOperators[condition.operator]; if (invertedOperator) { diff --git a/packages/jsts/src/rules/S1994/meta.ts b/packages/jsts/src/rules/S1994/meta.ts index 30fe8488620..a185664f049 100644 --- a/packages/jsts/src/rules/S1994/meta.ts +++ b/packages/jsts/src/rules/S1994/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"for" loop increment clauses should modify the loops\' counters', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S1994/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S1994'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'misplaced-loop-counter'; diff --git a/packages/jsts/src/rules/S1994/rule.ts b/packages/jsts/src/rules/S1994/rule.ts index 55a31a66744..1182b48bde6 100644 --- a/packages/jsts/src/rules/S1994/rule.ts +++ b/packages/jsts/src/rules/S1994/rule.ts @@ -19,7 +19,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; import { areEquivalent, generateMeta, getParent } from '../helpers/index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; class ForInfo { diff --git a/packages/jsts/src/rules/S2004/meta.ts b/packages/jsts/src/rules/S2004/meta.ts index 5fcdd6b40f4..83aa23611b3 100644 --- a/packages/jsts/src/rules/S2004/meta.ts +++ b/packages/jsts/src/rules/S2004/meta.ts @@ -14,33 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Functions should not be nested too deeply', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2004/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2004'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 2, - items: [ - { - type: 'object', - properties: { - threshold: { - type: 'integer', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-nested-functions'; diff --git a/packages/jsts/src/rules/S2004/rule.ts b/packages/jsts/src/rules/S2004/rule.ts index 5057d38cd80..6e9e317f6dd 100644 --- a/packages/jsts/src/rules/S2004/rule.ts +++ b/packages/jsts/src/rules/S2004/rule.ts @@ -18,7 +18,7 @@ import estree from 'estree'; import type { Rule } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, getMainFunctionTokenLocation, diff --git a/packages/jsts/src/rules/S2068/meta.ts b/packages/jsts/src/rules/S2068/meta.ts index 7fd4fe51236..fc294fb3da1 100644 --- a/packages/jsts/src/rules/S2068/meta.ts +++ b/packages/jsts/src/rules/S2068/meta.ts @@ -14,36 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Hard-coded passwords are security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2068/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2068'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - passwordWords: { - type: 'array', - items: { - type: 'string', - }, - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-hardcoded-passwords'; diff --git a/packages/jsts/src/rules/S2077/meta.ts b/packages/jsts/src/rules/S2077/meta.ts index 44dd5db2c4e..75ee7f6d56c 100644 --- a/packages/jsts/src/rules/S2077/meta.ts +++ b/packages/jsts/src/rules/S2077/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Formatting SQL queries is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2077/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2077'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'sql-queries'; diff --git a/packages/jsts/src/rules/S2092/meta.ts b/packages/jsts/src/rules/S2092/meta.ts index bd08aa214b1..7648b8e76a7 100644 --- a/packages/jsts/src/rules/S2092/meta.ts +++ b/packages/jsts/src/rules/S2092/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Creating cookies without the "secure" flag is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2092/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2092'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'insecure-cookie'; diff --git a/packages/jsts/src/rules/S2094/index.ts b/packages/jsts/src/rules/S2094/index.ts new file mode 100644 index 00000000000..cd05c0d8b43 --- /dev/null +++ b/packages/jsts/src/rules/S2094/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['no-extraneous-class']; diff --git a/packages/jsts/src/rules/S2094/meta.ts b/packages/jsts/src/rules/S2094/meta.ts new file mode 100644 index 00000000000..540f7d9cfbd --- /dev/null +++ b/packages/jsts/src/rules/S2094/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-extraneous-class'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S2123/meta.ts b/packages/jsts/src/rules/S2123/meta.ts index a03ee147533..cdf00caea15 100644 --- a/packages/jsts/src/rules/S2123/meta.ts +++ b/packages/jsts/src/rules/S2123/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Values should not be uselessly incremented', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2123/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2123'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-useless-increment'; diff --git a/packages/jsts/src/rules/S2137/meta.ts b/packages/jsts/src/rules/S2137/meta.ts index e408a1cab52..dc3447474d2 100644 --- a/packages/jsts/src/rules/S2137/meta.ts +++ b/packages/jsts/src/rules/S2137/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Special identifiers should not be bound or assigned', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2137/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2137'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-globals-shadowing'; diff --git a/packages/jsts/src/rules/S2138/meta.ts b/packages/jsts/src/rules/S2138/meta.ts index 3f8da5135a3..e1d110b3bd3 100644 --- a/packages/jsts/src/rules/S2138/meta.ts +++ b/packages/jsts/src/rules/S2138/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"undefined" should not be assigned', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2138/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2138'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-undefined-assignment'; diff --git a/packages/jsts/src/rules/S2187/meta.ts b/packages/jsts/src/rules/S2187/meta.ts index d2cf37935d8..cfa393f37a3 100644 --- a/packages/jsts/src/rules/S2187/meta.ts +++ b/packages/jsts/src/rules/S2187/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Test files should contain at least one test case', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2187/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2187'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-empty-test-file'; diff --git a/packages/jsts/src/rules/S2189/meta.ts b/packages/jsts/src/rules/S2189/meta.ts index a6fbef6760f..3aba5d8843e 100644 --- a/packages/jsts/src/rules/S2189/meta.ts +++ b/packages/jsts/src/rules/S2189/meta.ts @@ -14,16 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Loops should not be infinite', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2189/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2189'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-infinite-loop'; +export const externalRules = [ + { externalPlugin: 'eslint', externalRule: 'no-unmodified-loop-condition' }, +]; diff --git a/packages/jsts/src/rules/S2189/rule.ts b/packages/jsts/src/rules/S2189/rule.ts index 2e92fdb3427..cd5e6f1a1e7 100644 --- a/packages/jsts/src/rules/S2189/rule.ts +++ b/packages/jsts/src/rules/S2189/rule.ts @@ -17,7 +17,7 @@ // https://sonarsource.github.io/rspec/#/rspec/S2189/javascript import { Rule, Scope } from 'eslint'; -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import estree from 'estree'; import { childrenOf, @@ -26,10 +26,10 @@ import { isUndefined, mergeRules, } from '../helpers/index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; -const noUnmodifiedLoopEslint = eslintRules['no-unmodified-loop-condition']; +const noUnmodifiedLoopEslint = getESLintCoreRule('no-unmodified-loop-condition'); export const rule: Rule.RuleModule = { meta: generateMeta(meta as Rule.RuleMetaData, { diff --git a/packages/jsts/src/rules/S2201/meta.ts b/packages/jsts/src/rules/S2201/meta.ts index 263abdab490..704e9f013f1 100644 --- a/packages/jsts/src/rules/S2201/meta.ts +++ b/packages/jsts/src/rules/S2201/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Return values from functions without side effects should not be ignored', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2201/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S2201'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-ignored-return'; diff --git a/packages/jsts/src/rules/S2201/rule.ts b/packages/jsts/src/rules/S2201/rule.ts index 91fdc4dd148..3c2efb598af 100644 --- a/packages/jsts/src/rules/S2201/rule.ts +++ b/packages/jsts/src/rules/S2201/rule.ts @@ -16,8 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S2201 -import type { ParserServicesWithTypeInformation } from '@typescript-eslint/utils'; -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/utils'; import type * as TS from 'typescript'; import type { Rule } from 'eslint'; import { generateMeta, getTypeFromTreeNode, isRequiredParserServices } from '../helpers/index.js'; @@ -187,7 +186,7 @@ export const rule: Rule.RuleModule = { CallExpression: (node: estree.Node) => { const call = node as estree.CallExpression; const { callee } = call; - if (callee.type === AST_NODE_TYPES.MemberExpression) { + if (callee.type === 'MemberExpression') { const { parent } = node as TSESTree.MemberExpression; if (parent && parent.type === 'ExpressionStatement') { const methodName = context.sourceCode.getText(callee.property as estree.Node); diff --git a/packages/jsts/src/rules/S2208/meta.ts b/packages/jsts/src/rules/S2208/meta.ts index bdc95843233..6ff23db093a 100644 --- a/packages/jsts/src/rules/S2208/meta.ts +++ b/packages/jsts/src/rules/S2208/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Wildcard imports should not be used', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2208/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2208'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-wildcard-import'; diff --git a/packages/jsts/src/rules/S2234/meta.ts b/packages/jsts/src/rules/S2234/meta.ts index d57a0ab9a32..0fd71b0bf6a 100644 --- a/packages/jsts/src/rules/S2234/meta.ts +++ b/packages/jsts/src/rules/S2234/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Parameters should be passed in the correct order', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2234/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S2234'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'arguments-order'; diff --git a/packages/jsts/src/rules/S2234/rule.ts b/packages/jsts/src/rules/S2234/rule.ts index 933be460176..b54bc27cbf6 100644 --- a/packages/jsts/src/rules/S2234/rule.ts +++ b/packages/jsts/src/rules/S2234/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { FunctionNodeType, generateMeta, diff --git a/packages/jsts/src/rules/S2245/meta.ts b/packages/jsts/src/rules/S2245/meta.ts index 000fa166935..452d348aed6 100644 --- a/packages/jsts/src/rules/S2245/meta.ts +++ b/packages/jsts/src/rules/S2245/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using pseudorandom number generators (PRNGs) is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2245/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2245'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'pseudo-random'; diff --git a/packages/jsts/src/rules/S2251/meta.ts b/packages/jsts/src/rules/S2251/meta.ts index d286febd09a..0dfe560a6c3 100644 --- a/packages/jsts/src/rules/S2251/meta.ts +++ b/packages/jsts/src/rules/S2251/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'A "for" loop update clause should move the counter in the right direction', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2251/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2251'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'for-loop-increment-sign'; diff --git a/packages/jsts/src/rules/S2255/meta.ts b/packages/jsts/src/rules/S2255/meta.ts index f152ae062db..06a52233b0a 100644 --- a/packages/jsts/src/rules/S2255/meta.ts +++ b/packages/jsts/src/rules/S2255/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Writing cookies is security-sensitive', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2255/javascript', - requiresTypeChecking: false, - }, - deprecated: true, -}; - -export const sonarKey = 'S2255'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'cookies'; diff --git a/packages/jsts/src/rules/S2259/meta.ts b/packages/jsts/src/rules/S2259/meta.ts index 4590e880623..52a4a3475f5 100644 --- a/packages/jsts/src/rules/S2259/meta.ts +++ b/packages/jsts/src/rules/S2259/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Properties of variables with "null" or "undefined" values should not be accessed', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2259/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S2259'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'null-dereference'; diff --git a/packages/jsts/src/rules/S2259/rule.ts b/packages/jsts/src/rules/S2259/rule.ts index afb682d9e50..5e047d48f30 100644 --- a/packages/jsts/src/rules/S2259/rule.ts +++ b/packages/jsts/src/rules/S2259/rule.ts @@ -18,7 +18,7 @@ import { Rule, Scope } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { areEquivalent, findFirstMatchingAncestor, diff --git a/packages/jsts/src/rules/S2301/meta.ts b/packages/jsts/src/rules/S2301/meta.ts index 715d23cac8c..fa5b7d9f65d 100644 --- a/packages/jsts/src/rules/S2301/meta.ts +++ b/packages/jsts/src/rules/S2301/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Methods should not contain selector parameters', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2301/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S2301'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-selector-parameter'; diff --git a/packages/jsts/src/rules/S2310/meta.ts b/packages/jsts/src/rules/S2310/meta.ts index 0d754f7611b..822917c6568 100644 --- a/packages/jsts/src/rules/S2310/meta.ts +++ b/packages/jsts/src/rules/S2310/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Loop counters should not be assigned within the loop body', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2310/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2310'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'updated-loop-counter'; diff --git a/packages/jsts/src/rules/S2310/rule.ts b/packages/jsts/src/rules/S2310/rule.ts index 999a62a56d0..37dadc3246e 100644 --- a/packages/jsts/src/rules/S2310/rule.ts +++ b/packages/jsts/src/rules/S2310/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, getParent, diff --git a/packages/jsts/src/rules/S2376/decorator.ts b/packages/jsts/src/rules/S2376/decorator.ts index 9d00ce50a8c..8b6b11dd2ab 100644 --- a/packages/jsts/src/rules/S2376/decorator.ts +++ b/packages/jsts/src/rules/S2376/decorator.ts @@ -15,7 +15,7 @@ * along with this program; if not, see https://sonarsource.com/license/ssal/ */ import type { Rule } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, interceptReport } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S2376/index.ts b/packages/jsts/src/rules/S2376/index.ts index f0aeb76bef9..a66c686b6ae 100644 --- a/packages/jsts/src/rules/S2376/index.ts +++ b/packages/jsts/src/rules/S2376/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['accessor-pairs']); +export const rule = decorate(getESLintCoreRule('accessor-pairs')); diff --git a/packages/jsts/src/rules/S2376/meta.ts b/packages/jsts/src/rules/S2376/meta.ts index 2c1df0ed39a..062b1412d7d 100644 --- a/packages/jsts/src/rules/S2376/meta.ts +++ b/packages/jsts/src/rules/S2376/meta.ts @@ -14,16 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Property getters and setters should come in pairs', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2376/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2376'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'accessor-pairs'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'accessor-pairs' }]; diff --git a/packages/jsts/src/rules/S2392/meta.ts b/packages/jsts/src/rules/S2392/meta.ts index 56183d89ead..3ce21ae449a 100644 --- a/packages/jsts/src/rules/S2392/meta.ts +++ b/packages/jsts/src/rules/S2392/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Variables should be used in the blocks where they are declared', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2392/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2392'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'block-scoped-var'; diff --git a/packages/jsts/src/rules/S2424/meta.ts b/packages/jsts/src/rules/S2424/meta.ts index cd344d44e20..477eb1ac942 100644 --- a/packages/jsts/src/rules/S2424/meta.ts +++ b/packages/jsts/src/rules/S2424/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Built-in objects should not be overridden', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2424/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2424'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-built-in-override'; diff --git a/packages/jsts/src/rules/S2424/rule.ts b/packages/jsts/src/rules/S2424/rule.ts index 6f2f555e158..ce62ff49241 100644 --- a/packages/jsts/src/rules/S2424/rule.ts +++ b/packages/jsts/src/rules/S2424/rule.ts @@ -19,7 +19,7 @@ import { generateMeta, globalsByLibraries } from '../helpers/index.js'; import { Rule, Scope } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; export const rule: Rule.RuleModule = { diff --git a/packages/jsts/src/rules/S2427/index.ts b/packages/jsts/src/rules/S2427/index.ts new file mode 100644 index 00000000000..6339dbd6bf3 --- /dev/null +++ b/packages/jsts/src/rules/S2427/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('radix'); diff --git a/packages/jsts/src/rules/S2427/meta.ts b/packages/jsts/src/rules/S2427/meta.ts new file mode 100644 index 00000000000..22194932995 --- /dev/null +++ b/packages/jsts/src/rules/S2427/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'radix'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S2428/meta.ts b/packages/jsts/src/rules/S2428/meta.ts index 67c4af112cc..a9cdad3e418 100644 --- a/packages/jsts/src/rules/S2428/meta.ts +++ b/packages/jsts/src/rules/S2428/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Object literal syntax should be used', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2428/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2428'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'prefer-object-literal'; diff --git a/packages/jsts/src/rules/S2428/rule.ts b/packages/jsts/src/rules/S2428/rule.ts index 2408a036a3a..2a0736cc02d 100644 --- a/packages/jsts/src/rules/S2428/rule.ts +++ b/packages/jsts/src/rules/S2428/rule.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S2428 -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { Rule, SourceCode } from 'eslint'; import { areEquivalent, @@ -60,7 +60,7 @@ function checkObjectInitialization(statements: estree.Statement[], context: Rule } function getObjectDeclaration(statement: estree.Statement) { - if (statement.type === AST_NODE_TYPES.VariableDeclaration) { + if (statement.type === 'VariableDeclaration') { return statement.declarations.find( declaration => !!declaration.init && isEmptyObjectExpression(declaration.init), ); @@ -69,7 +69,7 @@ function getObjectDeclaration(statement: estree.Statement) { } function isEmptyObjectExpression(expression: estree.Expression) { - return expression.type === AST_NODE_TYPES.ObjectExpression && expression.properties.length === 0; + return expression.type === 'ObjectExpression' && expression.properties.length === 0; } function isPropertyAssignment( @@ -78,11 +78,11 @@ function isPropertyAssignment( sourceCode: SourceCode, ) { if ( - statement.type === AST_NODE_TYPES.ExpressionStatement && - statement.expression.type === AST_NODE_TYPES.AssignmentExpression + statement.type === 'ExpressionStatement' && + statement.expression.type === 'AssignmentExpression' ) { const { left, right } = statement.expression; - if (left.type === AST_NODE_TYPES.MemberExpression) { + if (left.type === 'MemberExpression') { return ( !left.computed && isSingleLineExpression(right, sourceCode) && diff --git a/packages/jsts/src/rules/S2430/index.ts b/packages/jsts/src/rules/S2430/index.ts index f66aa81edac..a72b2dd46d0 100644 --- a/packages/jsts/src/rules/S2430/index.ts +++ b/packages/jsts/src/rules/S2430/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['new-cap']); +export const rule = decorate(getESLintCoreRule('new-cap')); diff --git a/packages/jsts/src/rules/S2430/meta.ts b/packages/jsts/src/rules/S2430/meta.ts index 3323284ddc4..161066f6ba4 100644 --- a/packages/jsts/src/rules/S2430/meta.ts +++ b/packages/jsts/src/rules/S2430/meta.ts @@ -14,16 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Constructor names should start with an upper case letter', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2430/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2430'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'new-cap'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'new-cap' }]; diff --git a/packages/jsts/src/rules/S2432/index.ts b/packages/jsts/src/rules/S2432/index.ts new file mode 100644 index 00000000000..1339b28b023 --- /dev/null +++ b/packages/jsts/src/rules/S2432/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-setter-return'); diff --git a/packages/jsts/src/rules/S2432/meta.ts b/packages/jsts/src/rules/S2432/meta.ts new file mode 100644 index 00000000000..434d0e9c98d --- /dev/null +++ b/packages/jsts/src/rules/S2432/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-setter-return'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S2486/meta.ts b/packages/jsts/src/rules/S2486/meta.ts index 33ff1954a2b..ea28f16041a 100644 --- a/packages/jsts/src/rules/S2486/meta.ts +++ b/packages/jsts/src/rules/S2486/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Exceptions should not be ignored', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2486/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2486'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-ignored-exceptions'; diff --git a/packages/jsts/src/rules/S2589/meta.ts b/packages/jsts/src/rules/S2589/meta.ts index c6b13083588..72332e46bbb 100644 --- a/packages/jsts/src/rules/S2589/meta.ts +++ b/packages/jsts/src/rules/S2589/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Boolean expressions should not be gratuitous', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2589/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2589'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-gratuitous-expressions'; diff --git a/packages/jsts/src/rules/S2598/meta.ts b/packages/jsts/src/rules/S2598/meta.ts index baed61607e1..93d8efe2c83 100644 --- a/packages/jsts/src/rules/S2598/meta.ts +++ b/packages/jsts/src/rules/S2598/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'File uploads should be restricted', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2598/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2598'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'file-uploads'; diff --git a/packages/jsts/src/rules/S2612/meta.ts b/packages/jsts/src/rules/S2612/meta.ts index 0a066f7818e..f6bcbf4c1a6 100644 --- a/packages/jsts/src/rules/S2612/meta.ts +++ b/packages/jsts/src/rules/S2612/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Setting loose POSIX file permissions is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2612/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2612'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'file-permissions'; diff --git a/packages/jsts/src/rules/S2639/meta.ts b/packages/jsts/src/rules/S2639/meta.ts index 674ae322f5f..850ddfded3c 100644 --- a/packages/jsts/src/rules/S2639/meta.ts +++ b/packages/jsts/src/rules/S2639/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Empty character classes should not be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2639/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S2639'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-empty-character-class'; diff --git a/packages/jsts/src/rules/S2681/meta.ts b/packages/jsts/src/rules/S2681/meta.ts index e8afc9ae37d..4c22d101c52 100644 --- a/packages/jsts/src/rules/S2681/meta.ts +++ b/packages/jsts/src/rules/S2681/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Multiline blocks should be enclosed in curly braces', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2681/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2681'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-unenclosed-multiline-block'; diff --git a/packages/jsts/src/rules/S2681/rule.ts b/packages/jsts/src/rules/S2681/rule.ts index c72609bcf84..018c0b6b6ce 100644 --- a/packages/jsts/src/rules/S2681/rule.ts +++ b/packages/jsts/src/rules/S2681/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S2685/index.ts b/packages/jsts/src/rules/S2685/index.ts new file mode 100644 index 00000000000..a1a33d87bbb --- /dev/null +++ b/packages/jsts/src/rules/S2685/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-caller'); diff --git a/packages/jsts/src/rules/S2685/meta.ts b/packages/jsts/src/rules/S2685/meta.ts new file mode 100644 index 00000000000..f144795c17f --- /dev/null +++ b/packages/jsts/src/rules/S2685/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-caller'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S2688/index.ts b/packages/jsts/src/rules/S2688/index.ts index a461f194008..0151715a7f0 100644 --- a/packages/jsts/src/rules/S2688/index.ts +++ b/packages/jsts/src/rules/S2688/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['use-isnan']); +export const rule = decorate(getESLintCoreRule('use-isnan')); diff --git a/packages/jsts/src/rules/S2688/meta.ts b/packages/jsts/src/rules/S2688/meta.ts index 95c7fc8be0e..cfba9267d64 100644 --- a/packages/jsts/src/rules/S2688/meta.ts +++ b/packages/jsts/src/rules/S2688/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: '"NaN" should not be used in comparisons', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2688/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S2688'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'use-isnan'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'use-isnan' }]; diff --git a/packages/jsts/src/rules/S2692/meta.ts b/packages/jsts/src/rules/S2692/meta.ts index 011a1782cc5..65d996d4940 100644 --- a/packages/jsts/src/rules/S2692/meta.ts +++ b/packages/jsts/src/rules/S2692/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"indexOf" checks should not be for positive numbers', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2692/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S2692'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'index-of-compare-to-positive-number'; diff --git a/packages/jsts/src/rules/S2699/meta.ts b/packages/jsts/src/rules/S2699/meta.ts index 0c4c332e6c2..ad5ca32e654 100644 --- a/packages/jsts/src/rules/S2699/meta.ts +++ b/packages/jsts/src/rules/S2699/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Tests should include assertions', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2699/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2699'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'assertions-in-tests'; diff --git a/packages/jsts/src/rules/S2703/meta.ts b/packages/jsts/src/rules/S2703/meta.ts index 7a3d2911454..931154bfc54 100644 --- a/packages/jsts/src/rules/S2703/meta.ts +++ b/packages/jsts/src/rules/S2703/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Variables should be declared explicitly', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2703/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2703'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-implicit-global'; diff --git a/packages/jsts/src/rules/S2737/meta.ts b/packages/jsts/src/rules/S2737/meta.ts index 5aef866f48e..e2bafb50ed4 100644 --- a/packages/jsts/src/rules/S2737/meta.ts +++ b/packages/jsts/src/rules/S2737/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"catch" clauses should do more than rethrow', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2737/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2737'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-useless-catch'; diff --git a/packages/jsts/src/rules/S2737/rule.ts b/packages/jsts/src/rules/S2737/rule.ts index 38a2d769468..07325bf1e00 100644 --- a/packages/jsts/src/rules/S2737/rule.ts +++ b/packages/jsts/src/rules/S2737/rule.ts @@ -19,7 +19,7 @@ import { Rule, SourceCode } from 'eslint'; import { areEquivalent, generateMeta, isThrowStatement } from '../helpers/index.js'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; export const rule: Rule.RuleModule = { diff --git a/packages/jsts/src/rules/S2755/meta.ts b/packages/jsts/src/rules/S2755/meta.ts index 2409fe1fb83..2f32655dba0 100644 --- a/packages/jsts/src/rules/S2755/meta.ts +++ b/packages/jsts/src/rules/S2755/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'XML parsers should not be vulnerable to XXE attacks', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2755/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2755'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'xml-parser-xxe'; diff --git a/packages/jsts/src/rules/S2755/rule.ts b/packages/jsts/src/rules/S2755/rule.ts index c25aff3ab2a..9f1dd39fd9d 100644 --- a/packages/jsts/src/rules/S2755/rule.ts +++ b/packages/jsts/src/rules/S2755/rule.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S2755/javascript -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import type { Rule } from 'eslint'; import estree from 'estree'; import { diff --git a/packages/jsts/src/rules/S2757/meta.ts b/packages/jsts/src/rules/S2757/meta.ts index fe984fc3963..fef809d95fd 100644 --- a/packages/jsts/src/rules/S2757/meta.ts +++ b/packages/jsts/src/rules/S2757/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: "Non-existent operators '=+', '=-' and '=!' should not be used", - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2757/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S2757'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'non-existent-operator'; diff --git a/packages/jsts/src/rules/S2757/rule.ts b/packages/jsts/src/rules/S2757/rule.ts index 16839671ee7..9e036fdfb9a 100644 --- a/packages/jsts/src/rules/S2757/rule.ts +++ b/packages/jsts/src/rules/S2757/rule.ts @@ -18,7 +18,7 @@ import { AST, Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S2814/decorator.ts b/packages/jsts/src/rules/S2814/decorator.ts index 36cbba6f5e7..286c31af004 100644 --- a/packages/jsts/src/rules/S2814/decorator.ts +++ b/packages/jsts/src/rules/S2814/decorator.ts @@ -17,7 +17,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; import { generateMeta, interceptReport } from '../helpers/index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; // core implementation of this rule raises issues on type exports diff --git a/packages/jsts/src/rules/S2814/index.ts b/packages/jsts/src/rules/S2814/index.ts index 5c96d28606e..4313ec4ca6c 100644 --- a/packages/jsts/src/rules/S2814/index.ts +++ b/packages/jsts/src/rules/S2814/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(tsEslintRules['no-redeclare']); diff --git a/packages/jsts/src/rules/S2814/meta.ts b/packages/jsts/src/rules/S2814/meta.ts index 6725e11b009..ad1bacb38fa 100644 --- a/packages/jsts/src/rules/S2814/meta.ts +++ b/packages/jsts/src/rules/S2814/meta.ts @@ -14,16 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Variables and functions should not be redeclared', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2814/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2814'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-redeclare'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'no-redeclare' }, +]; diff --git a/packages/jsts/src/rules/S2817/meta.ts b/packages/jsts/src/rules/S2817/meta.ts index 1d65a74404b..ea5c52b4c01 100644 --- a/packages/jsts/src/rules/S2817/meta.ts +++ b/packages/jsts/src/rules/S2817/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Web SQL databases should not be used', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2817/javascript', - requiresTypeChecking: true, - }, - deprecated: true, -}; - -export const sonarKey = 'S2817'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'web-sql-database'; diff --git a/packages/jsts/src/rules/S2819/meta.ts b/packages/jsts/src/rules/S2819/meta.ts index 978557b8394..9251eecdead 100644 --- a/packages/jsts/src/rules/S2819/meta.ts +++ b/packages/jsts/src/rules/S2819/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Origins should be verified during cross-origin communications', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2819/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S2819'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'post-message'; diff --git a/packages/jsts/src/rules/S2819/rule.ts b/packages/jsts/src/rules/S2819/rule.ts index 02399618851..766b04cd3f9 100644 --- a/packages/jsts/src/rules/S2819/rule.ts +++ b/packages/jsts/src/rules/S2819/rule.ts @@ -18,7 +18,7 @@ import { Rule, Scope } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { childrenOf, findFirstMatchingLocalAncestor, diff --git a/packages/jsts/src/rules/S2870/meta.ts b/packages/jsts/src/rules/S2870/meta.ts index 898b593d3d7..e4b3a1d889c 100644 --- a/packages/jsts/src/rules/S2870/meta.ts +++ b/packages/jsts/src/rules/S2870/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"delete" should not be used on arrays', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2870/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S2870'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-array-delete'; diff --git a/packages/jsts/src/rules/S2871/meta.ts b/packages/jsts/src/rules/S2871/meta.ts index ffe2c6d8daa..b1f3f120877 100644 --- a/packages/jsts/src/rules/S2871/meta.ts +++ b/packages/jsts/src/rules/S2871/meta.ts @@ -14,18 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: - '"Array.prototype.sort()" and "Array.prototype.toSorted()" should use a compare function', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2871/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S2871'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-alphabetical-sort'; diff --git a/packages/jsts/src/rules/S2933/index.ts b/packages/jsts/src/rules/S2933/index.ts new file mode 100644 index 00000000000..17c6fc64704 --- /dev/null +++ b/packages/jsts/src/rules/S2933/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['prefer-readonly']; diff --git a/packages/jsts/src/rules/S2933/meta.ts b/packages/jsts/src/rules/S2933/meta.ts new file mode 100644 index 00000000000..f3d88e5ce32 --- /dev/null +++ b/packages/jsts/src/rules/S2933/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'prefer-readonly'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S2966/index.ts b/packages/jsts/src/rules/S2966/index.ts new file mode 100644 index 00000000000..b678dc4eacb --- /dev/null +++ b/packages/jsts/src/rules/S2966/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['no-non-null-assertion']; diff --git a/packages/jsts/src/rules/S2966/meta.ts b/packages/jsts/src/rules/S2966/meta.ts new file mode 100644 index 00000000000..a2052c4c1b0 --- /dev/null +++ b/packages/jsts/src/rules/S2966/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-non-null-assertion'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S2970/meta.ts b/packages/jsts/src/rules/S2970/meta.ts index 8c8a6b13841..c0999e59e7c 100644 --- a/packages/jsts/src/rules/S2970/meta.ts +++ b/packages/jsts/src/rules/S2970/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Assertions should be complete', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2970/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S2970'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-incomplete-assertions'; diff --git a/packages/jsts/src/rules/S2990/meta.ts b/packages/jsts/src/rules/S2990/meta.ts index 5e31b3d6167..22b0ee3ec56 100644 --- a/packages/jsts/src/rules/S2990/meta.ts +++ b/packages/jsts/src/rules/S2990/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'The global "this" object should not be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2990/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S2990'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-global-this'; diff --git a/packages/jsts/src/rules/S2999/meta.ts b/packages/jsts/src/rules/S2999/meta.ts index d96467b79f7..fb362721248 100644 --- a/packages/jsts/src/rules/S2999/meta.ts +++ b/packages/jsts/src/rules/S2999/meta.ts @@ -14,33 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: '"new" should only be used with functions and classes', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S2999/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S2999'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 2, - items: [ - { - type: 'object', - properties: { - considerJSDoc: { - type: 'boolean', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'new-operator-misuse'; diff --git a/packages/jsts/src/rules/S3001/meta.ts b/packages/jsts/src/rules/S3001/meta.ts index 6a2d343c222..9e209128c04 100644 --- a/packages/jsts/src/rules/S3001/meta.ts +++ b/packages/jsts/src/rules/S3001/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: '"delete" should be used only with object properties', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3001/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3001'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-delete-var'; diff --git a/packages/jsts/src/rules/S3003/meta.ts b/packages/jsts/src/rules/S3003/meta.ts index c2ef750d037..b6bf5c617ba 100644 --- a/packages/jsts/src/rules/S3003/meta.ts +++ b/packages/jsts/src/rules/S3003/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Comparison operators should not be used with strings', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3003/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S3003'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'strings-comparison'; diff --git a/packages/jsts/src/rules/S3003/rule.ts b/packages/jsts/src/rules/S3003/rule.ts index 12011fd0b07..7e6b5bb8564 100644 --- a/packages/jsts/src/rules/S3003/rule.ts +++ b/packages/jsts/src/rules/S3003/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, isRequiredParserServices, diff --git a/packages/jsts/src/rules/S3257/index.ts b/packages/jsts/src/rules/S3257/index.ts new file mode 100644 index 00000000000..dddec23ba4f --- /dev/null +++ b/packages/jsts/src/rules/S3257/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['no-inferrable-types']; diff --git a/packages/jsts/src/rules/S3257/meta.ts b/packages/jsts/src/rules/S3257/meta.ts new file mode 100644 index 00000000000..2dac29cab7f --- /dev/null +++ b/packages/jsts/src/rules/S3257/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-inferrable-types'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S3317/meta.ts b/packages/jsts/src/rules/S3317/meta.ts index a48ff42e8ad..0822c85ae1f 100644 --- a/packages/jsts/src/rules/S3317/meta.ts +++ b/packages/jsts/src/rules/S3317/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Default export names and file names should match', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3317/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3317'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'file-name-differ-from-class'; diff --git a/packages/jsts/src/rules/S3330/meta.ts b/packages/jsts/src/rules/S3330/meta.ts index 7b62e832905..b561285a562 100644 --- a/packages/jsts/src/rules/S3330/meta.ts +++ b/packages/jsts/src/rules/S3330/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Creating cookies without the "HttpOnly" flag is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3330/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3330'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'cookie-no-httponly'; diff --git a/packages/jsts/src/rules/S3353/index.ts b/packages/jsts/src/rules/S3353/index.ts new file mode 100644 index 00000000000..f43e09a0f35 --- /dev/null +++ b/packages/jsts/src/rules/S3353/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('prefer-const'); diff --git a/packages/jsts/src/rules/S3353/meta.ts b/packages/jsts/src/rules/S3353/meta.ts new file mode 100644 index 00000000000..18618cb4a4b --- /dev/null +++ b/packages/jsts/src/rules/S3353/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'prefer-const'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S3358/meta.ts b/packages/jsts/src/rules/S3358/meta.ts index cf9fad17d9e..8619d67be8a 100644 --- a/packages/jsts/src/rules/S3358/meta.ts +++ b/packages/jsts/src/rules/S3358/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Ternary operators should not be nested', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3358/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3358'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-nested-conditional'; diff --git a/packages/jsts/src/rules/S3402/meta.ts b/packages/jsts/src/rules/S3402/meta.ts index 09ce34d5d35..d32770d1ad5 100644 --- a/packages/jsts/src/rules/S3402/meta.ts +++ b/packages/jsts/src/rules/S3402/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Strings and non-strings should not be added', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3402/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S3402'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-incorrect-string-concat'; diff --git a/packages/jsts/src/rules/S3403/meta.ts b/packages/jsts/src/rules/S3403/meta.ts index 0a3a6b2e06a..d141821cdeb 100644 --- a/packages/jsts/src/rules/S3403/meta.ts +++ b/packages/jsts/src/rules/S3403/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Strict equality operators should not be used with dissimilar types', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3403/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S3403'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'different-types-comparison'; diff --git a/packages/jsts/src/rules/S3415/meta.ts b/packages/jsts/src/rules/S3415/meta.ts index 16b3c41db23..0757c0c2754 100644 --- a/packages/jsts/src/rules/S3415/meta.ts +++ b/packages/jsts/src/rules/S3415/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Assertion arguments should be passed in the correct order', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3415/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S3415'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'inverted-assertion-arguments'; diff --git a/packages/jsts/src/rules/S3498/decorator.ts b/packages/jsts/src/rules/S3498/decorator.ts index 9f1cb63791b..6f0fadac508 100644 --- a/packages/jsts/src/rules/S3498/decorator.ts +++ b/packages/jsts/src/rules/S3498/decorator.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, interceptReport } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S3498/index.ts b/packages/jsts/src/rules/S3498/index.ts index 97f5fe96dae..dacd31ae18f 100644 --- a/packages/jsts/src/rules/S3498/index.ts +++ b/packages/jsts/src/rules/S3498/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['object-shorthand']); +export const rule = decorate(getESLintCoreRule('object-shorthand')); diff --git a/packages/jsts/src/rules/S3498/meta.ts b/packages/jsts/src/rules/S3498/meta.ts index e5f0993ca3e..3e836c31ee9 100644 --- a/packages/jsts/src/rules/S3498/meta.ts +++ b/packages/jsts/src/rules/S3498/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Object literal shorthand syntax should be used', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3498/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S3498'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'object-shorthand'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'object-shorthand' }]; diff --git a/packages/jsts/src/rules/S3499/meta.ts b/packages/jsts/src/rules/S3499/meta.ts index 3e239801716..f801d19e48c 100644 --- a/packages/jsts/src/rules/S3499/meta.ts +++ b/packages/jsts/src/rules/S3499/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: - 'Shorthand object properties should be grouped at the beginning or end of an object declaration', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3499/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3499'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'shorthand-property-grouping'; diff --git a/packages/jsts/src/rules/S3500/meta.ts b/packages/jsts/src/rules/S3500/meta.ts index b663b96d556..6dfafe19e2e 100644 --- a/packages/jsts/src/rules/S3500/meta.ts +++ b/packages/jsts/src/rules/S3500/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: '"const" variables should not be reassigned', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3500/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3500'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'updated-const-var'; diff --git a/packages/jsts/src/rules/S3504/index.ts b/packages/jsts/src/rules/S3504/index.ts index 38dbfe21186..226cebf4eda 100644 --- a/packages/jsts/src/rules/S3504/index.ts +++ b/packages/jsts/src/rules/S3504/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['no-var']); +export const rule = decorate(getESLintCoreRule('no-var')); diff --git a/packages/jsts/src/rules/S3504/meta.ts b/packages/jsts/src/rules/S3504/meta.ts index 188b439116a..7735f7e260e 100644 --- a/packages/jsts/src/rules/S3504/meta.ts +++ b/packages/jsts/src/rules/S3504/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Variables should be declared with "let" or "const"', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3504/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S3504'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-var'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'no-var' }]; diff --git a/packages/jsts/src/rules/S3512/index.ts b/packages/jsts/src/rules/S3512/index.ts index 2d364319fa4..2c8abf156cf 100644 --- a/packages/jsts/src/rules/S3512/index.ts +++ b/packages/jsts/src/rules/S3512/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['prefer-template']); +export const rule = decorate(getESLintCoreRule('prefer-template')); diff --git a/packages/jsts/src/rules/S3512/meta.ts b/packages/jsts/src/rules/S3512/meta.ts index 7576b5f4ae5..b484f15fcb0 100644 --- a/packages/jsts/src/rules/S3512/meta.ts +++ b/packages/jsts/src/rules/S3512/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Template strings should be used instead of concatenation', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3512/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S3512'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'prefer-template'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'prefer-template' }]; diff --git a/packages/jsts/src/rules/S3513/meta.ts b/packages/jsts/src/rules/S3513/meta.ts index a1a2ac598ae..3baceb1cd8a 100644 --- a/packages/jsts/src/rules/S3513/meta.ts +++ b/packages/jsts/src/rules/S3513/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"arguments" should not be accessed directly', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3513/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3513'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'arguments-usage'; diff --git a/packages/jsts/src/rules/S3513/rule.ts b/packages/jsts/src/rules/S3513/rule.ts index b2a8cc15316..0e5a181280b 100644 --- a/packages/jsts/src/rules/S3513/rule.ts +++ b/packages/jsts/src/rules/S3513/rule.ts @@ -17,7 +17,7 @@ // https://sonarsource.github.io/rspec/#/rspec/S3513/javascript import { Rule, Scope } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, report, toSecondaryLocation } from '../helpers/index.js'; import estree from 'estree'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S3514/meta.ts b/packages/jsts/src/rules/S3514/meta.ts index 733e8c41a67..d8e3f673482 100644 --- a/packages/jsts/src/rules/S3514/meta.ts +++ b/packages/jsts/src/rules/S3514/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Destructuring syntax should be used for assignments', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3514/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3514'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'destructuring-assignment-syntax'; diff --git a/packages/jsts/src/rules/S3514/rule.ts b/packages/jsts/src/rules/S3514/rule.ts index 9d02f471b6e..888e21c23d2 100644 --- a/packages/jsts/src/rules/S3514/rule.ts +++ b/packages/jsts/src/rules/S3514/rule.ts @@ -17,7 +17,7 @@ // https://sonarsource.github.io/rspec/#/rspec/S3514/javascript import type { Rule } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import estree from 'estree'; import { findFirstMatchingAncestor, diff --git a/packages/jsts/src/rules/S3516/meta.ts b/packages/jsts/src/rules/S3516/meta.ts index 63f63755e59..2d7ae313c13 100644 --- a/packages/jsts/src/rules/S3516/meta.ts +++ b/packages/jsts/src/rules/S3516/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Function returns should not be invariant', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3516/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3516'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-invariant-returns'; diff --git a/packages/jsts/src/rules/S3516/rule.ts b/packages/jsts/src/rules/S3516/rule.ts index 0455e0fd618..db4427e50d8 100644 --- a/packages/jsts/src/rules/S3516/rule.ts +++ b/packages/jsts/src/rules/S3516/rule.ts @@ -18,7 +18,7 @@ import type { Rule, Scope } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { findFirstMatchingAncestor, FUNCTION_NODES, diff --git a/packages/jsts/src/rules/S3523/index.ts b/packages/jsts/src/rules/S3523/index.ts new file mode 100644 index 00000000000..4c6600615be --- /dev/null +++ b/packages/jsts/src/rules/S3523/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-new-func'); diff --git a/packages/jsts/src/rules/S3523/meta.ts b/packages/jsts/src/rules/S3523/meta.ts new file mode 100644 index 00000000000..1b43701382b --- /dev/null +++ b/packages/jsts/src/rules/S3523/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-new-func'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S3524/meta.ts b/packages/jsts/src/rules/S3524/meta.ts index aff6b2e43aa..d31eb9a80f0 100644 --- a/packages/jsts/src/rules/S3524/meta.ts +++ b/packages/jsts/src/rules/S3524/meta.ts @@ -14,36 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Braces and parentheses should be used consistently with arrow functions', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3524/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3524'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - requireParameterParentheses: { - type: 'boolean', - }, - requireBodyBraces: { - type: 'boolean', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'arrow-function-convention'; diff --git a/packages/jsts/src/rules/S3524/rule.ts b/packages/jsts/src/rules/S3524/rule.ts index e3d4f94748b..a9a349824c8 100644 --- a/packages/jsts/src/rules/S3524/rule.ts +++ b/packages/jsts/src/rules/S3524/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta } from '../helpers/index.js'; import { FromSchema } from 'json-schema-to-ts'; import { meta, schema } from './meta.js'; diff --git a/packages/jsts/src/rules/S3525/meta.ts b/packages/jsts/src/rules/S3525/meta.ts index 14ac6c6e094..0948c5b6087 100644 --- a/packages/jsts/src/rules/S3525/meta.ts +++ b/packages/jsts/src/rules/S3525/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Class methods should be used instead of "prototype" assignments', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3525/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S3525'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'class-prototype'; diff --git a/packages/jsts/src/rules/S3531/meta.ts b/packages/jsts/src/rules/S3531/meta.ts index 76d68fb2993..924351f7936 100644 --- a/packages/jsts/src/rules/S3531/meta.ts +++ b/packages/jsts/src/rules/S3531/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Generators should explicitly "yield" a value', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3531/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3531'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'generator-without-yield'; diff --git a/packages/jsts/src/rules/S3531/rule.ts b/packages/jsts/src/rules/S3531/rule.ts index bd6726d2dfd..4a125dfb651 100644 --- a/packages/jsts/src/rules/S3531/rule.ts +++ b/packages/jsts/src/rules/S3531/rule.ts @@ -24,7 +24,7 @@ import { getParent, RuleContext, } from '../helpers/index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; export const rule: Rule.RuleModule = { diff --git a/packages/jsts/src/rules/S3533/meta.ts b/packages/jsts/src/rules/S3533/meta.ts index 020f20ca4d1..0626cf7c91e 100644 --- a/packages/jsts/src/rules/S3533/meta.ts +++ b/packages/jsts/src/rules/S3533/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"import" should be used to include external code', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3533/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S3533'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-require-or-define'; diff --git a/packages/jsts/src/rules/S3579/meta.ts b/packages/jsts/src/rules/S3579/meta.ts index b21ea5b74c7..f7d576c2809 100644 --- a/packages/jsts/src/rules/S3579/meta.ts +++ b/packages/jsts/src/rules/S3579/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Array indexes should be numeric', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3579/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S3579'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-associative-arrays'; diff --git a/packages/jsts/src/rules/S3616/meta.ts b/packages/jsts/src/rules/S3616/meta.ts index 51e6163d20a..88f6f30c128 100644 --- a/packages/jsts/src/rules/S3616/meta.ts +++ b/packages/jsts/src/rules/S3616/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Comma and logical OR operators should not be used in switch cases', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3616/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3616'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'comma-or-logical-or-case'; diff --git a/packages/jsts/src/rules/S3626/meta.ts b/packages/jsts/src/rules/S3626/meta.ts index ea591199970..1c3e8ec2099 100644 --- a/packages/jsts/src/rules/S3626/meta.ts +++ b/packages/jsts/src/rules/S3626/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Jump statements should not be redundant', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3626/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S3626'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-redundant-jump'; diff --git a/packages/jsts/src/rules/S3686/meta.ts b/packages/jsts/src/rules/S3686/meta.ts index 203c402b7ae..a56390ae819 100644 --- a/packages/jsts/src/rules/S3686/meta.ts +++ b/packages/jsts/src/rules/S3686/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Functions should be called consistently with or without "new"', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3686/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3686'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'inconsistent-function-call'; diff --git a/packages/jsts/src/rules/S3696/index.ts b/packages/jsts/src/rules/S3696/index.ts index c2be068fd17..28fea1ada91 100644 --- a/packages/jsts/src/rules/S3696/index.ts +++ b/packages/jsts/src/rules/S3696/index.ts @@ -14,11 +14,11 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; /** * TypeScript ESLint implementation of 'no-throw-literal' does not support JavaScript code. * Therefore, we decorate ESLint's implemention of the rule. */ -export const rule = decorate(eslintRules['no-throw-literal']); +export const rule = decorate(getESLintCoreRule('no-throw-literal')); diff --git a/packages/jsts/src/rules/S3696/meta.ts b/packages/jsts/src/rules/S3696/meta.ts index 23bcf00281e..10d1f9faacc 100644 --- a/packages/jsts/src/rules/S3696/meta.ts +++ b/packages/jsts/src/rules/S3696/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Literals should not be thrown', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3696/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S3696'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-throw-literal'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'no-throw-literal' }]; diff --git a/packages/jsts/src/rules/S3699/meta.ts b/packages/jsts/src/rules/S3699/meta.ts index 6d30a3bad82..d9c360e1764 100644 --- a/packages/jsts/src/rules/S3699/meta.ts +++ b/packages/jsts/src/rules/S3699/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'The return value of void functions should not be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3699/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3699'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-use-of-empty-return-value'; diff --git a/packages/jsts/src/rules/S3699/rule.ts b/packages/jsts/src/rules/S3699/rule.ts index 0ef1fcc40ee..e2cb0c8797a 100644 --- a/packages/jsts/src/rules/S3699/rule.ts +++ b/packages/jsts/src/rules/S3699/rule.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S3699 -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, isArrowFunctionExpression, @@ -129,7 +129,7 @@ export const rule: Rule.RuleModule = { if ( func.async || func.generator || - (func.body.type === AST_NODE_TYPES.BlockStatement && func.body.body.length === 0) + (func.body.type === 'BlockStatement' && func.body.body.length === 0) ) { functionsWithReturnValue.add(func); } diff --git a/packages/jsts/src/rules/S3723/meta.ts b/packages/jsts/src/rules/S3723/meta.ts index f668aeb0172..e22e982081f 100644 --- a/packages/jsts/src/rules/S3723/meta.ts +++ b/packages/jsts/src/rules/S3723/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Trailing commas should be used', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3723/javascript', - requiresTypeChecking: false, - }, - deprecated: true, -}; - -export const sonarKey = 'S3723'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'enforce-trailing-comma'; diff --git a/packages/jsts/src/rules/S3723/rule.ts b/packages/jsts/src/rules/S3723/rule.ts index 3919b083677..031bb5428ed 100644 --- a/packages/jsts/src/rules/S3723/rule.ts +++ b/packages/jsts/src/rules/S3723/rule.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S3723/javascript -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { generateMeta } from '../helpers/index.js'; import { meta } from './meta.js'; import type { Rule } from 'eslint'; @@ -26,6 +26,6 @@ import type { Rule } from 'eslint'; * same ESLint implementation, but the plugin doesn't allow rule key duplicates. */ export const rule = { - ...eslintRules['comma-dangle'], - meta: generateMeta(meta as Rule.RuleMetaData, eslintRules['comma-dangle'].meta), + ...getESLintCoreRule('comma-dangle'), + meta: generateMeta(meta as Rule.RuleMetaData, getESLintCoreRule('comma-dangle').meta), }; diff --git a/packages/jsts/src/rules/S3735/meta.ts b/packages/jsts/src/rules/S3735/meta.ts index 99ded4569d4..358aedebdac 100644 --- a/packages/jsts/src/rules/S3735/meta.ts +++ b/packages/jsts/src/rules/S3735/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"void" should not be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3735/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S3735'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'void-use'; diff --git a/packages/jsts/src/rules/S3757/meta.ts b/packages/jsts/src/rules/S3757/meta.ts index 20f8ee39191..413ec9e5882 100644 --- a/packages/jsts/src/rules/S3757/meta.ts +++ b/packages/jsts/src/rules/S3757/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Arithmetic operations should not result in "NaN"', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3757/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S3757'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'operation-returning-nan'; diff --git a/packages/jsts/src/rules/S3758/meta.ts b/packages/jsts/src/rules/S3758/meta.ts index 481ab7d650f..0ba4584432b 100644 --- a/packages/jsts/src/rules/S3758/meta.ts +++ b/packages/jsts/src/rules/S3758/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Values not convertible to numbers should not be used in numeric comparisons', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3758/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S3758'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'values-not-convertible-to-numbers'; diff --git a/packages/jsts/src/rules/S3760/meta.ts b/packages/jsts/src/rules/S3760/meta.ts index 36abeffffa5..578f97ca168 100644 --- a/packages/jsts/src/rules/S3760/meta.ts +++ b/packages/jsts/src/rules/S3760/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Arithmetic operators should only have numbers as operands', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3760/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S3760'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'non-number-in-arithmetic-expression'; diff --git a/packages/jsts/src/rules/S3776/meta.ts b/packages/jsts/src/rules/S3776/meta.ts index f3f66e9f520..9a90b8b6e86 100644 --- a/packages/jsts/src/rules/S3776/meta.ts +++ b/packages/jsts/src/rules/S3776/meta.ts @@ -14,28 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Cognitive Complexity of functions should not be too high', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3776/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3776'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 2, - items: [ - { - type: 'integer', - minimum: 0, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'cognitive-complexity'; diff --git a/packages/jsts/src/rules/S3782/meta.ts b/packages/jsts/src/rules/S3782/meta.ts index edcd32824e7..dcacaf0f84b 100644 --- a/packages/jsts/src/rules/S3782/meta.ts +++ b/packages/jsts/src/rules/S3782/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Arguments to built-in functions should match documented types', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3782/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S3782'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'argument-type'; diff --git a/packages/jsts/src/rules/S3782/rule.ts b/packages/jsts/src/rules/S3782/rule.ts index cb3b23327d8..95dc63ab71d 100644 --- a/packages/jsts/src/rules/S3782/rule.ts +++ b/packages/jsts/src/rules/S3782/rule.ts @@ -19,7 +19,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; import { generateMeta, getTypeFromTreeNode, isRequiredParserServices } from '../helpers/index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import ts from 'typescript'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S3785/meta.ts b/packages/jsts/src/rules/S3785/meta.ts index 500bc9815b8..b2b09fea292 100644 --- a/packages/jsts/src/rules/S3785/meta.ts +++ b/packages/jsts/src/rules/S3785/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: '"in" should not be used with primitive types', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3785/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S3785'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'in-operator-type-error'; diff --git a/packages/jsts/src/rules/S3786/index.ts b/packages/jsts/src/rules/S3786/index.ts new file mode 100644 index 00000000000..fcdcdd9355c --- /dev/null +++ b/packages/jsts/src/rules/S3786/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-template-curly-in-string'); diff --git a/packages/jsts/src/rules/S3786/meta.ts b/packages/jsts/src/rules/S3786/meta.ts new file mode 100644 index 00000000000..cce2af68971 --- /dev/null +++ b/packages/jsts/src/rules/S3786/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-template-curly-in-string'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S3796/meta.ts b/packages/jsts/src/rules/S3796/meta.ts index 0ae8d4360b3..ff8f906bf93 100644 --- a/packages/jsts/src/rules/S3796/meta.ts +++ b/packages/jsts/src/rules/S3796/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Callbacks of array methods should have return statements', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3796/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S3796'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'array-callback-without-return'; diff --git a/packages/jsts/src/rules/S3796/rule.ts b/packages/jsts/src/rules/S3796/rule.ts index 422913a9827..e8a14b7f32b 100644 --- a/packages/jsts/src/rules/S3796/rule.ts +++ b/packages/jsts/src/rules/S3796/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, getMainFunctionTokenLocation, diff --git a/packages/jsts/src/rules/S3798/meta.ts b/packages/jsts/src/rules/S3798/meta.ts index 4296041a82e..ee4a8dd1ecd 100644 --- a/packages/jsts/src/rules/S3798/meta.ts +++ b/packages/jsts/src/rules/S3798/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Variables and functions should not be declared in the global scope', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3798/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3798'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'declarations-in-global-scope'; diff --git a/packages/jsts/src/rules/S3799/index.ts b/packages/jsts/src/rules/S3799/index.ts new file mode 100644 index 00000000000..daaf41f493f --- /dev/null +++ b/packages/jsts/src/rules/S3799/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-empty-pattern'); diff --git a/packages/jsts/src/rules/S3799/meta.ts b/packages/jsts/src/rules/S3799/meta.ts new file mode 100644 index 00000000000..b0b9af5a384 --- /dev/null +++ b/packages/jsts/src/rules/S3799/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-empty-pattern'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S3800/meta.ts b/packages/jsts/src/rules/S3800/meta.ts index bd2bf380b73..10bb3c9f510 100644 --- a/packages/jsts/src/rules/S3800/meta.ts +++ b/packages/jsts/src/rules/S3800/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Functions should always return the same type', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3800/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S3800'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'function-return-type'; diff --git a/packages/jsts/src/rules/S3800/rule.ts b/packages/jsts/src/rules/S3800/rule.ts index 7f4df4b58aa..a535db5738e 100644 --- a/packages/jsts/src/rules/S3800/rule.ts +++ b/packages/jsts/src/rules/S3800/rule.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S3800/javascript -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import type { Rule } from 'eslint'; import estree from 'estree'; import ts from 'typescript'; diff --git a/packages/jsts/src/rules/S3801/meta.ts b/packages/jsts/src/rules/S3801/meta.ts index 4302a94a287..b2f1eddec34 100644 --- a/packages/jsts/src/rules/S3801/meta.ts +++ b/packages/jsts/src/rules/S3801/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Functions should use "return" consistently', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3801/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3801'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-inconsistent-returns'; diff --git a/packages/jsts/src/rules/S3801/rule.ts b/packages/jsts/src/rules/S3801/rule.ts index d9a04d9e925..d31e072c312 100644 --- a/packages/jsts/src/rules/S3801/rule.ts +++ b/packages/jsts/src/rules/S3801/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, getMainFunctionTokenLocation, diff --git a/packages/jsts/src/rules/S3812/index.ts b/packages/jsts/src/rules/S3812/index.ts new file mode 100644 index 00000000000..0faf9118ece --- /dev/null +++ b/packages/jsts/src/rules/S3812/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-unsafe-negation'); diff --git a/packages/jsts/src/rules/S3812/meta.ts b/packages/jsts/src/rules/S3812/meta.ts new file mode 100644 index 00000000000..af2cb2f5b0d --- /dev/null +++ b/packages/jsts/src/rules/S3812/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-unsafe-negation'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S3827/meta.ts b/packages/jsts/src/rules/S3827/meta.ts index d2692abff61..e818d069013 100644 --- a/packages/jsts/src/rules/S3827/meta.ts +++ b/packages/jsts/src/rules/S3827/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Variables should be defined before being used', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3827/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3827'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-reference-error'; diff --git a/packages/jsts/src/rules/S3827/rule.ts b/packages/jsts/src/rules/S3827/rule.ts index b9b7f4739b0..d8047b4c701 100644 --- a/packages/jsts/src/rules/S3827/rule.ts +++ b/packages/jsts/src/rules/S3827/rule.ts @@ -15,7 +15,7 @@ * along with this program; if not, see https://sonarsource.com/license/ssal/ */ // https://sonarsource.github.io/rspec/#/rspec/S3827/javascript -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import type { Rule } from 'eslint'; import estree from 'estree'; import { diff --git a/packages/jsts/src/rules/S3834/index.ts b/packages/jsts/src/rules/S3834/index.ts new file mode 100644 index 00000000000..d944f82f5ff --- /dev/null +++ b/packages/jsts/src/rules/S3834/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-new-native-nonconstructor'); diff --git a/packages/jsts/src/rules/S3834/meta.ts b/packages/jsts/src/rules/S3834/meta.ts new file mode 100644 index 00000000000..dbec04dfa90 --- /dev/null +++ b/packages/jsts/src/rules/S3834/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-new-native-nonconstructor'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S3854/meta.ts b/packages/jsts/src/rules/S3854/meta.ts index 5418e92a463..effc971aeb4 100644 --- a/packages/jsts/src/rules/S3854/meta.ts +++ b/packages/jsts/src/rules/S3854/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: '"super()" should be invoked appropriately', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3854/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3854'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'super-invocation'; diff --git a/packages/jsts/src/rules/S3854/rule.ts b/packages/jsts/src/rules/S3854/rule.ts index 47fdf1e3041..3dc9e488f58 100644 --- a/packages/jsts/src/rules/S3854/rule.ts +++ b/packages/jsts/src/rules/S3854/rule.ts @@ -17,12 +17,12 @@ // https://sonarsource.github.io/rspec/#/rspec/S3854/javascript import type { Rule } from 'eslint'; -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { generateMeta, mergeRules } from '../helpers/index.js'; import { meta } from './meta.js'; -const constructorSuperRule = eslintRules['constructor-super']; -const noThisBeforeSuperRule = eslintRules['no-this-before-super']; +const constructorSuperRule = getESLintCoreRule('constructor-super'); +const noThisBeforeSuperRule = getESLintCoreRule('no-this-before-super'); export const rule: Rule.RuleModule = { meta: generateMeta(meta as Rule.RuleMetaData, { diff --git a/packages/jsts/src/rules/S3863/index.ts b/packages/jsts/src/rules/S3863/index.ts new file mode 100644 index 00000000000..a865e91600a --- /dev/null +++ b/packages/jsts/src/rules/S3863/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from 'eslint-plugin-import'; +export const rule = rules['no-duplicates']; diff --git a/packages/jsts/src/rules/S3863/meta.ts b/packages/jsts/src/rules/S3863/meta.ts new file mode 100644 index 00000000000..2f3e15ca9a5 --- /dev/null +++ b/packages/jsts/src/rules/S3863/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-duplicates'; +export const externalPlugin = 'import'; diff --git a/packages/jsts/src/rules/S3923/meta.ts b/packages/jsts/src/rules/S3923/meta.ts index ed56d0fa6df..b3e563eed63 100644 --- a/packages/jsts/src/rules/S3923/meta.ts +++ b/packages/jsts/src/rules/S3923/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: - 'All branches in a conditional structure should not have exactly the same implementation', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3923/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S3923'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-all-duplicated-branches'; diff --git a/packages/jsts/src/rules/S3972/meta.ts b/packages/jsts/src/rules/S3972/meta.ts index e6885f352b4..14c975fe149 100644 --- a/packages/jsts/src/rules/S3972/meta.ts +++ b/packages/jsts/src/rules/S3972/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Conditionals should start on new lines', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3972/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S3972'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-same-line-conditional'; diff --git a/packages/jsts/src/rules/S3973/meta.ts b/packages/jsts/src/rules/S3973/meta.ts index 92cc577c8ec..b94820adaa4 100644 --- a/packages/jsts/src/rules/S3973/meta.ts +++ b/packages/jsts/src/rules/S3973/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'A conditionally executed single line should be denoted by indentation', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3973/javascript', - requiresTypeChecking: false, - }, - deprecated: true, -}; - -export const sonarKey = 'S3973'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'conditional-indentation'; diff --git a/packages/jsts/src/rules/S3981/meta.ts b/packages/jsts/src/rules/S3981/meta.ts index c9b2ab9c670..0f9a9b3db0b 100644 --- a/packages/jsts/src/rules/S3981/meta.ts +++ b/packages/jsts/src/rules/S3981/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Collection size and array length comparisons should make sense', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3981/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S3981'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-collection-size-mischeck'; diff --git a/packages/jsts/src/rules/S3984/meta.ts b/packages/jsts/src/rules/S3984/meta.ts index c6eb18b84d7..65847087adc 100644 --- a/packages/jsts/src/rules/S3984/meta.ts +++ b/packages/jsts/src/rules/S3984/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Errors should not be created without being thrown', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S3984/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S3984'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-unthrown-error'; diff --git a/packages/jsts/src/rules/S4023/decorator.ts b/packages/jsts/src/rules/S4023/decorator.ts index 1319bb2bc7d..01d98d50b1b 100644 --- a/packages/jsts/src/rules/S4023/decorator.ts +++ b/packages/jsts/src/rules/S4023/decorator.ts @@ -17,7 +17,7 @@ // https://sonarsource.github.io/rspec/#/rspec/S4023/javascript import type { Rule } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, interceptReport, UTILITY_TYPES } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S4023/index.ts b/packages/jsts/src/rules/S4023/index.ts index 4898c00be13..8b4f884759f 100644 --- a/packages/jsts/src/rules/S4023/index.ts +++ b/packages/jsts/src/rules/S4023/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(tsEslintRules['no-empty-interface']); diff --git a/packages/jsts/src/rules/S4023/meta.ts b/packages/jsts/src/rules/S4023/meta.ts index 84c64e6f71a..2ac3c385312 100644 --- a/packages/jsts/src/rules/S4023/meta.ts +++ b/packages/jsts/src/rules/S4023/meta.ts @@ -14,17 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Interfaces should not be empty', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4023/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S4023'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-empty-interface'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'no-empty-interface' }, +]; diff --git a/packages/jsts/src/rules/S4030/meta.ts b/packages/jsts/src/rules/S4030/meta.ts index cfd3fdbaab7..79e3c573e54 100644 --- a/packages/jsts/src/rules/S4030/meta.ts +++ b/packages/jsts/src/rules/S4030/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Collection contents should be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4030/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4030'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-unused-collection'; diff --git a/packages/jsts/src/rules/S4036/meta.ts b/packages/jsts/src/rules/S4036/meta.ts index 1b46b834c96..e7249d9e06b 100644 --- a/packages/jsts/src/rules/S4036/meta.ts +++ b/packages/jsts/src/rules/S4036/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Searching OS commands in PATH is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4036/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4036'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-os-command-from-path'; diff --git a/packages/jsts/src/rules/S4043/meta.ts b/packages/jsts/src/rules/S4043/meta.ts index 435fedcc7c2..ddd74b8f3db 100644 --- a/packages/jsts/src/rules/S4043/meta.ts +++ b/packages/jsts/src/rules/S4043/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Array-mutating methods should not be used misleadingly', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4043/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S4043'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-misleading-array-reverse'; diff --git a/packages/jsts/src/rules/S4043/rule.ts b/packages/jsts/src/rules/S4043/rule.ts index 95c33ff38b1..fde1f390ba9 100644 --- a/packages/jsts/src/rules/S4043/rule.ts +++ b/packages/jsts/src/rules/S4043/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import ts from 'typescript'; import { generateMeta, diff --git a/packages/jsts/src/rules/S4084/decorator.ts b/packages/jsts/src/rules/S4084/decorator.ts index 4c2f2d347fc..a514e39468e 100644 --- a/packages/jsts/src/rules/S4084/decorator.ts +++ b/packages/jsts/src/rules/S4084/decorator.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import { Node } from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, interceptReport } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S4084/index.ts b/packages/jsts/src/rules/S4084/index.ts index ad93959b672..e783cbe8ee4 100644 --- a/packages/jsts/src/rules/S4084/index.ts +++ b/packages/jsts/src/rules/S4084/index.ts @@ -14,8 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import pkg from 'eslint-plugin-jsx-a11y'; -const { rules: jsxA11yRules } = pkg; +import { rules } from '../external/a11y.js'; import { decorate } from './decorator.js'; -export const rule = decorate(jsxA11yRules['media-has-caption']); +export const rule = decorate(rules['media-has-caption']); diff --git a/packages/jsts/src/rules/S4084/meta.ts b/packages/jsts/src/rules/S4084/meta.ts index a65bddf2929..8d603e207d3 100644 --- a/packages/jsts/src/rules/S4084/meta.ts +++ b/packages/jsts/src/rules/S4084/meta.ts @@ -14,16 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Media elements should have captions', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4084/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4084'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'media-has-caption'; +export const externalRules = [{ externalPlugin: 'jsx-a11y', externalRule: 'media-has-caption' }]; diff --git a/packages/jsts/src/rules/S4123/meta.ts b/packages/jsts/src/rules/S4123/meta.ts index 4c918b92a14..6d940a1ad87 100644 --- a/packages/jsts/src/rules/S4123/meta.ts +++ b/packages/jsts/src/rules/S4123/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"await" should only be used with promises', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4123/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S4123'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-invalid-await'; diff --git a/packages/jsts/src/rules/S4123/rule.ts b/packages/jsts/src/rules/S4123/rule.ts index e6f041f6d94..484e7f5db3b 100644 --- a/packages/jsts/src/rules/S4123/rule.ts +++ b/packages/jsts/src/rules/S4123/rule.ts @@ -25,7 +25,7 @@ import { getTypeFromTreeNode, isRequiredParserServices, } from '../helpers/index.js'; -import { ParserServicesWithTypeInformation } from '@typescript-eslint/utils'; +import type { ParserServicesWithTypeInformation } from '@typescript-eslint/utils'; import { meta } from './meta.js'; export const rule: Rule.RuleModule = { diff --git a/packages/jsts/src/rules/S4124/index.ts b/packages/jsts/src/rules/S4124/index.ts new file mode 100644 index 00000000000..aa1a20465bf --- /dev/null +++ b/packages/jsts/src/rules/S4124/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['no-misused-new']; diff --git a/packages/jsts/src/rules/S4124/meta.ts b/packages/jsts/src/rules/S4124/meta.ts new file mode 100644 index 00000000000..f0c7ead97b5 --- /dev/null +++ b/packages/jsts/src/rules/S4124/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-misused-new'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S4125/index.ts b/packages/jsts/src/rules/S4125/index.ts new file mode 100644 index 00000000000..eb5a06e9db9 --- /dev/null +++ b/packages/jsts/src/rules/S4125/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('valid-typeof'); diff --git a/packages/jsts/src/rules/S4125/meta.ts b/packages/jsts/src/rules/S4125/meta.ts new file mode 100644 index 00000000000..373ac1af759 --- /dev/null +++ b/packages/jsts/src/rules/S4125/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'valid-typeof'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S4136/index.ts b/packages/jsts/src/rules/S4136/index.ts new file mode 100644 index 00000000000..53e85b33ea8 --- /dev/null +++ b/packages/jsts/src/rules/S4136/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['adjacent-overload-signatures']; diff --git a/packages/jsts/src/rules/S4136/meta.ts b/packages/jsts/src/rules/S4136/meta.ts new file mode 100644 index 00000000000..1574581bc3f --- /dev/null +++ b/packages/jsts/src/rules/S4136/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'adjacent-overload-signatures'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S4137/index.ts b/packages/jsts/src/rules/S4137/index.ts new file mode 100644 index 00000000000..23463976368 --- /dev/null +++ b/packages/jsts/src/rules/S4137/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['consistent-type-assertions']; diff --git a/packages/jsts/src/rules/S4137/meta.ts b/packages/jsts/src/rules/S4137/meta.ts new file mode 100644 index 00000000000..642e7de4dd8 --- /dev/null +++ b/packages/jsts/src/rules/S4137/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'consistent-type-assertions'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S4138/decorator.ts b/packages/jsts/src/rules/S4138/decorator.ts index 689e9caaca1..717f30f7a67 100644 --- a/packages/jsts/src/rules/S4138/decorator.ts +++ b/packages/jsts/src/rules/S4138/decorator.ts @@ -19,7 +19,7 @@ import { AST, Rule, Scope } from 'eslint'; import { generateMeta, interceptReport } from '../helpers/index.js'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; const element = 'element'; diff --git a/packages/jsts/src/rules/S4138/index.ts b/packages/jsts/src/rules/S4138/index.ts index 6e9e1464243..f59068ec0c4 100644 --- a/packages/jsts/src/rules/S4138/index.ts +++ b/packages/jsts/src/rules/S4138/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(tsEslintRules['prefer-for-of']); diff --git a/packages/jsts/src/rules/S4138/meta.ts b/packages/jsts/src/rules/S4138/meta.ts index eac99c19267..5063ce6a2e2 100644 --- a/packages/jsts/src/rules/S4138/meta.ts +++ b/packages/jsts/src/rules/S4138/meta.ts @@ -14,17 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"for of" should be used with Iterables', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4138/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S4138'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'prefer-for-of'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'prefer-for-of' }, +]; diff --git a/packages/jsts/src/rules/S4139/meta.ts b/packages/jsts/src/rules/S4139/meta.ts index 66335ade123..5a0d77547d4 100644 --- a/packages/jsts/src/rules/S4139/meta.ts +++ b/packages/jsts/src/rules/S4139/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"for in" should not be used with iterables', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4139/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S4139'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-for-in-iterable'; diff --git a/packages/jsts/src/rules/S4140/index.ts b/packages/jsts/src/rules/S4140/index.ts new file mode 100644 index 00000000000..1aa3a5fdf47 --- /dev/null +++ b/packages/jsts/src/rules/S4140/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-sparse-arrays'); diff --git a/packages/jsts/src/rules/S4140/meta.ts b/packages/jsts/src/rules/S4140/meta.ts new file mode 100644 index 00000000000..c22aa24cefd --- /dev/null +++ b/packages/jsts/src/rules/S4140/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-sparse-arrays'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S4143/meta.ts b/packages/jsts/src/rules/S4143/meta.ts index ac46d5b3456..14d883f430c 100644 --- a/packages/jsts/src/rules/S4143/meta.ts +++ b/packages/jsts/src/rules/S4143/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Collection elements should not be replaced unconditionally', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4143/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4143'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-element-overwrite'; diff --git a/packages/jsts/src/rules/S4143/rule.ts b/packages/jsts/src/rules/S4143/rule.ts index 14cbb9d959e..9f3c2dc6e9d 100644 --- a/packages/jsts/src/rules/S4143/rule.ts +++ b/packages/jsts/src/rules/S4143/rule.ts @@ -16,7 +16,6 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S4143 -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { areEquivalent, generateMeta, @@ -98,7 +97,7 @@ export const rule: Rule.RuleModule = { } function getKeyWriteUsage(node: estree.Node): KeyWriteCollectionUsage | undefined { - if (node.type === AST_NODE_TYPES.ExpressionStatement) { + if (node.type === 'ExpressionStatement') { return arrayKeyWriteUsage(node.expression) || mapOrSetKeyWriteUsage(node.expression); } return undefined; @@ -106,11 +105,7 @@ export const rule: Rule.RuleModule = { function arrayKeyWriteUsage(node: estree.Node): KeyWriteCollectionUsage | undefined { // a[b] = ... - if ( - isSimpleAssignment(node) && - node.left.type === AST_NODE_TYPES.MemberExpression && - node.left.computed - ) { + if (isSimpleAssignment(node) && node.left.type === 'MemberExpression' && node.left.computed) { const { left, right } = node; const index = extractIndex(left.property); if (index !== undefined && !isUsed(left.object, right)) { @@ -125,10 +120,7 @@ export const rule: Rule.RuleModule = { } function mapOrSetKeyWriteUsage(node: estree.Node): KeyWriteCollectionUsage | undefined { - if ( - node.type === AST_NODE_TYPES.CallExpression && - node.callee.type === AST_NODE_TYPES.MemberExpression - ) { + if (node.type === 'CallExpression' && node.callee.type === 'MemberExpression') { const propertyAccess = node.callee; if (isIdentifier(propertyAccess.property)) { const methodName = propertyAccess.property.name; @@ -191,7 +183,7 @@ function eq(token1: AST.Token, token2: AST.Token) { } function isSimpleAssignment(node: estree.Node): node is estree.AssignmentExpression { - return node.type === AST_NODE_TYPES.AssignmentExpression && node.operator === '='; + return node.type === 'AssignmentExpression' && node.operator === '='; } interface KeyWriteCollectionUsage { diff --git a/packages/jsts/src/rules/S4144/meta.ts b/packages/jsts/src/rules/S4144/meta.ts index 51a68e0c712..2983e3f8a75 100644 --- a/packages/jsts/src/rules/S4144/meta.ts +++ b/packages/jsts/src/rules/S4144/meta.ts @@ -14,28 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Functions should not have identical implementations', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4144/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4144'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 2, - items: [ - { - type: 'integer', - minimum: 3, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-identical-functions'; diff --git a/packages/jsts/src/rules/S4156/index.ts b/packages/jsts/src/rules/S4156/index.ts index cdc256be150..57fe1774a1c 100644 --- a/packages/jsts/src/rules/S4156/index.ts +++ b/packages/jsts/src/rules/S4156/index.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S4156/javascript -import { tsEslintRules as rules } from '../typescript-eslint/index.js'; +import { rules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(rules['prefer-namespace-keyword']); diff --git a/packages/jsts/src/rules/S4156/meta.ts b/packages/jsts/src/rules/S4156/meta.ts index 3986413bb4e..c5a92cf10f8 100644 --- a/packages/jsts/src/rules/S4156/meta.ts +++ b/packages/jsts/src/rules/S4156/meta.ts @@ -14,17 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"module" should not be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4156/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S4156'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'prefer-namespace-keyword'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'prefer-namespace-keyword' }, +]; diff --git a/packages/jsts/src/rules/S4157/index.ts b/packages/jsts/src/rules/S4157/index.ts new file mode 100644 index 00000000000..4214e39b731 --- /dev/null +++ b/packages/jsts/src/rules/S4157/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['no-unnecessary-type-arguments']; diff --git a/packages/jsts/src/rules/S4157/meta.ts b/packages/jsts/src/rules/S4157/meta.ts new file mode 100644 index 00000000000..6a063473ab4 --- /dev/null +++ b/packages/jsts/src/rules/S4157/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-unnecessary-type-arguments'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S4158/meta.ts b/packages/jsts/src/rules/S4158/meta.ts index 9c5b8d04485..35940764d45 100644 --- a/packages/jsts/src/rules/S4158/meta.ts +++ b/packages/jsts/src/rules/S4158/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Empty collections should not be accessed or iterated', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4158/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4158'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-empty-collection'; diff --git a/packages/jsts/src/rules/S4165/meta.ts b/packages/jsts/src/rules/S4165/meta.ts index 5b7d5cdc49d..981016dd475 100644 --- a/packages/jsts/src/rules/S4165/meta.ts +++ b/packages/jsts/src/rules/S4165/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Assignments should not be redundant', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4165/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4165'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-redundant-assignments'; diff --git a/packages/jsts/src/rules/S4165/rule.ts b/packages/jsts/src/rules/S4165/rule.ts index 47c37af79d7..06102b2ce52 100644 --- a/packages/jsts/src/rules/S4165/rule.ts +++ b/packages/jsts/src/rules/S4165/rule.ts @@ -18,7 +18,7 @@ import type { Rule, Scope } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, getVariableFromIdentifier, diff --git a/packages/jsts/src/rules/S4204/index.ts b/packages/jsts/src/rules/S4204/index.ts new file mode 100644 index 00000000000..f696b6aed28 --- /dev/null +++ b/packages/jsts/src/rules/S4204/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['no-explicit-any']; diff --git a/packages/jsts/src/rules/S4204/meta.ts b/packages/jsts/src/rules/S4204/meta.ts new file mode 100644 index 00000000000..4f54fd06116 --- /dev/null +++ b/packages/jsts/src/rules/S4204/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-explicit-any'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S4275/meta.ts b/packages/jsts/src/rules/S4275/meta.ts index d1c2329d678..47ae3484e75 100644 --- a/packages/jsts/src/rules/S4275/meta.ts +++ b/packages/jsts/src/rules/S4275/meta.ts @@ -14,16 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Getters and setters should access the expected fields', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4275/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4275'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-accessor-field-mismatch'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'getter-return' }]; diff --git a/packages/jsts/src/rules/S4275/rule.ts b/packages/jsts/src/rules/S4275/rule.ts index d826b64b1b1..f19a5781543 100644 --- a/packages/jsts/src/rules/S4275/rule.ts +++ b/packages/jsts/src/rules/S4275/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, getVariableFromName, @@ -29,10 +29,10 @@ import { report, toSecondaryLocation, } from '../helpers/index.js'; -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { meta } from './meta.js'; -const getterReturnRule = eslintRules['getter-return']; +const getterReturnRule = getESLintCoreRule('getter-return'); type AccessorNode = TSESTree.Property | TSESTree.MethodDefinition; function isAccessorNode(node: TSESTree.Node | null | undefined): node is AccessorNode { diff --git a/packages/jsts/src/rules/S4322/meta.ts b/packages/jsts/src/rules/S4322/meta.ts index 4beeb9578fd..040669cd619 100644 --- a/packages/jsts/src/rules/S4322/meta.ts +++ b/packages/jsts/src/rules/S4322/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Type predicates should be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4322/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S4322'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'prefer-type-guard'; diff --git a/packages/jsts/src/rules/S4322/rule.ts b/packages/jsts/src/rules/S4322/rule.ts index 6d90dbaae5b..3be1f6589f2 100644 --- a/packages/jsts/src/rules/S4322/rule.ts +++ b/packages/jsts/src/rules/S4322/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, getMainFunctionTokenLocation, diff --git a/packages/jsts/src/rules/S4323/meta.ts b/packages/jsts/src/rules/S4323/meta.ts index 08e1870330d..e66c91b86c2 100644 --- a/packages/jsts/src/rules/S4323/meta.ts +++ b/packages/jsts/src/rules/S4323/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Type aliases should be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4323/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4323'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'use-type-alias'; diff --git a/packages/jsts/src/rules/S4323/rule.ts b/packages/jsts/src/rules/S4323/rule.ts index fb6645799ee..2a132fc6cc1 100644 --- a/packages/jsts/src/rules/S4323/rule.ts +++ b/packages/jsts/src/rules/S4323/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, report, toSecondaryLocation } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S4324/meta.ts b/packages/jsts/src/rules/S4324/meta.ts index 744f4309fc7..4c91fbaa2ea 100644 --- a/packages/jsts/src/rules/S4324/meta.ts +++ b/packages/jsts/src/rules/S4324/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Primitive return types should be used', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4324/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S4324'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-return-type-any'; diff --git a/packages/jsts/src/rules/S4324/rule.ts b/packages/jsts/src/rules/S4324/rule.ts index c5358bb82b3..9f28824d3d7 100644 --- a/packages/jsts/src/rules/S4324/rule.ts +++ b/packages/jsts/src/rules/S4324/rule.ts @@ -17,7 +17,7 @@ // https://sonarsource.github.io/rspec/#/rspec/S4324/javascript import type { Rule } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, isRequiredParserServices, diff --git a/packages/jsts/src/rules/S4325/index.ts b/packages/jsts/src/rules/S4325/index.ts new file mode 100644 index 00000000000..798e0ecd17e --- /dev/null +++ b/packages/jsts/src/rules/S4325/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['no-unnecessary-type-assertion']; diff --git a/packages/jsts/src/rules/S4325/meta.ts b/packages/jsts/src/rules/S4325/meta.ts new file mode 100644 index 00000000000..0f8a5947b9c --- /dev/null +++ b/packages/jsts/src/rules/S4325/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-unnecessary-type-assertion'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S4326/index.ts b/packages/jsts/src/rules/S4326/index.ts new file mode 100644 index 00000000000..1e18f342998 --- /dev/null +++ b/packages/jsts/src/rules/S4326/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-return-await'); diff --git a/packages/jsts/src/rules/S4326/meta.ts b/packages/jsts/src/rules/S4326/meta.ts new file mode 100644 index 00000000000..f31809fe3d9 --- /dev/null +++ b/packages/jsts/src/rules/S4326/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-return-await'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S4327/index.ts b/packages/jsts/src/rules/S4327/index.ts index 84175368008..92bdc49d494 100644 --- a/packages/jsts/src/rules/S4327/index.ts +++ b/packages/jsts/src/rules/S4327/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(tsEslintRules['no-this-alias']); diff --git a/packages/jsts/src/rules/S4327/meta.ts b/packages/jsts/src/rules/S4327/meta.ts index bb12ea6d3b3..7ed3a4b5452 100644 --- a/packages/jsts/src/rules/S4327/meta.ts +++ b/packages/jsts/src/rules/S4327/meta.ts @@ -14,16 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"this" should not be assigned to variables', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4327/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4327'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-this-alias'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'no-this-alias' }, +]; diff --git a/packages/jsts/src/rules/S4328/meta.ts b/packages/jsts/src/rules/S4328/meta.ts index 2c68c55d419..46eb7f8ed46 100644 --- a/packages/jsts/src/rules/S4328/meta.ts +++ b/packages/jsts/src/rules/S4328/meta.ts @@ -14,36 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Dependencies should be explicit', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4328/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4328'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - whitelist: { - type: 'array', - items: { - type: 'string', - }, - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-implicit-dependencies'; diff --git a/packages/jsts/src/rules/S4335/meta.ts b/packages/jsts/src/rules/S4335/meta.ts index d538f7fdbe3..396190e1adf 100644 --- a/packages/jsts/src/rules/S4335/meta.ts +++ b/packages/jsts/src/rules/S4335/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Type intersections should use meaningful types', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4335/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S4335'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-useless-intersection'; diff --git a/packages/jsts/src/rules/S4335/rule.ts b/packages/jsts/src/rules/S4335/rule.ts index ca882c2bbde..84b1d1047fc 100644 --- a/packages/jsts/src/rules/S4335/rule.ts +++ b/packages/jsts/src/rules/S4335/rule.ts @@ -19,7 +19,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; import ts from 'typescript'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, isRequiredParserServices } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S4423/meta.ts b/packages/jsts/src/rules/S4423/meta.ts index 6a2ff6e0bd5..1440ee6f03d 100644 --- a/packages/jsts/src/rules/S4423/meta.ts +++ b/packages/jsts/src/rules/S4423/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Weak SSL/TLS protocols should not be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4423/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4423'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'weak-ssl'; diff --git a/packages/jsts/src/rules/S4426/meta.ts b/packages/jsts/src/rules/S4426/meta.ts index c36adbb00aa..da88bf4d84c 100644 --- a/packages/jsts/src/rules/S4426/meta.ts +++ b/packages/jsts/src/rules/S4426/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Cryptographic keys should be robust', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4426/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4426'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-weak-keys'; diff --git a/packages/jsts/src/rules/S4502/meta.ts b/packages/jsts/src/rules/S4502/meta.ts index 64cd5a6bcce..e0175d75956 100644 --- a/packages/jsts/src/rules/S4502/meta.ts +++ b/packages/jsts/src/rules/S4502/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Disabling CSRF protections is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4502/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4502'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'csrf'; diff --git a/packages/jsts/src/rules/S4507/meta.ts b/packages/jsts/src/rules/S4507/meta.ts index d0c2806340c..73d69f7dce5 100644 --- a/packages/jsts/src/rules/S4507/meta.ts +++ b/packages/jsts/src/rules/S4507/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: - 'Delivering code in production with debug features activated is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4507/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4507'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'production-debug'; diff --git a/packages/jsts/src/rules/S4524/meta.ts b/packages/jsts/src/rules/S4524/meta.ts index 4539fbcd8b8..cc05c90a3de 100644 --- a/packages/jsts/src/rules/S4524/meta.ts +++ b/packages/jsts/src/rules/S4524/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"default" clauses should be last', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4524/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4524'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'prefer-default-last'; diff --git a/packages/jsts/src/rules/S4619/meta.ts b/packages/jsts/src/rules/S4619/meta.ts index 5b2ef4dee82..18d40e973bb 100644 --- a/packages/jsts/src/rules/S4619/meta.ts +++ b/packages/jsts/src/rules/S4619/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"in" should not be used on arrays', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4619/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S4619'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-in-misuse'; diff --git a/packages/jsts/src/rules/S4621/meta.ts b/packages/jsts/src/rules/S4621/meta.ts index e7b179def9d..2a72e6be465 100644 --- a/packages/jsts/src/rules/S4621/meta.ts +++ b/packages/jsts/src/rules/S4621/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Union and intersection types should not include duplicated constituents', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4621/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S4621'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-duplicate-in-composite'; diff --git a/packages/jsts/src/rules/S4621/rule.ts b/packages/jsts/src/rules/S4621/rule.ts index 34724208428..cc34f436e81 100644 --- a/packages/jsts/src/rules/S4621/rule.ts +++ b/packages/jsts/src/rules/S4621/rule.ts @@ -18,7 +18,7 @@ import { AST, Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, IssueLocation, report, toSecondaryLocation } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S4622/meta.ts b/packages/jsts/src/rules/S4622/meta.ts index 724ed534eb4..38c5fcc731a 100644 --- a/packages/jsts/src/rules/S4622/meta.ts +++ b/packages/jsts/src/rules/S4622/meta.ts @@ -14,33 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Union types should not have too many elements', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4622/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4622'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - threshold: { - type: 'integer', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'max-union-size'; diff --git a/packages/jsts/src/rules/S4622/rule.ts b/packages/jsts/src/rules/S4622/rule.ts index 325587c0382..046327f04d1 100644 --- a/packages/jsts/src/rules/S4622/rule.ts +++ b/packages/jsts/src/rules/S4622/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, isIdentifier, UTILITY_TYPES } from '../helpers/index.js'; import { FromSchema } from 'json-schema-to-ts'; import { meta, schema } from './meta.js'; diff --git a/packages/jsts/src/rules/S4623/meta.ts b/packages/jsts/src/rules/S4623/meta.ts index a86b64e7e11..2b62b9da6be 100644 --- a/packages/jsts/src/rules/S4623/meta.ts +++ b/packages/jsts/src/rules/S4623/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"undefined" should not be passed as the value of optional parameters', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4623/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S4623'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-undefined-argument'; diff --git a/packages/jsts/src/rules/S4623/rule.ts b/packages/jsts/src/rules/S4623/rule.ts index 498000ffa4f..c26978cd4fe 100644 --- a/packages/jsts/src/rules/S4623/rule.ts +++ b/packages/jsts/src/rules/S4623/rule.ts @@ -17,7 +17,7 @@ // https://sonarsource.github.io/rspec/#/rspec/S4623/javascript import type { Rule } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, isRequiredParserServices, diff --git a/packages/jsts/src/rules/S4624/meta.ts b/packages/jsts/src/rules/S4624/meta.ts index 5c363d01481..03fb4c28458 100644 --- a/packages/jsts/src/rules/S4624/meta.ts +++ b/packages/jsts/src/rules/S4624/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Template literals should not be nested', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4624/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4624'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-nested-template-literals'; diff --git a/packages/jsts/src/rules/S4634/meta.ts b/packages/jsts/src/rules/S4634/meta.ts index 6f61d4c350e..0f147f2e718 100644 --- a/packages/jsts/src/rules/S4634/meta.ts +++ b/packages/jsts/src/rules/S4634/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Shorthand promises should be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4634/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S4634'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'prefer-promise-shorthand'; diff --git a/packages/jsts/src/rules/S4721/meta.ts b/packages/jsts/src/rules/S4721/meta.ts index 4a25be7183d..21af99a102a 100644 --- a/packages/jsts/src/rules/S4721/meta.ts +++ b/packages/jsts/src/rules/S4721/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using shell interpreter when executing OS commands is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4721/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4721'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'os-command'; diff --git a/packages/jsts/src/rules/S4782/meta.ts b/packages/jsts/src/rules/S4782/meta.ts index 8caf99427f6..760a55fe60b 100644 --- a/packages/jsts/src/rules/S4782/meta.ts +++ b/packages/jsts/src/rules/S4782/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: "Optional property declarations should not use both '?' and 'undefined' syntax", - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4782/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S4782'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-redundant-optional'; diff --git a/packages/jsts/src/rules/S4782/rule.ts b/packages/jsts/src/rules/S4782/rule.ts index f763fa1b761..c6998fa3168 100644 --- a/packages/jsts/src/rules/S4782/rule.ts +++ b/packages/jsts/src/rules/S4782/rule.ts @@ -18,7 +18,7 @@ import { AST, Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, isRequiredParserServices, diff --git a/packages/jsts/src/rules/S4784/meta.ts b/packages/jsts/src/rules/S4784/meta.ts index d08c3457397..45ed18cdbc1 100644 --- a/packages/jsts/src/rules/S4784/meta.ts +++ b/packages/jsts/src/rules/S4784/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using regular expressions is security-sensitive', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4784/javascript', - requiresTypeChecking: false, - }, - deprecated: true, -}; - -export const sonarKey = 'S4784'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'regular-expr'; diff --git a/packages/jsts/src/rules/S4787/meta.ts b/packages/jsts/src/rules/S4787/meta.ts index 078ebb656f7..d5064954ff7 100644 --- a/packages/jsts/src/rules/S4787/meta.ts +++ b/packages/jsts/src/rules/S4787/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Encrypting data is security-sensitive', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4787/javascript', - requiresTypeChecking: false, - }, - deprecated: true, -}; - -export const sonarKey = 'S4787'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'encryption'; diff --git a/packages/jsts/src/rules/S4790/meta.ts b/packages/jsts/src/rules/S4790/meta.ts index b29500e146e..42027c1de5e 100644 --- a/packages/jsts/src/rules/S4790/meta.ts +++ b/packages/jsts/src/rules/S4790/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using weak hashing algorithms is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4790/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4790'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'hashing'; diff --git a/packages/jsts/src/rules/S4798/meta.ts b/packages/jsts/src/rules/S4798/meta.ts index 01b6fa9c72b..98bdd5a952d 100644 --- a/packages/jsts/src/rules/S4798/meta.ts +++ b/packages/jsts/src/rules/S4798/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Optional boolean parameters should have default value', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4798/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4798'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'bool-param-default'; diff --git a/packages/jsts/src/rules/S4798/rule.ts b/packages/jsts/src/rules/S4798/rule.ts index ade3af62d4c..ba2f0e8a97e 100644 --- a/packages/jsts/src/rules/S4798/rule.ts +++ b/packages/jsts/src/rules/S4798/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S4817/meta.ts b/packages/jsts/src/rules/S4817/meta.ts index bd880a9092b..954c799bd73 100644 --- a/packages/jsts/src/rules/S4817/meta.ts +++ b/packages/jsts/src/rules/S4817/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Executing XPath expressions is security-sensitive', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4817/javascript', - requiresTypeChecking: false, - }, - deprecated: true, -}; - -export const sonarKey = 'S4817'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'xpath'; diff --git a/packages/jsts/src/rules/S4818/meta.ts b/packages/jsts/src/rules/S4818/meta.ts index b400368297e..fec958ca4bb 100644 --- a/packages/jsts/src/rules/S4818/meta.ts +++ b/packages/jsts/src/rules/S4818/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using Sockets is security-sensitive', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4818/javascript', - requiresTypeChecking: false, - }, - deprecated: true, -}; - -export const sonarKey = 'S4818'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'sockets'; diff --git a/packages/jsts/src/rules/S4822/meta.ts b/packages/jsts/src/rules/S4822/meta.ts index 39467f94a1b..7805288e3c8 100644 --- a/packages/jsts/src/rules/S4822/meta.ts +++ b/packages/jsts/src/rules/S4822/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Promise rejections should not be caught by "try" blocks', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4822/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S4822'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-try-promise'; diff --git a/packages/jsts/src/rules/S4822/rule.ts b/packages/jsts/src/rules/S4822/rule.ts index 1d2c6e26c57..e0e51a5fe83 100644 --- a/packages/jsts/src/rules/S4822/rule.ts +++ b/packages/jsts/src/rules/S4822/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { childrenOf, generateMeta, diff --git a/packages/jsts/src/rules/S4823/meta.ts b/packages/jsts/src/rules/S4823/meta.ts index 8456c553c4d..cb629acebe1 100644 --- a/packages/jsts/src/rules/S4823/meta.ts +++ b/packages/jsts/src/rules/S4823/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using command line arguments is security-sensitive', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4823/javascript', - requiresTypeChecking: false, - }, - deprecated: true, -}; - -export const sonarKey = 'S4823'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'process-argv'; diff --git a/packages/jsts/src/rules/S4829/meta.ts b/packages/jsts/src/rules/S4829/meta.ts index e11d9f66079..b2ef7d22d44 100644 --- a/packages/jsts/src/rules/S4829/meta.ts +++ b/packages/jsts/src/rules/S4829/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Reading the Standard Input is security-sensitive', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4829/javascript', - requiresTypeChecking: false, - }, - deprecated: true, -}; - -export const sonarKey = 'S4829'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'standard-input'; diff --git a/packages/jsts/src/rules/S4830/meta.ts b/packages/jsts/src/rules/S4830/meta.ts index 10ce1a28110..6928d11ae07 100644 --- a/packages/jsts/src/rules/S4830/meta.ts +++ b/packages/jsts/src/rules/S4830/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Server certificates should be verified during SSL/TLS connections', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S4830/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S4830'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'unverified-certificate'; diff --git a/packages/jsts/src/rules/S5042/meta.ts b/packages/jsts/src/rules/S5042/meta.ts index 653656dbb32..cdc6adf235d 100644 --- a/packages/jsts/src/rules/S5042/meta.ts +++ b/packages/jsts/src/rules/S5042/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: - 'Expanding archive files without controlling resource consumption is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5042/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5042'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-unsafe-unzip'; diff --git a/packages/jsts/src/rules/S5122/meta.ts b/packages/jsts/src/rules/S5122/meta.ts index 73cdd6f3e88..a6e16d73e83 100644 --- a/packages/jsts/src/rules/S5122/meta.ts +++ b/packages/jsts/src/rules/S5122/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Having a permissive Cross-Origin Resource Sharing policy is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5122/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5122'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'cors'; diff --git a/packages/jsts/src/rules/S5122/rule.ts b/packages/jsts/src/rules/S5122/rule.ts index 6b5364b3071..79e77b7cc02 100644 --- a/packages/jsts/src/rules/S5122/rule.ts +++ b/packages/jsts/src/rules/S5122/rule.ts @@ -31,7 +31,7 @@ import { resolveFunction, toSecondaryLocation, } from '../helpers/index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; const MESSAGE = `Make sure that enabling CORS is safe here.`; diff --git a/packages/jsts/src/rules/S5148/meta.ts b/packages/jsts/src/rules/S5148/meta.ts index 42f796ac0cf..ed898732b1d 100644 --- a/packages/jsts/src/rules/S5148/meta.ts +++ b/packages/jsts/src/rules/S5148/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: - 'Authorizing an opened window to access back to the originating window is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5148/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5148'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'link-with-target-blank'; diff --git a/packages/jsts/src/rules/S5247/meta.ts b/packages/jsts/src/rules/S5247/meta.ts index 287539b208a..21281535a85 100644 --- a/packages/jsts/src/rules/S5247/meta.ts +++ b/packages/jsts/src/rules/S5247/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Disabling auto-escaping in template engines is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5247/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S5247'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'disabled-auto-escaping'; diff --git a/packages/jsts/src/rules/S5254/meta.ts b/packages/jsts/src/rules/S5254/meta.ts index 3a5ec61b9b4..b39ff6850f8 100644 --- a/packages/jsts/src/rules/S5254/meta.ts +++ b/packages/jsts/src/rules/S5254/meta.ts @@ -14,16 +14,10 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'HTML elements should have a valid language attribute', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5254/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5254'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'html-has-lang'; +export const externalRules = [ + { externalPlugin: 'jsx-a11y', externalRule: 'lang' }, + { externalPlugin: 'jsx-a11y', externalRule: 'html-has-lang' }, +]; diff --git a/packages/jsts/src/rules/S5254/rule.ts b/packages/jsts/src/rules/S5254/rule.ts index 4bbb876bed3..6126613ef51 100644 --- a/packages/jsts/src/rules/S5254/rule.ts +++ b/packages/jsts/src/rules/S5254/rule.ts @@ -16,15 +16,14 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S5254/javascript -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import type { Rule } from 'eslint'; -import pkg from 'eslint-plugin-jsx-a11y'; -const { rules: jsxA11yRules } = pkg; +import { rules } from '../external/a11y.js'; import { generateMeta, interceptReport, mergeRules } from '../helpers/index.js'; import { meta } from './meta.js'; -const langRule = jsxA11yRules['lang']; -const htmlHasLangRule = jsxA11yRules['html-has-lang']; +const langRule = rules['lang']; +const htmlHasLangRule = rules['html-has-lang']; const decoratedHasLangRule = decorate(htmlHasLangRule); function decorate(rule: Rule.RuleModule): Rule.RuleModule { diff --git a/packages/jsts/src/rules/S5256/meta.ts b/packages/jsts/src/rules/S5256/meta.ts index 8d6e130b6cf..ec9f0584fb2 100644 --- a/packages/jsts/src/rules/S5256/meta.ts +++ b/packages/jsts/src/rules/S5256/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Tables should have headers', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5256/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5256'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'table-header'; diff --git a/packages/jsts/src/rules/S5256/rule.ts b/packages/jsts/src/rules/S5256/rule.ts index 344cf7931c5..9e3ba7eb1fa 100644 --- a/packages/jsts/src/rules/S5256/rule.ts +++ b/packages/jsts/src/rules/S5256/rule.ts @@ -16,14 +16,14 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S5256/javascript -import getElementType from 'eslint-plugin-jsx-a11y/lib/util/getElementType.js'; import estree from 'estree'; import type { Rule } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import pkg from 'jsx-ast-utils'; const { getLiteralPropValue, getProp } = pkg; + import { computeGrid } from '../helpers/table.js'; -import { generateMeta, isPresentationTable } from '../helpers/index.js'; +import { generateMeta, isPresentationTable, getElementType } from '../helpers/index.js'; import { meta } from './meta.js'; export const rule: Rule.RuleModule = { diff --git a/packages/jsts/src/rules/S5257/meta.ts b/packages/jsts/src/rules/S5257/meta.ts index bdb90291717..19bcc245dad 100644 --- a/packages/jsts/src/rules/S5257/meta.ts +++ b/packages/jsts/src/rules/S5257/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'HTML "
" should not be used for layout purposes', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5257/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5257'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-table-as-layout'; diff --git a/packages/jsts/src/rules/S5257/rule.ts b/packages/jsts/src/rules/S5257/rule.ts index fb525bf0280..c45ea2412ee 100644 --- a/packages/jsts/src/rules/S5257/rule.ts +++ b/packages/jsts/src/rules/S5257/rule.ts @@ -17,7 +17,7 @@ // https://sonarsource.github.io/rspec/#/rspec/S5257/javascript import type { Rule } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import estree from 'estree'; import { generateMeta, isPresentationTable } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S5260/meta.ts b/packages/jsts/src/rules/S5260/meta.ts index b88a6be7c1f..4d13615e976 100644 --- a/packages/jsts/src/rules/S5260/meta.ts +++ b/packages/jsts/src/rules/S5260/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Table cells should reference their headers', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5260/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5260'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'table-header-reference'; diff --git a/packages/jsts/src/rules/S5260/rule.ts b/packages/jsts/src/rules/S5260/rule.ts index e8adc607c86..1ecace2ede6 100644 --- a/packages/jsts/src/rules/S5260/rule.ts +++ b/packages/jsts/src/rules/S5260/rule.ts @@ -16,12 +16,11 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S5260/javascript -import getElementType from 'eslint-plugin-jsx-a11y/lib/util/getElementType.js'; import estree from 'estree'; import type { Rule } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { computeGrid, TableCell } from '../helpers/table.js'; -import { generateMeta } from '../helpers/index.js'; +import { generateMeta, getElementType } from '../helpers/index.js'; import { meta } from './meta.js'; type BlockInfo = { diff --git a/packages/jsts/src/rules/S5264/meta.ts b/packages/jsts/src/rules/S5264/meta.ts index 3e616867429..b597d0e64bb 100644 --- a/packages/jsts/src/rules/S5264/meta.ts +++ b/packages/jsts/src/rules/S5264/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"" tags should provide an alternative content', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5264/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5264'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'object-alt-content'; diff --git a/packages/jsts/src/rules/S5264/rule.ts b/packages/jsts/src/rules/S5264/rule.ts index 68065fc1c52..73e81bbbb80 100644 --- a/packages/jsts/src/rules/S5264/rule.ts +++ b/packages/jsts/src/rules/S5264/rule.ts @@ -17,12 +17,12 @@ // https://sonarsource.github.io/rspec/#/rspec/S5264/javascript import type { Rule } from 'eslint'; -import isHiddenFromScreenReader from 'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader.js'; -import getElementType from 'eslint-plugin-jsx-a11y/lib/util/getElementType.js'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; -import { generateMeta } from '../helpers/index.js'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { generateMeta, getElementType } from '../helpers/index.js'; import { meta } from './meta.js'; +import pkg from 'jsx-ast-utils'; +const { getLiteralPropValue, getProp, getPropValue } = pkg; export const rule: Rule.RuleModule = { meta: generateMeta(meta as Rule.RuleMetaData, { @@ -75,3 +75,19 @@ export const rule: Rule.RuleModule = { }; }, }; + +const isHiddenFromScreenReader = ( + type: string, + attributes: (TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute)[], +) => { + if (type.toUpperCase() === 'INPUT') { + const hidden = getLiteralPropValue(getProp(attributes, 'type')); + + if (typeof hidden === 'string' && hidden.toUpperCase?.() === 'HIDDEN') { + return true; + } + } + + const ariaHidden = getPropValue(getProp(attributes, 'aria-hidden')); + return ariaHidden === true; +}; diff --git a/packages/jsts/src/rules/S5332/meta.ts b/packages/jsts/src/rules/S5332/meta.ts index f5a703229b0..aee3e40d8ab 100644 --- a/packages/jsts/src/rules/S5332/meta.ts +++ b/packages/jsts/src/rules/S5332/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using clear-text protocols is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5332/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5332'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-clear-text-protocols'; diff --git a/packages/jsts/src/rules/S5443/meta.ts b/packages/jsts/src/rules/S5443/meta.ts index 71924247627..c7717f066f8 100644 --- a/packages/jsts/src/rules/S5443/meta.ts +++ b/packages/jsts/src/rules/S5443/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using publicly writable directories is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5443/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5443'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'publicly-writable-directories'; diff --git a/packages/jsts/src/rules/S5527/meta.ts b/packages/jsts/src/rules/S5527/meta.ts index 6b30d6395d5..f75d9106205 100644 --- a/packages/jsts/src/rules/S5527/meta.ts +++ b/packages/jsts/src/rules/S5527/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Server hostnames should be verified during SSL/TLS connections', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5527/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5527'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'unverified-hostname'; diff --git a/packages/jsts/src/rules/S5542/meta.ts b/packages/jsts/src/rules/S5542/meta.ts index 6c72a18a34c..96f495026ec 100644 --- a/packages/jsts/src/rules/S5542/meta.ts +++ b/packages/jsts/src/rules/S5542/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Encryption algorithms should be used with secure mode and padding scheme', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5542/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5542'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'encryption-secure-mode'; diff --git a/packages/jsts/src/rules/S5547/meta.ts b/packages/jsts/src/rules/S5547/meta.ts index c47506b375f..e1979e1a8d4 100644 --- a/packages/jsts/src/rules/S5547/meta.ts +++ b/packages/jsts/src/rules/S5547/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Cipher algorithms should be robust', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5547/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5547'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-weak-cipher'; diff --git a/packages/jsts/src/rules/S5604/meta.ts b/packages/jsts/src/rules/S5604/meta.ts index 2272b773a71..02728cec991 100644 --- a/packages/jsts/src/rules/S5604/meta.ts +++ b/packages/jsts/src/rules/S5604/meta.ts @@ -14,36 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using intrusive permissions is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5604/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5604'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - permissions: { - type: 'array', - items: { - type: 'string', - }, - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-intrusive-permissions'; diff --git a/packages/jsts/src/rules/S5659/meta.ts b/packages/jsts/src/rules/S5659/meta.ts index f6e667f1a83..ceefcee5c56 100644 --- a/packages/jsts/src/rules/S5659/meta.ts +++ b/packages/jsts/src/rules/S5659/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'JWT should be signed and verified with strong cipher algorithms', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5659/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5659'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'insecure-jwt-token'; diff --git a/packages/jsts/src/rules/S5689/meta.ts b/packages/jsts/src/rules/S5689/meta.ts index a3c82c43d90..8e474fe3ec1 100644 --- a/packages/jsts/src/rules/S5689/meta.ts +++ b/packages/jsts/src/rules/S5689/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Disclosing fingerprints from web application technologies is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5689/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5689'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'x-powered-by'; diff --git a/packages/jsts/src/rules/S5691/meta.ts b/packages/jsts/src/rules/S5691/meta.ts index 9476937271c..12f9f7a0946 100644 --- a/packages/jsts/src/rules/S5691/meta.ts +++ b/packages/jsts/src/rules/S5691/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Statically serving hidden files is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5691/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5691'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'hidden-files'; diff --git a/packages/jsts/src/rules/S5693/meta.ts b/packages/jsts/src/rules/S5693/meta.ts index ad478249d7c..71466440359 100644 --- a/packages/jsts/src/rules/S5693/meta.ts +++ b/packages/jsts/src/rules/S5693/meta.ts @@ -14,36 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Allowing requests with excessive content length is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5693/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5693'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - fileUploadSizeLimit: { - type: 'integer', - }, - standardSizeLimit: { - type: 'integer', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'content-length'; diff --git a/packages/jsts/src/rules/S5725/meta.ts b/packages/jsts/src/rules/S5725/meta.ts index 013d961ed74..b708faeab43 100644 --- a/packages/jsts/src/rules/S5725/meta.ts +++ b/packages/jsts/src/rules/S5725/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using remote artifacts without integrity checks is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5725/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S5725'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'disabled-resource-integrity'; diff --git a/packages/jsts/src/rules/S5725/rule.ts b/packages/jsts/src/rules/S5725/rule.ts index b4a689fc11a..eb1fc10dd2a 100644 --- a/packages/jsts/src/rules/S5725/rule.ts +++ b/packages/jsts/src/rules/S5725/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { Variable } from 'eslint-scope'; import { generateMeta, diff --git a/packages/jsts/src/rules/S5728/meta.ts b/packages/jsts/src/rules/S5728/meta.ts index 2dfb0556c37..fbcc9e917d0 100644 --- a/packages/jsts/src/rules/S5728/meta.ts +++ b/packages/jsts/src/rules/S5728/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Disabling content security policy fetch directives is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5728/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5728'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'content-security-policy'; diff --git a/packages/jsts/src/rules/S5730/meta.ts b/packages/jsts/src/rules/S5730/meta.ts index 7e3c137b6a7..c1874b4f20e 100644 --- a/packages/jsts/src/rules/S5730/meta.ts +++ b/packages/jsts/src/rules/S5730/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Allowing mixed-content is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5730/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5730'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-mixed-content'; diff --git a/packages/jsts/src/rules/S5732/meta.ts b/packages/jsts/src/rules/S5732/meta.ts index 556e4f9b8f0..1781e536a83 100644 --- a/packages/jsts/src/rules/S5732/meta.ts +++ b/packages/jsts/src/rules/S5732/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: - 'Disabling content security policy frame-ancestors directive is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5732/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5732'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'frame-ancestors'; diff --git a/packages/jsts/src/rules/S5734/meta.ts b/packages/jsts/src/rules/S5734/meta.ts index 7f6701928dc..9f2e5607035 100644 --- a/packages/jsts/src/rules/S5734/meta.ts +++ b/packages/jsts/src/rules/S5734/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Allowing browsers to sniff MIME types is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5734/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5734'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-mime-sniff'; diff --git a/packages/jsts/src/rules/S5736/meta.ts b/packages/jsts/src/rules/S5736/meta.ts index a2f1790990e..4fcfc9fb676 100644 --- a/packages/jsts/src/rules/S5736/meta.ts +++ b/packages/jsts/src/rules/S5736/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Disabling strict HTTP no-referrer policy is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5736/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5736'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-referrer-policy'; diff --git a/packages/jsts/src/rules/S5739/meta.ts b/packages/jsts/src/rules/S5739/meta.ts index af97d96f59b..ac76c6bb586 100644 --- a/packages/jsts/src/rules/S5739/meta.ts +++ b/packages/jsts/src/rules/S5739/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Disabling Strict-Transport-Security policy is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5739/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5739'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'strict-transport-security'; diff --git a/packages/jsts/src/rules/S5742/meta.ts b/packages/jsts/src/rules/S5742/meta.ts index e1924a17ad3..d10c5b9e429 100644 --- a/packages/jsts/src/rules/S5742/meta.ts +++ b/packages/jsts/src/rules/S5742/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Disabling Certificate Transparency monitoring is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5742/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5742'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'certificate-transparency'; diff --git a/packages/jsts/src/rules/S5743/meta.ts b/packages/jsts/src/rules/S5743/meta.ts index 84f8bbf47ac..22a45b71aa0 100644 --- a/packages/jsts/src/rules/S5743/meta.ts +++ b/packages/jsts/src/rules/S5743/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Allowing browsers to perform DNS prefetching is security-sensitive', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5743/javascript', - requiresTypeChecking: false, - }, - deprecated: true, -}; - -export const sonarKey = 'S5743'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'dns-prefetching'; diff --git a/packages/jsts/src/rules/S5757/meta.ts b/packages/jsts/src/rules/S5757/meta.ts index c307dfd7619..0017ab1b9b9 100644 --- a/packages/jsts/src/rules/S5757/meta.ts +++ b/packages/jsts/src/rules/S5757/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Allowing confidential information to be logged is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5757/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5757'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'confidential-information-logging'; diff --git a/packages/jsts/src/rules/S5759/meta.ts b/packages/jsts/src/rules/S5759/meta.ts index a234f6cf07b..4b0336b9098 100644 --- a/packages/jsts/src/rules/S5759/meta.ts +++ b/packages/jsts/src/rules/S5759/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Forwarding client IP address is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5759/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5759'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-ip-forward'; diff --git a/packages/jsts/src/rules/S5842/meta.ts b/packages/jsts/src/rules/S5842/meta.ts index ff5d881f4af..529613adcbf 100644 --- a/packages/jsts/src/rules/S5842/meta.ts +++ b/packages/jsts/src/rules/S5842/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Repeated patterns in regular expressions should not match the empty string', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5842/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S5842'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'empty-string-repetition'; diff --git a/packages/jsts/src/rules/S5843/meta.ts b/packages/jsts/src/rules/S5843/meta.ts index 06af4372f31..e70358f868c 100644 --- a/packages/jsts/src/rules/S5843/meta.ts +++ b/packages/jsts/src/rules/S5843/meta.ts @@ -14,33 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Regular expressions should not be too complicated', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5843/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S5843'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 2, - items: [ - { - type: 'object', - properties: { - threshold: { - type: 'integer', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'regex-complexity'; diff --git a/packages/jsts/src/rules/S5850/meta.ts b/packages/jsts/src/rules/S5850/meta.ts index 2fba2cca677..a3ada24140b 100644 --- a/packages/jsts/src/rules/S5850/meta.ts +++ b/packages/jsts/src/rules/S5850/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Alternatives in regular expressions should be grouped when used with anchors', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5850/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S5850'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'anchor-precedence'; diff --git a/packages/jsts/src/rules/S5852/meta.ts b/packages/jsts/src/rules/S5852/meta.ts index 493fc2e906f..cf89f7e8945 100644 --- a/packages/jsts/src/rules/S5852/meta.ts +++ b/packages/jsts/src/rules/S5852/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using slow regular expressions is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5852/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S5852'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'slow-regex'; diff --git a/packages/jsts/src/rules/S5856/meta.ts b/packages/jsts/src/rules/S5856/meta.ts index 3401c23b36b..13f1a1f945e 100644 --- a/packages/jsts/src/rules/S5856/meta.ts +++ b/packages/jsts/src/rules/S5856/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Regular expressions should be syntactically valid', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5856/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S5856'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-invalid-regexp'; diff --git a/packages/jsts/src/rules/S5860/meta.ts b/packages/jsts/src/rules/S5860/meta.ts index 0acfa1f2345..43b11afb2bd 100644 --- a/packages/jsts/src/rules/S5860/meta.ts +++ b/packages/jsts/src/rules/S5860/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Names of regular expressions named groups should be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5860/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S5860'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'unused-named-groups'; diff --git a/packages/jsts/src/rules/S5860/rule.ts b/packages/jsts/src/rules/S5860/rule.ts index 3e3e7949587..1cabd403692 100644 --- a/packages/jsts/src/rules/S5860/rule.ts +++ b/packages/jsts/src/rules/S5860/rule.ts @@ -42,7 +42,7 @@ import { RequiredParserServices, toSecondaryLocation, } from '../helpers/index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; import { isStringRegexMethodCall, isStringReplaceCall } from '../helpers/regex/ast.js'; import { extractReferences } from '../helpers/regex/group.js'; diff --git a/packages/jsts/src/rules/S5863/meta.ts b/packages/jsts/src/rules/S5863/meta.ts index 0a748075f45..39b30eb5043 100644 --- a/packages/jsts/src/rules/S5863/meta.ts +++ b/packages/jsts/src/rules/S5863/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Assertions should not be given twice the same argument', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5863/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5863'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-same-argument-assert'; diff --git a/packages/jsts/src/rules/S5863/rule.ts b/packages/jsts/src/rules/S5863/rule.ts index 04d2e6a46ca..c9cf27ec23b 100644 --- a/packages/jsts/src/rules/S5863/rule.ts +++ b/packages/jsts/src/rules/S5863/rule.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S5863/javascript -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import type { Rule } from 'eslint'; import estree from 'estree'; import { diff --git a/packages/jsts/src/rules/S5867/meta.ts b/packages/jsts/src/rules/S5867/meta.ts index 3f5a1a6f4ef..6786329f55d 100644 --- a/packages/jsts/src/rules/S5867/meta.ts +++ b/packages/jsts/src/rules/S5867/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: - 'Regular expressions using Unicode character classes or property escapes should enable the unicode flag', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5867/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S5867'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'unicode-aware-regex'; diff --git a/packages/jsts/src/rules/S5868/meta.ts b/packages/jsts/src/rules/S5868/meta.ts index 7509b961506..34c5536e01f 100644 --- a/packages/jsts/src/rules/S5868/meta.ts +++ b/packages/jsts/src/rules/S5868/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Unicode Grapheme Clusters should be avoided inside regex character classes', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5868/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S5868'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-misleading-character-class'; diff --git a/packages/jsts/src/rules/S5868/rule.ts b/packages/jsts/src/rules/S5868/rule.ts index bb922fb63c6..857b1da38fb 100644 --- a/packages/jsts/src/rules/S5868/rule.ts +++ b/packages/jsts/src/rules/S5868/rule.ts @@ -21,7 +21,7 @@ import { ancestorsChain, generateMeta, isRegexLiteral } from '../helpers/index.j import { RegExpValidator } from '@eslint-community/regexpp'; import { Character, CharacterClassElement } from '@eslint-community/regexpp/ast'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; import { getPatternFromNode } from '../helpers/regex/extract.js'; import { getFlags } from '../helpers/regex/flags.js'; diff --git a/packages/jsts/src/rules/S5869/meta.ts b/packages/jsts/src/rules/S5869/meta.ts index 1478842fdb4..0fc5ee8343f 100644 --- a/packages/jsts/src/rules/S5869/meta.ts +++ b/packages/jsts/src/rules/S5869/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: - 'Character classes in regular expressions should not contain the same character twice', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5869/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S5869'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'duplicates-in-character-class'; diff --git a/packages/jsts/src/rules/S5876/meta.ts b/packages/jsts/src/rules/S5876/meta.ts index 13f95d16622..15700c2c887 100644 --- a/packages/jsts/src/rules/S5876/meta.ts +++ b/packages/jsts/src/rules/S5876/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'A new session should be created during user authentication', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5876/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5876'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'session-regeneration'; diff --git a/packages/jsts/src/rules/S5958/meta.ts b/packages/jsts/src/rules/S5958/meta.ts index 00fa60193b8..4d4729f7f89 100644 --- a/packages/jsts/src/rules/S5958/meta.ts +++ b/packages/jsts/src/rules/S5958/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Tests should check which exception is thrown', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5958/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5958'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'test-check-exception'; diff --git a/packages/jsts/src/rules/S5973/meta.ts b/packages/jsts/src/rules/S5973/meta.ts index f46dd934bc0..5e9bd15061a 100644 --- a/packages/jsts/src/rules/S5973/meta.ts +++ b/packages/jsts/src/rules/S5973/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Tests should be stable', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S5973/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S5973'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'stable-tests'; diff --git a/packages/jsts/src/rules/S6019/meta.ts b/packages/jsts/src/rules/S6019/meta.ts index b1437bbbceb..6aad3dfff31 100644 --- a/packages/jsts/src/rules/S6019/meta.ts +++ b/packages/jsts/src/rules/S6019/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: - "Reluctant quantifiers in regular expressions should be followed by an expression that can't match the empty string", - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6019/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S6019'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-empty-after-reluctant'; diff --git a/packages/jsts/src/rules/S6035/meta.ts b/packages/jsts/src/rules/S6035/meta.ts index aff2381cc97..40828c07807 100644 --- a/packages/jsts/src/rules/S6035/meta.ts +++ b/packages/jsts/src/rules/S6035/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: - 'Single-character alternations in regular expressions should be replaced with character classes', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6035/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S6035'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'single-character-alternation'; diff --git a/packages/jsts/src/rules/S6079/meta.ts b/packages/jsts/src/rules/S6079/meta.ts index 0d48dd606ef..c3556a9c513 100644 --- a/packages/jsts/src/rules/S6079/meta.ts +++ b/packages/jsts/src/rules/S6079/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Tests should not execute any code after "done()" is called', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6079/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6079'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-code-after-done'; diff --git a/packages/jsts/src/rules/S6080/meta.ts b/packages/jsts/src/rules/S6080/meta.ts index 25443a3ef5a..7167249c3a2 100644 --- a/packages/jsts/src/rules/S6080/meta.ts +++ b/packages/jsts/src/rules/S6080/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Disabling Mocha timeouts should be explicit', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6080/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6080'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'disabled-timeout'; diff --git a/packages/jsts/src/rules/S6092/meta.ts b/packages/jsts/src/rules/S6092/meta.ts index 04d7ddb879c..abe3f01e291 100644 --- a/packages/jsts/src/rules/S6092/meta.ts +++ b/packages/jsts/src/rules/S6092/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Chai assertions should have only one reason to succeed', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6092/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6092'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'chai-determinate-assertion'; diff --git a/packages/jsts/src/rules/S6245/meta.ts b/packages/jsts/src/rules/S6245/meta.ts index 79b9bdb3a4d..710c0063101 100644 --- a/packages/jsts/src/rules/S6245/meta.ts +++ b/packages/jsts/src/rules/S6245/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Disabling server-side encryption of S3 buckets is security-sensitive', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6245/javascript', - requiresTypeChecking: false, - }, - deprecated: true, -}; - -export const sonarKey = 'S6245'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-s3-bucket-server-encryption'; diff --git a/packages/jsts/src/rules/S6249/meta.ts b/packages/jsts/src/rules/S6249/meta.ts index 11101d73805..e157dcfbc53 100644 --- a/packages/jsts/src/rules/S6249/meta.ts +++ b/packages/jsts/src/rules/S6249/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Authorizing HTTP communications with S3 buckets is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6249/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6249'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-s3-bucket-insecure-http'; diff --git a/packages/jsts/src/rules/S6252/meta.ts b/packages/jsts/src/rules/S6252/meta.ts index d277a360cb5..2728fcb195e 100644 --- a/packages/jsts/src/rules/S6252/meta.ts +++ b/packages/jsts/src/rules/S6252/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Disabling versioning of S3 buckets is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6252/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6252'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-s3-bucket-versioning'; diff --git a/packages/jsts/src/rules/S6265/meta.ts b/packages/jsts/src/rules/S6265/meta.ts index 872c9dc369b..ccf1087944c 100644 --- a/packages/jsts/src/rules/S6265/meta.ts +++ b/packages/jsts/src/rules/S6265/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: - 'Granting access to S3 buckets to all or authenticated users is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6265/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6265'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-s3-bucket-granted-access'; diff --git a/packages/jsts/src/rules/S6268/meta.ts b/packages/jsts/src/rules/S6268/meta.ts index 892ecee75c7..cbfec35799d 100644 --- a/packages/jsts/src/rules/S6268/meta.ts +++ b/packages/jsts/src/rules/S6268/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Disabling Angular built-in sanitization is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6268/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6268'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-angular-bypass-sanitization'; diff --git a/packages/jsts/src/rules/S6270/meta.ts b/packages/jsts/src/rules/S6270/meta.ts index 9fcb0ad6f30..62a9aaadf2c 100644 --- a/packages/jsts/src/rules/S6270/meta.ts +++ b/packages/jsts/src/rules/S6270/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Policies authorizing public access to resources are security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6270/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6270'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-iam-public-access'; diff --git a/packages/jsts/src/rules/S6275/meta.ts b/packages/jsts/src/rules/S6275/meta.ts index 60b8615bfc6..45410c3804b 100644 --- a/packages/jsts/src/rules/S6275/meta.ts +++ b/packages/jsts/src/rules/S6275/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using unencrypted EBS volumes is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6275/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6275'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-ec2-unencrypted-ebs-volume'; diff --git a/packages/jsts/src/rules/S6281/meta.ts b/packages/jsts/src/rules/S6281/meta.ts index 5ebfdab48f2..f0be77e85d3 100644 --- a/packages/jsts/src/rules/S6281/meta.ts +++ b/packages/jsts/src/rules/S6281/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Allowing public ACLs or policies on a S3 bucket is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6281/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6281'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-s3-bucket-public-access'; diff --git a/packages/jsts/src/rules/S6299/meta.ts b/packages/jsts/src/rules/S6299/meta.ts index 94c82bc2e88..93ab8ec93c4 100644 --- a/packages/jsts/src/rules/S6299/meta.ts +++ b/packages/jsts/src/rules/S6299/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Disabling Vue.js built-in escaping is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6299/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6299'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-vue-bypass-sanitization'; diff --git a/packages/jsts/src/rules/S6302/meta.ts b/packages/jsts/src/rules/S6302/meta.ts index 291c0f12c65..49579fc4254 100644 --- a/packages/jsts/src/rules/S6302/meta.ts +++ b/packages/jsts/src/rules/S6302/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Policies granting all privileges are security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6302/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6302'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-iam-all-privileges'; diff --git a/packages/jsts/src/rules/S6303/meta.ts b/packages/jsts/src/rules/S6303/meta.ts index 83abf3119fa..0d240db3bce 100644 --- a/packages/jsts/src/rules/S6303/meta.ts +++ b/packages/jsts/src/rules/S6303/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using unencrypted RDS DB resources is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6303/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6303'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-rds-unencrypted-databases'; diff --git a/packages/jsts/src/rules/S6304/meta.ts b/packages/jsts/src/rules/S6304/meta.ts index 4c203ff1d55..219d3c27c8f 100644 --- a/packages/jsts/src/rules/S6304/meta.ts +++ b/packages/jsts/src/rules/S6304/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Policies granting access to all resources of an account are security-sensitive', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6304/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6304'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-iam-all-resources-accessible'; diff --git a/packages/jsts/src/rules/S6308/meta.ts b/packages/jsts/src/rules/S6308/meta.ts index b0259730df5..ed9ea81d40e 100644 --- a/packages/jsts/src/rules/S6308/meta.ts +++ b/packages/jsts/src/rules/S6308/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using unencrypted Elasticsearch domains is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6308/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6308'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-opensearchservice-domain'; diff --git a/packages/jsts/src/rules/S6317/meta.ts b/packages/jsts/src/rules/S6317/meta.ts index 75aa0c7fda1..533cb83100f 100644 --- a/packages/jsts/src/rules/S6317/meta.ts +++ b/packages/jsts/src/rules/S6317/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'AWS IAM policies should limit the scope of permissions given', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6317/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6317'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-iam-privilege-escalation'; diff --git a/packages/jsts/src/rules/S6319/meta.ts b/packages/jsts/src/rules/S6319/meta.ts index 443b0c0c61b..ba475dfac31 100644 --- a/packages/jsts/src/rules/S6319/meta.ts +++ b/packages/jsts/src/rules/S6319/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using unencrypted SageMaker notebook instances is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6319/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6319'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-sagemaker-unencrypted-notebook'; diff --git a/packages/jsts/src/rules/S6321/meta.ts b/packages/jsts/src/rules/S6321/meta.ts index 08818cc84c6..32bf96ab986 100644 --- a/packages/jsts/src/rules/S6321/meta.ts +++ b/packages/jsts/src/rules/S6321/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Administration services access should be restricted to specific IP addresses', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6321/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6321'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-restricted-ip-admin-access'; diff --git a/packages/jsts/src/rules/S6323/meta.ts b/packages/jsts/src/rules/S6323/meta.ts index 86ef8b87d28..2e646bbe608 100644 --- a/packages/jsts/src/rules/S6323/meta.ts +++ b/packages/jsts/src/rules/S6323/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Alternation in regular expressions should not contain empty alternatives', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6323/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S6323'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-empty-alternatives'; diff --git a/packages/jsts/src/rules/S6324/meta.ts b/packages/jsts/src/rules/S6324/meta.ts index 1906fbb7b4e..9908ade9ba5 100644 --- a/packages/jsts/src/rules/S6324/meta.ts +++ b/packages/jsts/src/rules/S6324/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Regular expressions should not contain control characters', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6324/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S6324'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-control-regex'; diff --git a/packages/jsts/src/rules/S6325/index.ts b/packages/jsts/src/rules/S6325/index.ts new file mode 100644 index 00000000000..7114bbf3d93 --- /dev/null +++ b/packages/jsts/src/rules/S6325/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('prefer-regex-literals'); diff --git a/packages/jsts/src/rules/S6325/meta.ts b/packages/jsts/src/rules/S6325/meta.ts new file mode 100644 index 00000000000..4fed960a911 --- /dev/null +++ b/packages/jsts/src/rules/S6325/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'prefer-regex-literals'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6326/meta.ts b/packages/jsts/src/rules/S6326/meta.ts index 95668048f96..f69d4aaa722 100644 --- a/packages/jsts/src/rules/S6326/meta.ts +++ b/packages/jsts/src/rules/S6326/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Regular expressions should not contain multiple spaces', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6326/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6326'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-regex-spaces'; diff --git a/packages/jsts/src/rules/S6327/meta.ts b/packages/jsts/src/rules/S6327/meta.ts index 476baed8b62..213c723effc 100644 --- a/packages/jsts/src/rules/S6327/meta.ts +++ b/packages/jsts/src/rules/S6327/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using unencrypted SNS topics is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6327/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6327'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-sns-unencrypted-topics'; diff --git a/packages/jsts/src/rules/S6328/meta.ts b/packages/jsts/src/rules/S6328/meta.ts index 743b83b186f..fed3f6e6d37 100644 --- a/packages/jsts/src/rules/S6328/meta.ts +++ b/packages/jsts/src/rules/S6328/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Replacement strings should reference existing regular expression groups', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6328/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S6328'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'existing-groups'; diff --git a/packages/jsts/src/rules/S6329/meta.ts b/packages/jsts/src/rules/S6329/meta.ts index 6490f9d0dc1..8914f494141 100644 --- a/packages/jsts/src/rules/S6329/meta.ts +++ b/packages/jsts/src/rules/S6329/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Allowing public network access to cloud resources is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6329/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6329'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-ec2-rds-dms-public'; diff --git a/packages/jsts/src/rules/S6330/meta.ts b/packages/jsts/src/rules/S6330/meta.ts index 537117c3969..6dbe03276ea 100644 --- a/packages/jsts/src/rules/S6330/meta.ts +++ b/packages/jsts/src/rules/S6330/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using unencrypted SQS queues is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6330/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6330'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-sqs-unencrypted-queue'; diff --git a/packages/jsts/src/rules/S6331/meta.ts b/packages/jsts/src/rules/S6331/meta.ts index 848f8e5bead..5ef778e63ec 100644 --- a/packages/jsts/src/rules/S6331/meta.ts +++ b/packages/jsts/src/rules/S6331/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Regular expressions should not contain empty groups', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6331/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S6331'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-empty-group'; diff --git a/packages/jsts/src/rules/S6332/meta.ts b/packages/jsts/src/rules/S6332/meta.ts index daee71bf8da..e0515bad9ef 100644 --- a/packages/jsts/src/rules/S6332/meta.ts +++ b/packages/jsts/src/rules/S6332/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Using unencrypted EFS file systems is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6332/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6332'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-efs-unencrypted'; diff --git a/packages/jsts/src/rules/S6333/meta.ts b/packages/jsts/src/rules/S6333/meta.ts index ceeefce41e7..a4b1d2d849b 100644 --- a/packages/jsts/src/rules/S6333/meta.ts +++ b/packages/jsts/src/rules/S6333/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Creating public APIs is security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6333/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6333'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'aws-apigateway-public-api'; diff --git a/packages/jsts/src/rules/S6351/meta.ts b/packages/jsts/src/rules/S6351/meta.ts index a7c56c30f71..1797ae4cbc3 100644 --- a/packages/jsts/src/rules/S6351/meta.ts +++ b/packages/jsts/src/rules/S6351/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Regular expressions with the global flag should be used with caution', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6351/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6351'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'stateful-regex'; diff --git a/packages/jsts/src/rules/S6353/meta.ts b/packages/jsts/src/rules/S6353/meta.ts index a4b808f35cf..0f3f42a7cd4 100644 --- a/packages/jsts/src/rules/S6353/meta.ts +++ b/packages/jsts/src/rules/S6353/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Regular expression quantifiers and character classes should be used concisely', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6353/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S6353'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'concise-regex'; diff --git a/packages/jsts/src/rules/S6397/meta.ts b/packages/jsts/src/rules/S6397/meta.ts index 937eafd82b4..8ccedda9983 100644 --- a/packages/jsts/src/rules/S6397/meta.ts +++ b/packages/jsts/src/rules/S6397/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Character classes in regular expressions should not contain only one character', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6397/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S6397'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'single-char-in-character-classes'; diff --git a/packages/jsts/src/rules/S6418/meta.ts b/packages/jsts/src/rules/S6418/meta.ts index 0b79b76d815..de89c6c0265 100644 --- a/packages/jsts/src/rules/S6418/meta.ts +++ b/packages/jsts/src/rules/S6418/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Hard-coded secrets are security-sensitive', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6418/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6418'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-hardcoded-secrets'; diff --git a/packages/jsts/src/rules/S6426/meta.ts b/packages/jsts/src/rules/S6426/meta.ts index 6ff8324ed48..b56eb2a29c2 100644 --- a/packages/jsts/src/rules/S6426/meta.ts +++ b/packages/jsts/src/rules/S6426/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Exclusive tests should not be commited to version control', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6426/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6426'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-exclusive-tests'; diff --git a/packages/jsts/src/rules/S6435/index.ts b/packages/jsts/src/rules/S6435/index.ts new file mode 100644 index 00000000000..93820f4c5ed --- /dev/null +++ b/packages/jsts/src/rules/S6435/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['require-render-return']; diff --git a/packages/jsts/src/rules/S6435/meta.ts b/packages/jsts/src/rules/S6435/meta.ts new file mode 100644 index 00000000000..f0fb8fafdd4 --- /dev/null +++ b/packages/jsts/src/rules/S6435/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'require-render-return'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6438/index.ts b/packages/jsts/src/rules/S6438/index.ts new file mode 100644 index 00000000000..6b6f33c11d2 --- /dev/null +++ b/packages/jsts/src/rules/S6438/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['jsx-no-comment-textnodes']; diff --git a/packages/jsts/src/rules/S6438/meta.ts b/packages/jsts/src/rules/S6438/meta.ts new file mode 100644 index 00000000000..478d8f257cb --- /dev/null +++ b/packages/jsts/src/rules/S6438/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'jsx-no-comment-textnodes'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6439/meta.ts b/packages/jsts/src/rules/S6439/meta.ts index 6a4eccf1e1b..a2985c90400 100644 --- a/packages/jsts/src/rules/S6439/meta.ts +++ b/packages/jsts/src/rules/S6439/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'React components should not render non-boolean condition values', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6439/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6439'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'jsx-no-leaked-render'; diff --git a/packages/jsts/src/rules/S6440/meta.ts b/packages/jsts/src/rules/S6440/meta.ts index 4457e6bda11..875567de408 100644 --- a/packages/jsts/src/rules/S6440/meta.ts +++ b/packages/jsts/src/rules/S6440/meta.ts @@ -14,16 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'React Hooks should be properly called', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6440/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6440'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'rules-of-hooks'; +export const externalRules = [{ externalPlugin: 'react-hooks', externalRule: 'rules-of-hooks' }]; diff --git a/packages/jsts/src/rules/S6441/meta.ts b/packages/jsts/src/rules/S6441/meta.ts index f0979f3333a..c357e143a43 100644 --- a/packages/jsts/src/rules/S6441/meta.ts +++ b/packages/jsts/src/rules/S6441/meta.ts @@ -14,16 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Unused methods of React components should be removed', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6441/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6441'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-unused-class-component-methods'; +export const externalRules = [ + { externalPlugin: 'react', externalRule: 'no-unused-class-component-methods' }, +]; diff --git a/packages/jsts/src/rules/S6441/rule.ts b/packages/jsts/src/rules/S6441/rule.ts index 35293a7b206..526a74de2d1 100644 --- a/packages/jsts/src/rules/S6441/rule.ts +++ b/packages/jsts/src/rules/S6441/rule.ts @@ -17,12 +17,11 @@ // https://sonarsource.github.io/rspec/#/rspec/S6441/javascript import type { Rule } from 'eslint'; -import pkg from 'eslint-plugin-react'; -const { rules: reactRules } = pkg; +import { rules } from '../external/react.js'; import { detectReactRule, generateMeta, mergeRules } from '../helpers/index.js'; import { meta } from './meta.js'; -const noUnusedClassComponentMethod = reactRules['no-unused-class-component-methods']; +const noUnusedClassComponentMethod = rules['no-unused-class-component-methods']; function overrideContext(context: Rule.RuleContext, overrides: any): Rule.RuleContext { Object.setPrototypeOf(overrides, context); diff --git a/packages/jsts/src/rules/S6442/meta.ts b/packages/jsts/src/rules/S6442/meta.ts index 0d2e9494f57..6f1dc9f8129 100644 --- a/packages/jsts/src/rules/S6442/meta.ts +++ b/packages/jsts/src/rules/S6442/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: - "React's useState hook should not be used directly in the render function or body of a component", - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6442/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6442'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-hook-setter-in-body'; diff --git a/packages/jsts/src/rules/S6442/rule.ts b/packages/jsts/src/rules/S6442/rule.ts index 1a842659bae..a9d73fcf1d0 100644 --- a/packages/jsts/src/rules/S6442/rule.ts +++ b/packages/jsts/src/rules/S6442/rule.ts @@ -26,7 +26,7 @@ import { isFunctionNode, isIdentifier, } from '../helpers/index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; type HookDeclarator = estree.VariableDeclarator & { diff --git a/packages/jsts/src/rules/S6443/meta.ts b/packages/jsts/src/rules/S6443/meta.ts index 811a647abb8..ccd2d85a0ac 100644 --- a/packages/jsts/src/rules/S6443/meta.ts +++ b/packages/jsts/src/rules/S6443/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: - 'React state setter function should not be called with its matching state variable', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6443/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6443'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-useless-react-setstate'; diff --git a/packages/jsts/src/rules/S6477/decorator.ts b/packages/jsts/src/rules/S6477/decorator.ts index 6fb9175bf18..d19485c1779 100644 --- a/packages/jsts/src/rules/S6477/decorator.ts +++ b/packages/jsts/src/rules/S6477/decorator.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import type { Rule } from 'eslint'; import { generateMeta, interceptReportForReact } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S6477/meta.ts b/packages/jsts/src/rules/S6477/meta.ts index 82da340ca8e..931d3225475 100644 --- a/packages/jsts/src/rules/S6477/meta.ts +++ b/packages/jsts/src/rules/S6477/meta.ts @@ -14,16 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'JSX list components should have a key property', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6477/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6477'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'jsx-key'; +export const externalRules = [{ externalPlugin: 'react', externalRule: 'jsx-key' }]; diff --git a/packages/jsts/src/rules/S6477/rule.ts b/packages/jsts/src/rules/S6477/rule.ts index 749a5b6d902..3d03b2679a4 100644 --- a/packages/jsts/src/rules/S6477/rule.ts +++ b/packages/jsts/src/rules/S6477/rule.ts @@ -17,8 +17,7 @@ // https://sonarsource.github.io/rspec/#/rspec/S6477/javascript import type { Rule } from 'eslint'; -import pkg from 'eslint-plugin-react'; -const { rules } = pkg; +import { rules } from '../external/react.js'; import { generateMeta, getDependencies } from '../helpers/index.js'; import { decorate } from './decorator.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S6478/decorator.ts b/packages/jsts/src/rules/S6478/decorator.ts index 4dc6bd88961..429edbf6bb1 100644 --- a/packages/jsts/src/rules/S6478/decorator.ts +++ b/packages/jsts/src/rules/S6478/decorator.ts @@ -25,7 +25,7 @@ import { interceptReportForReact, RuleContext, } from '../helpers/index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; export function decorate(rule: Rule.RuleModule): Rule.RuleModule { diff --git a/packages/jsts/src/rules/S6478/index.ts b/packages/jsts/src/rules/S6478/index.ts index 0e15047a5b8..c485dcd2cd6 100644 --- a/packages/jsts/src/rules/S6478/index.ts +++ b/packages/jsts/src/rules/S6478/index.ts @@ -14,8 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import pkg from 'eslint-plugin-react'; -const { rules } = pkg; +import { rules } from '../external/react.js'; import { decorate } from './decorator.js'; export const rule = decorate(rules['no-unstable-nested-components']); diff --git a/packages/jsts/src/rules/S6478/meta.ts b/packages/jsts/src/rules/S6478/meta.ts index 6b04a7f0ebf..687b1f80424 100644 --- a/packages/jsts/src/rules/S6478/meta.ts +++ b/packages/jsts/src/rules/S6478/meta.ts @@ -14,16 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'React components should not be nested', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6478/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6478'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-unstable-nested-components'; +export const externalRules = [ + { externalPlugin: 'react', externalRule: 'no-unstable-nested-components' }, +]; diff --git a/packages/jsts/src/rules/S6479/meta.ts b/packages/jsts/src/rules/S6479/meta.ts index 4f2b37d81eb..f552b9b498d 100644 --- a/packages/jsts/src/rules/S6479/meta.ts +++ b/packages/jsts/src/rules/S6479/meta.ts @@ -14,16 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'JSX list components should not use array indexes as key', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6479/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6479'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-array-index-key'; +export const externalRules = [{ externalPlugin: 'react', externalRule: 'no-array-index-key' }]; diff --git a/packages/jsts/src/rules/S6479/rule.ts b/packages/jsts/src/rules/S6479/rule.ts index 23077df3640..ecc480fb1bd 100644 --- a/packages/jsts/src/rules/S6479/rule.ts +++ b/packages/jsts/src/rules/S6479/rule.ts @@ -19,8 +19,7 @@ // inspired from `no-array-index` from `eslint-plugin-react`: // https://github.com/jsx-eslint/eslint-plugin-react/blob/0a2f6b7e9df32215fcd4e3061ec69ea3f2eef793/lib/rules/no-array-index-key.js#L16 -import pkg from 'eslint-plugin-react'; -const { rules } = pkg; +import { rules } from '../external/react.js'; import { generateMeta, interceptReportForReact } from '../helpers/index.js'; import type { Rule } from 'eslint'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S6480/index.ts b/packages/jsts/src/rules/S6480/index.ts new file mode 100644 index 00000000000..1db1c3cdb09 --- /dev/null +++ b/packages/jsts/src/rules/S6480/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['jsx-no-bind']; diff --git a/packages/jsts/src/rules/S6480/meta.ts b/packages/jsts/src/rules/S6480/meta.ts new file mode 100644 index 00000000000..99e33f891eb --- /dev/null +++ b/packages/jsts/src/rules/S6480/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'jsx-no-bind'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6481/index.ts b/packages/jsts/src/rules/S6481/index.ts index 5fde8a446d7..4791c9cc512 100644 --- a/packages/jsts/src/rules/S6481/index.ts +++ b/packages/jsts/src/rules/S6481/index.ts @@ -14,8 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import pkg from 'eslint-plugin-react'; -const { rules } = pkg; +import { rules } from '../external/react.js'; import { decorate } from './decorator.js'; export const rule = decorate(rules['jsx-no-constructed-context-values']); diff --git a/packages/jsts/src/rules/S6481/meta.ts b/packages/jsts/src/rules/S6481/meta.ts index 01bfa515b72..45e24686c7a 100644 --- a/packages/jsts/src/rules/S6481/meta.ts +++ b/packages/jsts/src/rules/S6481/meta.ts @@ -14,16 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'React Context Provider values should have stable identities', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6481/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6481'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'jsx-no-constructed-context-values'; +export const externalRules = [ + { externalPlugin: 'react', externalRule: 'jsx-no-constructed-context-values' }, +]; diff --git a/packages/jsts/src/rules/S6486/meta.ts b/packages/jsts/src/rules/S6486/meta.ts index 662e46445c2..ad7569b9c97 100644 --- a/packages/jsts/src/rules/S6486/meta.ts +++ b/packages/jsts/src/rules/S6486/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'JSX list components keys should match up between renders', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6486/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6486'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-uniq-key'; diff --git a/packages/jsts/src/rules/S6486/rule.ts b/packages/jsts/src/rules/S6486/rule.ts index f4cbda881dc..7f9361d52e4 100644 --- a/packages/jsts/src/rules/S6486/rule.ts +++ b/packages/jsts/src/rules/S6486/rule.ts @@ -21,7 +21,7 @@ import type { Rule } from 'eslint'; import { generateMeta, isMemberExpression } from '../helpers/index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import estree from 'estree'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S6509/index.ts b/packages/jsts/src/rules/S6509/index.ts new file mode 100644 index 00000000000..4efdbf5dadd --- /dev/null +++ b/packages/jsts/src/rules/S6509/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-extra-boolean-cast'); diff --git a/packages/jsts/src/rules/S6509/meta.ts b/packages/jsts/src/rules/S6509/meta.ts new file mode 100644 index 00000000000..48a5e4b6725 --- /dev/null +++ b/packages/jsts/src/rules/S6509/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-extra-boolean-cast'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6522/index.ts b/packages/jsts/src/rules/S6522/index.ts new file mode 100644 index 00000000000..acd56d381bf --- /dev/null +++ b/packages/jsts/src/rules/S6522/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-import-assign'); diff --git a/packages/jsts/src/rules/S6522/meta.ts b/packages/jsts/src/rules/S6522/meta.ts new file mode 100644 index 00000000000..50c60abb553 --- /dev/null +++ b/packages/jsts/src/rules/S6522/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-import-assign'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6523/index.ts b/packages/jsts/src/rules/S6523/index.ts new file mode 100644 index 00000000000..50e6f9efa59 --- /dev/null +++ b/packages/jsts/src/rules/S6523/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-unsafe-optional-chaining'); diff --git a/packages/jsts/src/rules/S6523/meta.ts b/packages/jsts/src/rules/S6523/meta.ts new file mode 100644 index 00000000000..0a5e1cdd070 --- /dev/null +++ b/packages/jsts/src/rules/S6523/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-unsafe-optional-chaining'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6534/index.ts b/packages/jsts/src/rules/S6534/index.ts new file mode 100644 index 00000000000..45157755d8e --- /dev/null +++ b/packages/jsts/src/rules/S6534/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-loss-of-precision'); diff --git a/packages/jsts/src/rules/S6534/meta.ts b/packages/jsts/src/rules/S6534/meta.ts new file mode 100644 index 00000000000..5728a061e30 --- /dev/null +++ b/packages/jsts/src/rules/S6534/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-loss-of-precision'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6535/meta.ts b/packages/jsts/src/rules/S6535/meta.ts index e8469515f70..b15c6a8bafe 100644 --- a/packages/jsts/src/rules/S6535/meta.ts +++ b/packages/jsts/src/rules/S6535/meta.ts @@ -14,17 +14,10 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Unnecessary character escapes should be removed', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6535/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6535'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'unnecessary-character-escapes'; +export const externalRules = [ + { externalPlugin: 'eslint', externalRule: 'no-useless-escape' }, + { externalPlugin: 'eslint', externalRule: 'no-nonoctal-decimal-escape' }, +]; diff --git a/packages/jsts/src/rules/S6535/rule.ts b/packages/jsts/src/rules/S6535/rule.ts index 00250f34914..3ccc344a740 100644 --- a/packages/jsts/src/rules/S6535/rule.ts +++ b/packages/jsts/src/rules/S6535/rule.ts @@ -17,7 +17,7 @@ // https://sonarsource.github.io/rspec/#/rspec/S6535/javascript import type { Rule } from 'eslint'; -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { generateMeta, interceptReport, mergeRules } from '../helpers/index.js'; import { meta } from './meta.js'; @@ -29,8 +29,8 @@ import { meta } from './meta.js'; * * Here we arbitrarily choose to decorate 'no-nonoctal-decimal-escape'. */ -const noUselessEscapeRule = eslintRules['no-useless-escape']; -const noNonoctalDecimalEscapeRule = eslintRules['no-nonoctal-decimal-escape']; +const noUselessEscapeRule = getESLintCoreRule('no-useless-escape'); +const noNonoctalDecimalEscapeRule = getESLintCoreRule('no-nonoctal-decimal-escape'); /** * We decorate 'no-nonoctal-decimal-escape' to map suggestions with the message id 'escapeBackslash' to 'nonOctalEscapeBacklash'. diff --git a/packages/jsts/src/rules/S6544/meta.ts b/packages/jsts/src/rules/S6544/meta.ts index 33c65139dea..97c64224d2c 100644 --- a/packages/jsts/src/rules/S6544/meta.ts +++ b/packages/jsts/src/rules/S6544/meta.ts @@ -14,16 +14,10 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Promises should not be misused', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6544/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S6544'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-misused-promises'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'no-misused-promises' }, + { externalPlugin: 'eslint', externalRule: 'no-async-promise-executor' }, +]; diff --git a/packages/jsts/src/rules/S6544/rule.ts b/packages/jsts/src/rules/S6544/rule.ts index 42ba496019f..c017ed51b97 100644 --- a/packages/jsts/src/rules/S6544/rule.ts +++ b/packages/jsts/src/rules/S6544/rule.ts @@ -17,8 +17,8 @@ // https://sonarsource.github.io/rspec/#/rspec/S6544/javascript import type { Rule } from 'eslint'; -import { tsEslintRules } from '../typescript-eslint/index.js'; -import { eslintRules } from '../core/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { FUNCTION_NODES, generateMeta, @@ -27,7 +27,7 @@ import { mergeRules, RuleContext, } from '../helpers/index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; /** @@ -65,7 +65,7 @@ const decoratedNoMisusedPromisesRule = interceptReport( }, ); -const noAsyncPromiseExecutorRule = eslintRules['no-async-promise-executor']; +const noAsyncPromiseExecutorRule = getESLintCoreRule('no-async-promise-executor'); const decoratedNoAsyncPromiseExecutorRule = interceptReport( noAsyncPromiseExecutorRule, (context, descriptor) => { diff --git a/packages/jsts/src/rules/S6550/index.ts b/packages/jsts/src/rules/S6550/index.ts new file mode 100644 index 00000000000..c88639fb403 --- /dev/null +++ b/packages/jsts/src/rules/S6550/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['prefer-literal-enum-member']; diff --git a/packages/jsts/src/rules/S6550/meta.ts b/packages/jsts/src/rules/S6550/meta.ts new file mode 100644 index 00000000000..c355552120e --- /dev/null +++ b/packages/jsts/src/rules/S6550/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'prefer-literal-enum-member'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S6551/decorator.ts b/packages/jsts/src/rules/S6551/decorator.ts index 06dce40b86d..ed95eef1a00 100644 --- a/packages/jsts/src/rules/S6551/decorator.ts +++ b/packages/jsts/src/rules/S6551/decorator.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S6551/javascript -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import type { Rule } from 'eslint'; import { generateMeta, interceptReport, isGenericType } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S6551/index.ts b/packages/jsts/src/rules/S6551/index.ts index 97eff08ad00..3a65d08efa2 100644 --- a/packages/jsts/src/rules/S6551/index.ts +++ b/packages/jsts/src/rules/S6551/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(tsEslintRules['no-base-to-string']); diff --git a/packages/jsts/src/rules/S6551/meta.ts b/packages/jsts/src/rules/S6551/meta.ts index f5938147d46..2162c57a875 100644 --- a/packages/jsts/src/rules/S6551/meta.ts +++ b/packages/jsts/src/rules/S6551/meta.ts @@ -14,17 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: - 'Objects and classes converted or coerced to strings should define a "toString()" method', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6551/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S6551'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-base-to-string'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'no-base-to-string' }, +]; diff --git a/packages/jsts/src/rules/S6557/index.ts b/packages/jsts/src/rules/S6557/index.ts index 26d26d4971e..22217a29843 100644 --- a/packages/jsts/src/rules/S6557/index.ts +++ b/packages/jsts/src/rules/S6557/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(tsEslintRules['prefer-string-starts-ends-with']); diff --git a/packages/jsts/src/rules/S6557/meta.ts b/packages/jsts/src/rules/S6557/meta.ts index 68b85714021..acae033bb8a 100644 --- a/packages/jsts/src/rules/S6557/meta.ts +++ b/packages/jsts/src/rules/S6557/meta.ts @@ -14,17 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Ends of strings should be checked with "startsWith()" and "endsWith()"', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6557/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6557'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'prefer-string-starts-ends-with'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'prefer-string-starts-ends-with' }, +]; diff --git a/packages/jsts/src/rules/S6564/meta.ts b/packages/jsts/src/rules/S6564/meta.ts index 0fee86fe066..ed6fc729751 100644 --- a/packages/jsts/src/rules/S6564/meta.ts +++ b/packages/jsts/src/rules/S6564/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Redundant type aliases should not be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6564/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6564'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'redundant-type-aliases'; diff --git a/packages/jsts/src/rules/S6564/rule.ts b/packages/jsts/src/rules/S6564/rule.ts index 4847787765a..7b290468556 100644 --- a/packages/jsts/src/rules/S6564/rule.ts +++ b/packages/jsts/src/rules/S6564/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, isTypeAlias } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S6565/index.ts b/packages/jsts/src/rules/S6565/index.ts new file mode 100644 index 00000000000..439334e5e18 --- /dev/null +++ b/packages/jsts/src/rules/S6565/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['prefer-return-this-type']; diff --git a/packages/jsts/src/rules/S6565/meta.ts b/packages/jsts/src/rules/S6565/meta.ts new file mode 100644 index 00000000000..6a34a84bac0 --- /dev/null +++ b/packages/jsts/src/rules/S6565/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'prefer-return-this-type'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S6568/index.ts b/packages/jsts/src/rules/S6568/index.ts new file mode 100644 index 00000000000..e16680510a6 --- /dev/null +++ b/packages/jsts/src/rules/S6568/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['no-confusing-non-null-assertion']; diff --git a/packages/jsts/src/rules/S6568/meta.ts b/packages/jsts/src/rules/S6568/meta.ts new file mode 100644 index 00000000000..19129d34bb8 --- /dev/null +++ b/packages/jsts/src/rules/S6568/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-confusing-non-null-assertion'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S6569/index.ts b/packages/jsts/src/rules/S6569/index.ts new file mode 100644 index 00000000000..63d61d0b1c7 --- /dev/null +++ b/packages/jsts/src/rules/S6569/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['no-unnecessary-type-constraint']; diff --git a/packages/jsts/src/rules/S6569/meta.ts b/packages/jsts/src/rules/S6569/meta.ts new file mode 100644 index 00000000000..ac44ba3ad83 --- /dev/null +++ b/packages/jsts/src/rules/S6569/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-unnecessary-type-constraint'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S6571/decorator.ts b/packages/jsts/src/rules/S6571/decorator.ts index 20e699344df..d9e75998db7 100644 --- a/packages/jsts/src/rules/S6571/decorator.ts +++ b/packages/jsts/src/rules/S6571/decorator.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import { generateMeta, interceptReport } from '../helpers/index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; export function decorate(rule: Rule.RuleModule): Rule.RuleModule { diff --git a/packages/jsts/src/rules/S6571/index.ts b/packages/jsts/src/rules/S6571/index.ts index 6bb5d1d40b5..fce182c9cc6 100644 --- a/packages/jsts/src/rules/S6571/index.ts +++ b/packages/jsts/src/rules/S6571/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(tsEslintRules['no-redundant-type-constituents']); diff --git a/packages/jsts/src/rules/S6571/meta.ts b/packages/jsts/src/rules/S6571/meta.ts index d01b3391d6a..8e2310f7628 100644 --- a/packages/jsts/src/rules/S6571/meta.ts +++ b/packages/jsts/src/rules/S6571/meta.ts @@ -14,16 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Type constituents of unions and intersections should not be redundant', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6571/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S6571'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-redundant-type-constituents'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'no-redundant-type-constituents' }, +]; diff --git a/packages/jsts/src/rules/S6572/meta.ts b/packages/jsts/src/rules/S6572/meta.ts index a566e34d55b..49c8baeb471 100644 --- a/packages/jsts/src/rules/S6572/meta.ts +++ b/packages/jsts/src/rules/S6572/meta.ts @@ -14,17 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Enum member values should be either all initialized or none', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6572/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6572'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'prefer-enum-initializers'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'prefer-enum-initializers' }, +]; diff --git a/packages/jsts/src/rules/S6572/rule.ts b/packages/jsts/src/rules/S6572/rule.ts index 9723feb05de..d810a47aa12 100644 --- a/packages/jsts/src/rules/S6572/rule.ts +++ b/packages/jsts/src/rules/S6572/rule.ts @@ -18,11 +18,11 @@ import estree from 'estree'; import type { Rule } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, isNumberLiteral } from '../helpers/index.js'; import { meta } from './meta.js'; -import { tsEslintRules } from '../typescript-eslint/index.js'; -const baseRuleModule = tsEslintRules['prefer-enum-initializers']; +import { rules } from '../external/typescript-eslint/index.js'; +const baseRuleModule = rules['prefer-enum-initializers']; // The core implementation of this rule reports all enums for which there is a member value that is // not initialized explicitly. Here, the decorator's purpose is to restrict the scope of the rule only diff --git a/packages/jsts/src/rules/S6578/index.ts b/packages/jsts/src/rules/S6578/index.ts new file mode 100644 index 00000000000..596410bbe2f --- /dev/null +++ b/packages/jsts/src/rules/S6578/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['no-duplicate-enum-values']; diff --git a/packages/jsts/src/rules/S6578/meta.ts b/packages/jsts/src/rules/S6578/meta.ts new file mode 100644 index 00000000000..d4d8b035af9 --- /dev/null +++ b/packages/jsts/src/rules/S6578/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-duplicate-enum-values'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S6582/meta.ts b/packages/jsts/src/rules/S6582/meta.ts index e90b35665cb..7aa9d5de154 100644 --- a/packages/jsts/src/rules/S6582/meta.ts +++ b/packages/jsts/src/rules/S6582/meta.ts @@ -14,16 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Optional chaining should be preferred', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6582/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6582'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'prefer-optional-chain'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'prefer-optional-chain' }, +]; diff --git a/packages/jsts/src/rules/S6582/rule.ts b/packages/jsts/src/rules/S6582/rule.ts index f88677d7cd7..2fbf6b8dcb7 100644 --- a/packages/jsts/src/rules/S6582/rule.ts +++ b/packages/jsts/src/rules/S6582/rule.ts @@ -17,7 +17,7 @@ // https://sonarsource.github.io/rspec/#/rspec/S6582/javascript import type { Rule } from 'eslint'; -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { generateMeta } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S6583/index.ts b/packages/jsts/src/rules/S6583/index.ts new file mode 100644 index 00000000000..6b12f36fc93 --- /dev/null +++ b/packages/jsts/src/rules/S6583/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['no-mixed-enums']; diff --git a/packages/jsts/src/rules/S6583/meta.ts b/packages/jsts/src/rules/S6583/meta.ts new file mode 100644 index 00000000000..c899cce38ef --- /dev/null +++ b/packages/jsts/src/rules/S6583/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-mixed-enums'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S6590/index.ts b/packages/jsts/src/rules/S6590/index.ts new file mode 100644 index 00000000000..295464aade7 --- /dev/null +++ b/packages/jsts/src/rules/S6590/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['prefer-as-const']; diff --git a/packages/jsts/src/rules/S6590/meta.ts b/packages/jsts/src/rules/S6590/meta.ts new file mode 100644 index 00000000000..00bfc2ad395 --- /dev/null +++ b/packages/jsts/src/rules/S6590/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'prefer-as-const'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S6594/meta.ts b/packages/jsts/src/rules/S6594/meta.ts index 80a4c97f1e5..d6c98cc89d0 100644 --- a/packages/jsts/src/rules/S6594/meta.ts +++ b/packages/jsts/src/rules/S6594/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"RegExp.exec()" should be preferred over "String.match()"', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6594/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6594'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'prefer-regexp-exec'; diff --git a/packages/jsts/src/rules/S6598/index.ts b/packages/jsts/src/rules/S6598/index.ts index 2e97d6f6644..52b22dd1d9b 100644 --- a/packages/jsts/src/rules/S6598/index.ts +++ b/packages/jsts/src/rules/S6598/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(tsEslintRules['prefer-function-type']); diff --git a/packages/jsts/src/rules/S6598/meta.ts b/packages/jsts/src/rules/S6598/meta.ts index 9c2ad884e6f..61a8193da55 100644 --- a/packages/jsts/src/rules/S6598/meta.ts +++ b/packages/jsts/src/rules/S6598/meta.ts @@ -14,17 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Function types should be preferred', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6598/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6598'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'prefer-function-type'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'prefer-function-type' }, +]; diff --git a/packages/jsts/src/rules/S6606/meta.ts b/packages/jsts/src/rules/S6606/meta.ts index e533f181fc2..64b07c696c9 100644 --- a/packages/jsts/src/rules/S6606/meta.ts +++ b/packages/jsts/src/rules/S6606/meta.ts @@ -14,17 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Nullish coalescing should be preferred', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6606/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6606'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'prefer-nullish-coalescing'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'prefer-nullish-coalescing' }, +]; diff --git a/packages/jsts/src/rules/S6606/rule.ts b/packages/jsts/src/rules/S6606/rule.ts index f1d8f6254e3..95cd2ff0d9f 100644 --- a/packages/jsts/src/rules/S6606/rule.ts +++ b/packages/jsts/src/rules/S6606/rule.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules } from '../external/typescript-eslint/index.js'; import { type Rule } from 'eslint'; import { generateMeta, @@ -27,7 +27,7 @@ import { import { type LogicalExpression } from 'estree'; import { meta } from './meta.js'; -const preferNullishCoalescingRule = tsEslintRules['prefer-nullish-coalescing']; +const preferNullishCoalescingRule = rules['prefer-nullish-coalescing']; export const rule = interceptReport( { diff --git a/packages/jsts/src/rules/S6627/meta.ts b/packages/jsts/src/rules/S6627/meta.ts index a8fe54b7509..490f15541ba 100644 --- a/packages/jsts/src/rules/S6627/meta.ts +++ b/packages/jsts/src/rules/S6627/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Users should not use internal APIs', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6627/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6627'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-internal-api-use'; diff --git a/packages/jsts/src/rules/S6635/index.ts b/packages/jsts/src/rules/S6635/index.ts new file mode 100644 index 00000000000..c450862104c --- /dev/null +++ b/packages/jsts/src/rules/S6635/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-constructor-return'); diff --git a/packages/jsts/src/rules/S6635/meta.ts b/packages/jsts/src/rules/S6635/meta.ts new file mode 100644 index 00000000000..c6dc129157b --- /dev/null +++ b/packages/jsts/src/rules/S6635/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-constructor-return'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6637/index.ts b/packages/jsts/src/rules/S6637/index.ts new file mode 100644 index 00000000000..530110311c0 --- /dev/null +++ b/packages/jsts/src/rules/S6637/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-extra-bind'); diff --git a/packages/jsts/src/rules/S6637/meta.ts b/packages/jsts/src/rules/S6637/meta.ts new file mode 100644 index 00000000000..1a679b46415 --- /dev/null +++ b/packages/jsts/src/rules/S6637/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-extra-bind'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6638/index.ts b/packages/jsts/src/rules/S6638/index.ts new file mode 100644 index 00000000000..c3a56ded73b --- /dev/null +++ b/packages/jsts/src/rules/S6638/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-constant-binary-expression'); diff --git a/packages/jsts/src/rules/S6638/meta.ts b/packages/jsts/src/rules/S6638/meta.ts new file mode 100644 index 00000000000..16865e8dd46 --- /dev/null +++ b/packages/jsts/src/rules/S6638/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-constant-binary-expression'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6643/index.ts b/packages/jsts/src/rules/S6643/index.ts index 68fa33440ab..beed5485630 100644 --- a/packages/jsts/src/rules/S6643/index.ts +++ b/packages/jsts/src/rules/S6643/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['no-extend-native']); +export const rule = decorate(getESLintCoreRule('no-extend-native')); diff --git a/packages/jsts/src/rules/S6643/meta.ts b/packages/jsts/src/rules/S6643/meta.ts index 7f26267d70c..5bd214428f4 100644 --- a/packages/jsts/src/rules/S6643/meta.ts +++ b/packages/jsts/src/rules/S6643/meta.ts @@ -14,16 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Prototypes of builtin objects should not be modified', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6643/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6643'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-extend-native'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'no-extend-native' }]; diff --git a/packages/jsts/src/rules/S6644/index.ts b/packages/jsts/src/rules/S6644/index.ts new file mode 100644 index 00000000000..780069dbaaf --- /dev/null +++ b/packages/jsts/src/rules/S6644/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-unneeded-ternary'); diff --git a/packages/jsts/src/rules/S6644/meta.ts b/packages/jsts/src/rules/S6644/meta.ts new file mode 100644 index 00000000000..218cf5fc4bc --- /dev/null +++ b/packages/jsts/src/rules/S6644/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-unneeded-ternary'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6645/index.ts b/packages/jsts/src/rules/S6645/index.ts new file mode 100644 index 00000000000..9bbdeef8602 --- /dev/null +++ b/packages/jsts/src/rules/S6645/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-undef-init'); diff --git a/packages/jsts/src/rules/S6645/meta.ts b/packages/jsts/src/rules/S6645/meta.ts new file mode 100644 index 00000000000..119f1f7cd19 --- /dev/null +++ b/packages/jsts/src/rules/S6645/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-undef-init'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6647/meta.ts b/packages/jsts/src/rules/S6647/meta.ts index 285ee59436c..f85a4b845de 100644 --- a/packages/jsts/src/rules/S6647/meta.ts +++ b/packages/jsts/src/rules/S6647/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Unnecessary constructors should be removed', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6647/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6647'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-useless-constructor'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'no-useless-constructor' }]; diff --git a/packages/jsts/src/rules/S6647/rule.ts b/packages/jsts/src/rules/S6647/rule.ts index 697dcac05f1..fed60dbef56 100644 --- a/packages/jsts/src/rules/S6647/rule.ts +++ b/packages/jsts/src/rules/S6647/rule.ts @@ -16,7 +16,7 @@ */ import type { TSESTree } from '@typescript-eslint/utils'; import type { Rule } from 'eslint'; -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; import { getVariableFromName } from '../helpers/index.js'; import type estree from 'estree'; @@ -93,7 +93,7 @@ function checkInheritance(node: TSESTree.MethodDefinition, context: Rule.RuleCon return true; } -const eslintNoUselessConstructor = eslintRules['no-useless-constructor']; +const eslintNoUselessConstructor = getESLintCoreRule('no-useless-constructor'); const originalRule: Rule.RuleModule = { meta: eslintNoUselessConstructor.meta, diff --git a/packages/jsts/src/rules/S6650/index.ts b/packages/jsts/src/rules/S6650/index.ts new file mode 100644 index 00000000000..d9871fbc51a --- /dev/null +++ b/packages/jsts/src/rules/S6650/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-useless-rename'); diff --git a/packages/jsts/src/rules/S6650/meta.ts b/packages/jsts/src/rules/S6650/meta.ts new file mode 100644 index 00000000000..308913e17ae --- /dev/null +++ b/packages/jsts/src/rules/S6650/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-useless-rename'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6653/index.ts b/packages/jsts/src/rules/S6653/index.ts new file mode 100644 index 00000000000..1898fb4e5cd --- /dev/null +++ b/packages/jsts/src/rules/S6653/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('prefer-object-has-own'); diff --git a/packages/jsts/src/rules/S6653/meta.ts b/packages/jsts/src/rules/S6653/meta.ts new file mode 100644 index 00000000000..4380e719768 --- /dev/null +++ b/packages/jsts/src/rules/S6653/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'prefer-object-has-own'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6654/index.ts b/packages/jsts/src/rules/S6654/index.ts new file mode 100644 index 00000000000..de1ce8b388f --- /dev/null +++ b/packages/jsts/src/rules/S6654/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-proto'); diff --git a/packages/jsts/src/rules/S6654/meta.ts b/packages/jsts/src/rules/S6654/meta.ts new file mode 100644 index 00000000000..a01b3ce7f82 --- /dev/null +++ b/packages/jsts/src/rules/S6654/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-proto'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6657/index.ts b/packages/jsts/src/rules/S6657/index.ts new file mode 100644 index 00000000000..df4640adc28 --- /dev/null +++ b/packages/jsts/src/rules/S6657/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-octal-escape'); diff --git a/packages/jsts/src/rules/S6657/meta.ts b/packages/jsts/src/rules/S6657/meta.ts new file mode 100644 index 00000000000..feda1919128 --- /dev/null +++ b/packages/jsts/src/rules/S6657/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-octal-escape'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6660/index.ts b/packages/jsts/src/rules/S6660/index.ts index 71aca24a297..e05e5a9af9c 100644 --- a/packages/jsts/src/rules/S6660/index.ts +++ b/packages/jsts/src/rules/S6660/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['no-lonely-if']); +export const rule = decorate(getESLintCoreRule('no-lonely-if')); diff --git a/packages/jsts/src/rules/S6660/meta.ts b/packages/jsts/src/rules/S6660/meta.ts index 713b14ed406..a9ab4bd8d8e 100644 --- a/packages/jsts/src/rules/S6660/meta.ts +++ b/packages/jsts/src/rules/S6660/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'If statements should not be the only statement in else blocks', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6660/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6660'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-lonely-if'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'no-lonely-if' }]; diff --git a/packages/jsts/src/rules/S6661/index.ts b/packages/jsts/src/rules/S6661/index.ts index 0310484d93e..88f6bbcb323 100644 --- a/packages/jsts/src/rules/S6661/index.ts +++ b/packages/jsts/src/rules/S6661/index.ts @@ -15,12 +15,12 @@ * along with this program; if not, see https://sonarsource.com/license/ssal/ */ import type { Rule } from 'eslint'; -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; import { dirname } from 'path/posix'; import { toUnixPath, isSupported } from '../helpers/index.js'; -const decorated = decorate(eslintRules['prefer-object-spread']); +const decorated = decorate(getESLintCoreRule('prefer-object-spread')); export const rule: Rule.RuleModule = { meta: decorated.meta, diff --git a/packages/jsts/src/rules/S6661/meta.ts b/packages/jsts/src/rules/S6661/meta.ts index 63231f80cbf..0a29805d1ed 100644 --- a/packages/jsts/src/rules/S6661/meta.ts +++ b/packages/jsts/src/rules/S6661/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Object spread syntax should be used instead of "Object.assign"', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6661/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6661'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'prefer-object-spread'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'prefer-object-spread' }]; diff --git a/packages/jsts/src/rules/S6666/index.ts b/packages/jsts/src/rules/S6666/index.ts index 9c010ac1619..b0249c6d5d5 100644 --- a/packages/jsts/src/rules/S6666/index.ts +++ b/packages/jsts/src/rules/S6666/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['prefer-spread']); +export const rule = decorate(getESLintCoreRule('prefer-spread')); diff --git a/packages/jsts/src/rules/S6666/meta.ts b/packages/jsts/src/rules/S6666/meta.ts index 25ee44b8214..869dd02a195 100644 --- a/packages/jsts/src/rules/S6666/meta.ts +++ b/packages/jsts/src/rules/S6666/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Spread syntax should be used instead of "apply()"', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6666/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6666'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'prefer-spread'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'prefer-spread' }]; diff --git a/packages/jsts/src/rules/S6671/index.ts b/packages/jsts/src/rules/S6671/index.ts new file mode 100644 index 00000000000..0aac7a2c991 --- /dev/null +++ b/packages/jsts/src/rules/S6671/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/typescript-eslint/index.js'; +export const rule = rules['prefer-promise-reject-errors']; diff --git a/packages/jsts/src/rules/S6671/meta.ts b/packages/jsts/src/rules/S6671/meta.ts new file mode 100644 index 00000000000..cadfd948801 --- /dev/null +++ b/packages/jsts/src/rules/S6671/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'prefer-promise-reject-errors'; +export const externalPlugin = 'typescript-eslint'; diff --git a/packages/jsts/src/rules/S6676/index.ts b/packages/jsts/src/rules/S6676/index.ts index f826e0d7a39..4f252b4e829 100644 --- a/packages/jsts/src/rules/S6676/index.ts +++ b/packages/jsts/src/rules/S6676/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['no-useless-call']); +export const rule = decorate(getESLintCoreRule('no-useless-call')); diff --git a/packages/jsts/src/rules/S6676/meta.ts b/packages/jsts/src/rules/S6676/meta.ts index 30491c042b4..a174533345d 100644 --- a/packages/jsts/src/rules/S6676/meta.ts +++ b/packages/jsts/src/rules/S6676/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Calls to ".call()" and ".apply()" methods should not be redundant', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6676/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6676'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-useless-call'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'no-useless-call' }]; diff --git a/packages/jsts/src/rules/S6679/index.ts b/packages/jsts/src/rules/S6679/index.ts index d5341029c54..23e51201e20 100644 --- a/packages/jsts/src/rules/S6679/index.ts +++ b/packages/jsts/src/rules/S6679/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { eslintRules } from '../core/index.js'; +import { getESLintCoreRule } from '../external/core.js'; import { decorate } from './decorator.js'; -export const rule = decorate(eslintRules['no-self-compare']); +export const rule = decorate(getESLintCoreRule('no-self-compare')); diff --git a/packages/jsts/src/rules/S6679/meta.ts b/packages/jsts/src/rules/S6679/meta.ts index eaf9af75f76..70bd3d428bd 100644 --- a/packages/jsts/src/rules/S6679/meta.ts +++ b/packages/jsts/src/rules/S6679/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: '"Number.isNaN()" should be used to check for "NaN" value', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6679/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6679'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-self-compare'; +export const externalRules = [{ externalPlugin: 'eslint', externalRule: 'no-self-compare' }]; diff --git a/packages/jsts/src/rules/S6746/index.ts b/packages/jsts/src/rules/S6746/index.ts new file mode 100644 index 00000000000..a8613cd754e --- /dev/null +++ b/packages/jsts/src/rules/S6746/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['no-direct-mutation-state']; diff --git a/packages/jsts/src/rules/S6746/meta.ts b/packages/jsts/src/rules/S6746/meta.ts new file mode 100644 index 00000000000..102e42dff94 --- /dev/null +++ b/packages/jsts/src/rules/S6746/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-direct-mutation-state'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6747/meta.ts b/packages/jsts/src/rules/S6747/meta.ts index 5ffda115e29..070fa5462ed 100644 --- a/packages/jsts/src/rules/S6747/meta.ts +++ b/packages/jsts/src/rules/S6747/meta.ts @@ -14,17 +14,10 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'JSX elements should not use unknown properties and attributes', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6747/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6747'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-unknown-property'; +export const externalRules = [ + { externalPlugin: 'react', externalRule: 'no-unknown-property' }, + { externalPlugin: 'jsx-a11y', externalRule: 'aria-props' }, +]; diff --git a/packages/jsts/src/rules/S6747/rule.ts b/packages/jsts/src/rules/S6747/rule.ts index a78d4d28f03..92c20d16f13 100644 --- a/packages/jsts/src/rules/S6747/rule.ts +++ b/packages/jsts/src/rules/S6747/rule.ts @@ -17,13 +17,11 @@ // https://sonarsource.github.io/rspec/#/rspec/S6747/javascript import type { Rule } from 'eslint'; -import pkg from 'eslint-plugin-react'; -const { rules: reactRules } = pkg; -import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'; -const { rules: jsxA11yRules } = jsxA11yPlugin; +import { rules as reactRules } from '../external/react.js'; +import { rules as jsxA11yRules } from '../external/a11y.js'; import { generateMeta, getDependencies, interceptReport, mergeRules } from '../helpers/index.js'; import { decorate } from './decorator.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; const noUnknownProp = reactRules['no-unknown-property']; diff --git a/packages/jsts/src/rules/S6748/index.ts b/packages/jsts/src/rules/S6748/index.ts new file mode 100644 index 00000000000..d5b2a1a8488 --- /dev/null +++ b/packages/jsts/src/rules/S6748/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['no-children-prop']; diff --git a/packages/jsts/src/rules/S6748/meta.ts b/packages/jsts/src/rules/S6748/meta.ts new file mode 100644 index 00000000000..0a67bc22d06 --- /dev/null +++ b/packages/jsts/src/rules/S6748/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-children-prop'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6749/index.ts b/packages/jsts/src/rules/S6749/index.ts index 4efeddd9da9..0582a956e67 100644 --- a/packages/jsts/src/rules/S6749/index.ts +++ b/packages/jsts/src/rules/S6749/index.ts @@ -14,8 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import pkg from 'eslint-plugin-react'; -const { rules } = pkg; +import { rules } from '../external/react.js'; import { decorate } from './decorator.js'; export const rule = decorate(rules['jsx-no-useless-fragment']); diff --git a/packages/jsts/src/rules/S6749/meta.ts b/packages/jsts/src/rules/S6749/meta.ts index e1492254f16..dac79f4c3ef 100644 --- a/packages/jsts/src/rules/S6749/meta.ts +++ b/packages/jsts/src/rules/S6749/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Redundant React fragments should be removed', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6749/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6749'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'jsx-no-useless-fragment'; +export const externalRules = [{ externalPlugin: 'react', externalRule: 'jsx-no-useless-fragment' }]; diff --git a/packages/jsts/src/rules/S6750/index.ts b/packages/jsts/src/rules/S6750/index.ts new file mode 100644 index 00000000000..c41eb40dbf4 --- /dev/null +++ b/packages/jsts/src/rules/S6750/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['no-render-return-value']; diff --git a/packages/jsts/src/rules/S6750/meta.ts b/packages/jsts/src/rules/S6750/meta.ts new file mode 100644 index 00000000000..e356b4b2160 --- /dev/null +++ b/packages/jsts/src/rules/S6750/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-render-return-value'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6754/index.ts b/packages/jsts/src/rules/S6754/index.ts index b88f06bc6b7..dfdb758b9bf 100644 --- a/packages/jsts/src/rules/S6754/index.ts +++ b/packages/jsts/src/rules/S6754/index.ts @@ -14,9 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import pkg from 'eslint-plugin-react'; -const { rules } = pkg; - +import { rules } from '../external/react.js'; import { decorate } from './decorator.js'; export const rule = decorate(rules['hook-use-state']); diff --git a/packages/jsts/src/rules/S6754/meta.ts b/packages/jsts/src/rules/S6754/meta.ts index 113c9c04e53..a1f7546b613 100644 --- a/packages/jsts/src/rules/S6754/meta.ts +++ b/packages/jsts/src/rules/S6754/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'The return value of "useState" should be destructured and named symmetrically', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6754/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6754'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'hook-use-state'; +export const externalRules = [{ externalPlugin: 'react', externalRule: 'hook-use-state' }]; diff --git a/packages/jsts/src/rules/S6756/index.ts b/packages/jsts/src/rules/S6756/index.ts new file mode 100644 index 00000000000..8f503cf8b64 --- /dev/null +++ b/packages/jsts/src/rules/S6756/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['no-access-state-in-setstate']; diff --git a/packages/jsts/src/rules/S6756/meta.ts b/packages/jsts/src/rules/S6756/meta.ts new file mode 100644 index 00000000000..d51f50f2f44 --- /dev/null +++ b/packages/jsts/src/rules/S6756/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-access-state-in-setstate'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6757/index.ts b/packages/jsts/src/rules/S6757/index.ts new file mode 100644 index 00000000000..2511aea6cef --- /dev/null +++ b/packages/jsts/src/rules/S6757/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['no-this-in-sfc']; diff --git a/packages/jsts/src/rules/S6757/meta.ts b/packages/jsts/src/rules/S6757/meta.ts new file mode 100644 index 00000000000..471d6610f42 --- /dev/null +++ b/packages/jsts/src/rules/S6757/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-this-in-sfc'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6759/meta.ts b/packages/jsts/src/rules/S6759/meta.ts index 0774d107da9..ea624522dce 100644 --- a/packages/jsts/src/rules/S6759/meta.ts +++ b/packages/jsts/src/rules/S6759/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'React props should be read-only', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6759/javascript', - requiresTypeChecking: true, - }, - fixable: 'code', -}; - -export const sonarKey = 'S6759'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'prefer-read-only-props'; diff --git a/packages/jsts/src/rules/S6759/rule.ts b/packages/jsts/src/rules/S6759/rule.ts index 24c05f5abf1..37b8015d364 100644 --- a/packages/jsts/src/rules/S6759/rule.ts +++ b/packages/jsts/src/rules/S6759/rule.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import { Function, Node, ReturnStatement } from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, getTypeFromTreeNode, diff --git a/packages/jsts/src/rules/S6761/index.ts b/packages/jsts/src/rules/S6761/index.ts new file mode 100644 index 00000000000..1c639b17e5b --- /dev/null +++ b/packages/jsts/src/rules/S6761/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['no-danger-with-children']; diff --git a/packages/jsts/src/rules/S6761/meta.ts b/packages/jsts/src/rules/S6761/meta.ts new file mode 100644 index 00000000000..4f738a0c818 --- /dev/null +++ b/packages/jsts/src/rules/S6761/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-danger-with-children'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6763/index.ts b/packages/jsts/src/rules/S6763/index.ts new file mode 100644 index 00000000000..f1390b257f3 --- /dev/null +++ b/packages/jsts/src/rules/S6763/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['no-redundant-should-component-update']; diff --git a/packages/jsts/src/rules/S6763/meta.ts b/packages/jsts/src/rules/S6763/meta.ts new file mode 100644 index 00000000000..5e4c203e3f1 --- /dev/null +++ b/packages/jsts/src/rules/S6763/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-redundant-should-component-update'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6766/index.ts b/packages/jsts/src/rules/S6766/index.ts new file mode 100644 index 00000000000..a2a59b904b8 --- /dev/null +++ b/packages/jsts/src/rules/S6766/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['no-unescaped-entities']; diff --git a/packages/jsts/src/rules/S6766/meta.ts b/packages/jsts/src/rules/S6766/meta.ts new file mode 100644 index 00000000000..8c0dc790996 --- /dev/null +++ b/packages/jsts/src/rules/S6766/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-unescaped-entities'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6767/index.ts b/packages/jsts/src/rules/S6767/index.ts new file mode 100644 index 00000000000..d4de52b95df --- /dev/null +++ b/packages/jsts/src/rules/S6767/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['no-unused-prop-types']; diff --git a/packages/jsts/src/rules/S6767/meta.ts b/packages/jsts/src/rules/S6767/meta.ts new file mode 100644 index 00000000000..d7dab08bc5d --- /dev/null +++ b/packages/jsts/src/rules/S6767/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-unused-prop-types'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6770/index.ts b/packages/jsts/src/rules/S6770/index.ts new file mode 100644 index 00000000000..f7e1d477392 --- /dev/null +++ b/packages/jsts/src/rules/S6770/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['jsx-pascal-case']; diff --git a/packages/jsts/src/rules/S6770/meta.ts b/packages/jsts/src/rules/S6770/meta.ts new file mode 100644 index 00000000000..cf9a4433962 --- /dev/null +++ b/packages/jsts/src/rules/S6770/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'jsx-pascal-case'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6772/index.ts b/packages/jsts/src/rules/S6772/index.ts new file mode 100644 index 00000000000..41e66e76178 --- /dev/null +++ b/packages/jsts/src/rules/S6772/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['jsx-child-element-spacing']; diff --git a/packages/jsts/src/rules/S6772/meta.ts b/packages/jsts/src/rules/S6772/meta.ts new file mode 100644 index 00000000000..2adeee7fbab --- /dev/null +++ b/packages/jsts/src/rules/S6772/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'jsx-child-element-spacing'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6774/index.ts b/packages/jsts/src/rules/S6774/index.ts new file mode 100644 index 00000000000..a882e656f47 --- /dev/null +++ b/packages/jsts/src/rules/S6774/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['prop-types']; diff --git a/packages/jsts/src/rules/S6774/meta.ts b/packages/jsts/src/rules/S6774/meta.ts new file mode 100644 index 00000000000..45f248181c1 --- /dev/null +++ b/packages/jsts/src/rules/S6774/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'prop-types'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6775/index.ts b/packages/jsts/src/rules/S6775/index.ts new file mode 100644 index 00000000000..9b119f64e75 --- /dev/null +++ b/packages/jsts/src/rules/S6775/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['default-props-match-prop-types']; diff --git a/packages/jsts/src/rules/S6775/meta.ts b/packages/jsts/src/rules/S6775/meta.ts new file mode 100644 index 00000000000..4f4b6535e25 --- /dev/null +++ b/packages/jsts/src/rules/S6775/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'default-props-match-prop-types'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6788/index.ts b/packages/jsts/src/rules/S6788/index.ts index 805cda6abe3..b35ea5ec1f3 100644 --- a/packages/jsts/src/rules/S6788/index.ts +++ b/packages/jsts/src/rules/S6788/index.ts @@ -14,8 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import pkg from 'eslint-plugin-react'; -const { rules } = pkg; +import { rules } from '../external/react.js'; import { decorate } from './decorator.js'; export const rule = decorate(rules['no-find-dom-node']); diff --git a/packages/jsts/src/rules/S6788/meta.ts b/packages/jsts/src/rules/S6788/meta.ts index 13b7e3f2d9d..d8f5a4d6d6c 100644 --- a/packages/jsts/src/rules/S6788/meta.ts +++ b/packages/jsts/src/rules/S6788/meta.ts @@ -14,16 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'React\'s "findDOMNode" should not be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6788/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6788'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-find-dom-node'; +export const externalRules = [{ externalPlugin: 'react', externalRule: 'no-find-dom-node' }]; diff --git a/packages/jsts/src/rules/S6789/index.ts b/packages/jsts/src/rules/S6789/index.ts new file mode 100644 index 00000000000..8f8e6d9210a --- /dev/null +++ b/packages/jsts/src/rules/S6789/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['no-is-mounted']; diff --git a/packages/jsts/src/rules/S6789/meta.ts b/packages/jsts/src/rules/S6789/meta.ts new file mode 100644 index 00000000000..948398334a6 --- /dev/null +++ b/packages/jsts/src/rules/S6789/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-is-mounted'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6790/index.ts b/packages/jsts/src/rules/S6790/index.ts new file mode 100644 index 00000000000..b75e1abf2cd --- /dev/null +++ b/packages/jsts/src/rules/S6790/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/react.js'; +export const rule = rules['no-string-refs']; diff --git a/packages/jsts/src/rules/S6790/meta.ts b/packages/jsts/src/rules/S6790/meta.ts new file mode 100644 index 00000000000..1151e9cbfa6 --- /dev/null +++ b/packages/jsts/src/rules/S6790/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-string-refs'; +export const externalPlugin = 'react'; diff --git a/packages/jsts/src/rules/S6791/index.ts b/packages/jsts/src/rules/S6791/index.ts index 716ba7dab4e..a1b4eee7347 100644 --- a/packages/jsts/src/rules/S6791/index.ts +++ b/packages/jsts/src/rules/S6791/index.ts @@ -14,8 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import pkg from 'eslint-plugin-react'; -const { rules } = pkg; +import { rules } from '../external/react.js'; import { decorate } from './decorator.js'; export const rule = decorate(rules['no-unsafe']); diff --git a/packages/jsts/src/rules/S6791/meta.ts b/packages/jsts/src/rules/S6791/meta.ts index 9ec558a88ec..6e201853f5d 100644 --- a/packages/jsts/src/rules/S6791/meta.ts +++ b/packages/jsts/src/rules/S6791/meta.ts @@ -14,16 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'React legacy lifecycle methods should not be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6791/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6791'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-unsafe'; +export const externalRules = [{ externalPlugin: 'react', externalRule: 'no-unsafe' }]; diff --git a/packages/jsts/src/rules/S6793/index.ts b/packages/jsts/src/rules/S6793/index.ts new file mode 100644 index 00000000000..a5ddfdeb6e3 --- /dev/null +++ b/packages/jsts/src/rules/S6793/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['aria-proptypes']; diff --git a/packages/jsts/src/rules/S6793/meta.ts b/packages/jsts/src/rules/S6793/meta.ts new file mode 100644 index 00000000000..37d54e3c6d4 --- /dev/null +++ b/packages/jsts/src/rules/S6793/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'aria-proptypes'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6807/index.ts b/packages/jsts/src/rules/S6807/index.ts new file mode 100644 index 00000000000..9501ccbe2c3 --- /dev/null +++ b/packages/jsts/src/rules/S6807/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['role-has-required-aria-props']; diff --git a/packages/jsts/src/rules/S6807/meta.ts b/packages/jsts/src/rules/S6807/meta.ts new file mode 100644 index 00000000000..6599f547680 --- /dev/null +++ b/packages/jsts/src/rules/S6807/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'role-has-required-aria-props'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6811/index.ts b/packages/jsts/src/rules/S6811/index.ts new file mode 100644 index 00000000000..2c93f4b1d48 --- /dev/null +++ b/packages/jsts/src/rules/S6811/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['role-supports-aria-props']; diff --git a/packages/jsts/src/rules/S6811/meta.ts b/packages/jsts/src/rules/S6811/meta.ts new file mode 100644 index 00000000000..6d9eb41890c --- /dev/null +++ b/packages/jsts/src/rules/S6811/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'role-supports-aria-props'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6819/index.ts b/packages/jsts/src/rules/S6819/index.ts new file mode 100644 index 00000000000..7928a2f034b --- /dev/null +++ b/packages/jsts/src/rules/S6819/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['prefer-tag-over-role']; diff --git a/packages/jsts/src/rules/S6819/meta.ts b/packages/jsts/src/rules/S6819/meta.ts new file mode 100644 index 00000000000..c7cff2b3678 --- /dev/null +++ b/packages/jsts/src/rules/S6819/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'prefer-tag-over-role'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6821/index.ts b/packages/jsts/src/rules/S6821/index.ts new file mode 100644 index 00000000000..1c42c768c6f --- /dev/null +++ b/packages/jsts/src/rules/S6821/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['aria-role']; diff --git a/packages/jsts/src/rules/S6821/meta.ts b/packages/jsts/src/rules/S6821/meta.ts new file mode 100644 index 00000000000..7b2e1e01e83 --- /dev/null +++ b/packages/jsts/src/rules/S6821/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'aria-role'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6822/index.ts b/packages/jsts/src/rules/S6822/index.ts new file mode 100644 index 00000000000..15d35f0a61b --- /dev/null +++ b/packages/jsts/src/rules/S6822/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['no-redundant-roles']; diff --git a/packages/jsts/src/rules/S6822/meta.ts b/packages/jsts/src/rules/S6822/meta.ts new file mode 100644 index 00000000000..9d09d97e461 --- /dev/null +++ b/packages/jsts/src/rules/S6822/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-redundant-roles'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6823/index.ts b/packages/jsts/src/rules/S6823/index.ts new file mode 100644 index 00000000000..5b5ab1264ac --- /dev/null +++ b/packages/jsts/src/rules/S6823/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['aria-activedescendant-has-tabindex']; diff --git a/packages/jsts/src/rules/S6823/meta.ts b/packages/jsts/src/rules/S6823/meta.ts new file mode 100644 index 00000000000..8c477909794 --- /dev/null +++ b/packages/jsts/src/rules/S6823/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'aria-activedescendant-has-tabindex'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6824/index.ts b/packages/jsts/src/rules/S6824/index.ts new file mode 100644 index 00000000000..c2f7cc95ca6 --- /dev/null +++ b/packages/jsts/src/rules/S6824/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['aria-unsupported-elements']; diff --git a/packages/jsts/src/rules/S6824/meta.ts b/packages/jsts/src/rules/S6824/meta.ts new file mode 100644 index 00000000000..f29c2469b5c --- /dev/null +++ b/packages/jsts/src/rules/S6824/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'aria-unsupported-elements'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6825/index.ts b/packages/jsts/src/rules/S6825/index.ts new file mode 100644 index 00000000000..3a206f63228 --- /dev/null +++ b/packages/jsts/src/rules/S6825/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['no-aria-hidden-on-focusable']; diff --git a/packages/jsts/src/rules/S6825/meta.ts b/packages/jsts/src/rules/S6825/meta.ts new file mode 100644 index 00000000000..8c72447aabc --- /dev/null +++ b/packages/jsts/src/rules/S6825/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-aria-hidden-on-focusable'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6827/decorator.ts b/packages/jsts/src/rules/S6827/decorator.ts index 9e0f3cbb560..990054957a2 100644 --- a/packages/jsts/src/rules/S6827/decorator.ts +++ b/packages/jsts/src/rules/S6827/decorator.ts @@ -18,7 +18,7 @@ import type { Rule } from 'eslint'; import { generateMeta, interceptReport } from '../helpers/index.js'; import pkg from 'jsx-ast-utils'; const { hasAnyProp } = pkg; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { meta } from './meta.js'; /** diff --git a/packages/jsts/src/rules/S6827/index.ts b/packages/jsts/src/rules/S6827/index.ts index adaf8f48dca..0cf053c47b8 100644 --- a/packages/jsts/src/rules/S6827/index.ts +++ b/packages/jsts/src/rules/S6827/index.ts @@ -16,8 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S6727/javascript -import pkg from 'eslint-plugin-jsx-a11y'; -const { rules: jsxA11yRules } = pkg; +import { rules } from '../external/a11y.js'; import { decorate } from './decorator.js'; -export const rule = decorate(jsxA11yRules['anchor-has-content']); +export const rule = decorate(rules['anchor-has-content']); diff --git a/packages/jsts/src/rules/S6827/meta.ts b/packages/jsts/src/rules/S6827/meta.ts index 7f5351ce57a..0eb99694796 100644 --- a/packages/jsts/src/rules/S6827/meta.ts +++ b/packages/jsts/src/rules/S6827/meta.ts @@ -14,16 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Anchors should contain accessible content', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6827/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6827'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'anchor-has-content'; +export const externalRules = [{ externalPlugin: 'jsx-a11y', externalRule: 'anchor-has-content' }]; diff --git a/packages/jsts/src/rules/S6836/index.ts b/packages/jsts/src/rules/S6836/index.ts new file mode 100644 index 00000000000..b96e01158a3 --- /dev/null +++ b/packages/jsts/src/rules/S6836/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-case-declarations'); diff --git a/packages/jsts/src/rules/S6836/meta.ts b/packages/jsts/src/rules/S6836/meta.ts new file mode 100644 index 00000000000..1ff040199ac --- /dev/null +++ b/packages/jsts/src/rules/S6836/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-case-declarations'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S6840/index.ts b/packages/jsts/src/rules/S6840/index.ts new file mode 100644 index 00000000000..1295d99924a --- /dev/null +++ b/packages/jsts/src/rules/S6840/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['autocomplete-valid']; diff --git a/packages/jsts/src/rules/S6840/meta.ts b/packages/jsts/src/rules/S6840/meta.ts new file mode 100644 index 00000000000..994c540d8a4 --- /dev/null +++ b/packages/jsts/src/rules/S6840/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'autocomplete-valid'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6841/index.ts b/packages/jsts/src/rules/S6841/index.ts new file mode 100644 index 00000000000..0662bbd4805 --- /dev/null +++ b/packages/jsts/src/rules/S6841/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['tabindex-no-positive']; diff --git a/packages/jsts/src/rules/S6841/meta.ts b/packages/jsts/src/rules/S6841/meta.ts new file mode 100644 index 00000000000..1d6648ce47f --- /dev/null +++ b/packages/jsts/src/rules/S6841/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'tabindex-no-positive'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6842/index.ts b/packages/jsts/src/rules/S6842/index.ts new file mode 100644 index 00000000000..05a1dc38325 --- /dev/null +++ b/packages/jsts/src/rules/S6842/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['no-noninteractive-element-to-interactive-role']; diff --git a/packages/jsts/src/rules/S6842/meta.ts b/packages/jsts/src/rules/S6842/meta.ts new file mode 100644 index 00000000000..d00a1b97183 --- /dev/null +++ b/packages/jsts/src/rules/S6842/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-noninteractive-element-to-interactive-role'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6843/index.ts b/packages/jsts/src/rules/S6843/index.ts new file mode 100644 index 00000000000..9d4ff02f2e3 --- /dev/null +++ b/packages/jsts/src/rules/S6843/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['no-interactive-element-to-noninteractive-role']; diff --git a/packages/jsts/src/rules/S6843/meta.ts b/packages/jsts/src/rules/S6843/meta.ts new file mode 100644 index 00000000000..928dce76208 --- /dev/null +++ b/packages/jsts/src/rules/S6843/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-interactive-element-to-noninteractive-role'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6844/meta.ts b/packages/jsts/src/rules/S6844/meta.ts index 84de99a2dfe..c5e19d51369 100644 --- a/packages/jsts/src/rules/S6844/meta.ts +++ b/packages/jsts/src/rules/S6844/meta.ts @@ -14,16 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Anchor tags should not be used as buttons', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6844/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6844'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'anchor-is-valid'; +export const externalRules = [{ externalPlugin: 'jsx-a11y', externalRule: 'anchor-is-valid' }]; diff --git a/packages/jsts/src/rules/S6844/rule.ts b/packages/jsts/src/rules/S6844/rule.ts index 153fef93f71..52f58172b8d 100644 --- a/packages/jsts/src/rules/S6844/rule.ts +++ b/packages/jsts/src/rules/S6844/rule.ts @@ -16,13 +16,12 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S6844/javascript -import pkg from 'eslint-plugin-jsx-a11y'; -const { rules: jsxA11yRules } = pkg; +import { rules } from '../external/a11y.js'; import { generateMeta, interceptReport } from '../helpers/index.js'; import { meta } from './meta.js'; import type { Rule } from 'eslint'; -const anchorIsValid = jsxA11yRules['anchor-is-valid']; +const anchorIsValid = rules['anchor-is-valid']; export const rule = interceptReport( { diff --git a/packages/jsts/src/rules/S6845/index.ts b/packages/jsts/src/rules/S6845/index.ts new file mode 100644 index 00000000000..ee2a76cf79a --- /dev/null +++ b/packages/jsts/src/rules/S6845/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['no-noninteractive-tabindex']; diff --git a/packages/jsts/src/rules/S6845/meta.ts b/packages/jsts/src/rules/S6845/meta.ts new file mode 100644 index 00000000000..d50018ad3f9 --- /dev/null +++ b/packages/jsts/src/rules/S6845/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-noninteractive-tabindex'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6846/index.ts b/packages/jsts/src/rules/S6846/index.ts new file mode 100644 index 00000000000..ea0c1435b61 --- /dev/null +++ b/packages/jsts/src/rules/S6846/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['no-access-key']; diff --git a/packages/jsts/src/rules/S6846/meta.ts b/packages/jsts/src/rules/S6846/meta.ts new file mode 100644 index 00000000000..e193dd9cc79 --- /dev/null +++ b/packages/jsts/src/rules/S6846/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-access-key'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6847/index.ts b/packages/jsts/src/rules/S6847/index.ts new file mode 100644 index 00000000000..665729586c1 --- /dev/null +++ b/packages/jsts/src/rules/S6847/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['no-noninteractive-element-interactions']; diff --git a/packages/jsts/src/rules/S6847/meta.ts b/packages/jsts/src/rules/S6847/meta.ts new file mode 100644 index 00000000000..11c2e4a4cec --- /dev/null +++ b/packages/jsts/src/rules/S6847/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-noninteractive-element-interactions'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6848/index.ts b/packages/jsts/src/rules/S6848/index.ts new file mode 100644 index 00000000000..546ac594824 --- /dev/null +++ b/packages/jsts/src/rules/S6848/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['no-static-element-interactions']; diff --git a/packages/jsts/src/rules/S6848/meta.ts b/packages/jsts/src/rules/S6848/meta.ts new file mode 100644 index 00000000000..3e9c8c4f4fb --- /dev/null +++ b/packages/jsts/src/rules/S6848/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-static-element-interactions'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6850/index.ts b/packages/jsts/src/rules/S6850/index.ts new file mode 100644 index 00000000000..0e170f88cf1 --- /dev/null +++ b/packages/jsts/src/rules/S6850/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['heading-has-content']; diff --git a/packages/jsts/src/rules/S6850/meta.ts b/packages/jsts/src/rules/S6850/meta.ts new file mode 100644 index 00000000000..125c76f8996 --- /dev/null +++ b/packages/jsts/src/rules/S6850/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'heading-has-content'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6851/index.ts b/packages/jsts/src/rules/S6851/index.ts new file mode 100644 index 00000000000..13e685c3c66 --- /dev/null +++ b/packages/jsts/src/rules/S6851/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['img-redundant-alt']; diff --git a/packages/jsts/src/rules/S6851/meta.ts b/packages/jsts/src/rules/S6851/meta.ts new file mode 100644 index 00000000000..d23dbf782e2 --- /dev/null +++ b/packages/jsts/src/rules/S6851/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'img-redundant-alt'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6852/index.ts b/packages/jsts/src/rules/S6852/index.ts new file mode 100644 index 00000000000..974928e76c3 --- /dev/null +++ b/packages/jsts/src/rules/S6852/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from '../external/a11y.js'; +export const rule = rules['interactive-supports-focus']; diff --git a/packages/jsts/src/rules/S6852/meta.ts b/packages/jsts/src/rules/S6852/meta.ts new file mode 100644 index 00000000000..972f4c8e445 --- /dev/null +++ b/packages/jsts/src/rules/S6852/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'interactive-supports-focus'; +export const externalPlugin = 'jsx-a11y'; diff --git a/packages/jsts/src/rules/S6853/decorator.ts b/packages/jsts/src/rules/S6853/decorator.ts index 5615fbef535..89369222018 100644 --- a/packages/jsts/src/rules/S6853/decorator.ts +++ b/packages/jsts/src/rules/S6853/decorator.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S6853/javascript import type { Rule } from 'eslint'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { Node } from 'estree'; import { generateMeta, interceptReport } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S6853/index.ts b/packages/jsts/src/rules/S6853/index.ts index 0de5390c1a1..424dd0a7014 100644 --- a/packages/jsts/src/rules/S6853/index.ts +++ b/packages/jsts/src/rules/S6853/index.ts @@ -14,8 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import pkg from 'eslint-plugin-jsx-a11y'; -const { rules } = pkg; +import { rules } from '../external/a11y.js'; import { decorate } from './decorator.js'; export const rule = decorate(rules['label-has-associated-control']); diff --git a/packages/jsts/src/rules/S6853/meta.ts b/packages/jsts/src/rules/S6853/meta.ts index 77a4dfed08f..df5b0cb5272 100644 --- a/packages/jsts/src/rules/S6853/meta.ts +++ b/packages/jsts/src/rules/S6853/meta.ts @@ -14,16 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Label elements should have a text label and an associated control', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6853/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6853'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'label-has-associated-control'; +export const externalRules = [ + { externalPlugin: 'jsx-a11y', externalRule: 'label-has-associated-control' }, +]; diff --git a/packages/jsts/src/rules/S6859/index.ts b/packages/jsts/src/rules/S6859/index.ts new file mode 100644 index 00000000000..4a25af2f62d --- /dev/null +++ b/packages/jsts/src/rules/S6859/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from 'eslint-plugin-import'; +export const rule = rules['no-absolute-path']; diff --git a/packages/jsts/src/rules/S6859/meta.ts b/packages/jsts/src/rules/S6859/meta.ts new file mode 100644 index 00000000000..d235e27de56 --- /dev/null +++ b/packages/jsts/src/rules/S6859/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-absolute-path'; +export const externalPlugin = 'import'; diff --git a/packages/jsts/src/rules/S6861/index.ts b/packages/jsts/src/rules/S6861/index.ts new file mode 100644 index 00000000000..629d6bf6764 --- /dev/null +++ b/packages/jsts/src/rules/S6861/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { rules } from 'eslint-plugin-import'; +export const rule = rules['no-mutable-exports']; diff --git a/packages/jsts/src/rules/S6861/meta.ts b/packages/jsts/src/rules/S6861/meta.ts new file mode 100644 index 00000000000..ebaddbd45e8 --- /dev/null +++ b/packages/jsts/src/rules/S6861/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-mutable-exports'; +export const externalPlugin = 'import'; diff --git a/packages/jsts/src/rules/S6957/meta.ts b/packages/jsts/src/rules/S6957/meta.ts index 8f190b844b9..a7adb1c32e1 100644 --- a/packages/jsts/src/rules/S6957/meta.ts +++ b/packages/jsts/src/rules/S6957/meta.ts @@ -14,33 +14,8 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-deprecated-react'; -export const meta = { - type: 'suggestion', - docs: { - description: 'Deprecated React APIs should not be used', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6957/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6957'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - type: 'object', - properties: { - 'react-version': { - type: 'string', - }, - }, - additionalProperties: false, - }, - ], -} as const satisfies JSONSchema4; +export const externalRules = [{ externalPlugin: 'react', externalRule: 'no-deprecated' }]; diff --git a/packages/jsts/src/rules/S6957/rule.ts b/packages/jsts/src/rules/S6957/rule.ts index 807638da22e..e0c6e32ced0 100644 --- a/packages/jsts/src/rules/S6957/rule.ts +++ b/packages/jsts/src/rules/S6957/rule.ts @@ -17,8 +17,7 @@ // https://sonarsource.github.io/rspec/#/rspec/S6957/javascript import type { Rule } from 'eslint'; -import pkg from 'eslint-plugin-react'; -const { rules } = pkg; +import { rules } from '../external/react.js'; import { generateMeta, getManifests, toUnixPath } from '../helpers/index.js'; import { FromSchema } from 'json-schema-to-ts'; import { meta, schema } from './meta.js'; diff --git a/packages/jsts/src/rules/S6958/meta.ts b/packages/jsts/src/rules/S6958/meta.ts index 369af952902..6097627ed8f 100644 --- a/packages/jsts/src/rules/S6958/meta.ts +++ b/packages/jsts/src/rules/S6958/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Literals should not be used as functions', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6958/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S6958'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-literal-call'; diff --git a/packages/jsts/src/rules/S6958/rule.ts b/packages/jsts/src/rules/S6958/rule.ts index e27445d684f..e75114dc7a4 100644 --- a/packages/jsts/src/rules/S6958/rule.ts +++ b/packages/jsts/src/rules/S6958/rule.ts @@ -14,18 +14,17 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { TSESTree } from '@typescript-eslint/utils'; import { type Rule } from 'eslint'; import { type Node } from 'estree'; import { generateMeta } from '../helpers/index.js'; import { meta } from './meta.js'; const NODES = new Set([ - TSESTree.AST_NODE_TYPES.ArrayExpression, - TSESTree.AST_NODE_TYPES.ClassExpression, - TSESTree.AST_NODE_TYPES.ObjectExpression, - TSESTree.AST_NODE_TYPES.Literal, - TSESTree.AST_NODE_TYPES.TemplateLiteral, + 'ArrayExpression', + 'ClassExpression', + 'ObjectExpression', + 'Literal', + 'TemplateLiteral', ]); export const rule: Rule.RuleModule = { diff --git a/packages/jsts/src/rules/S6959/meta.ts b/packages/jsts/src/rules/S6959/meta.ts index e3583c78654..2b094bc8389 100644 --- a/packages/jsts/src/rules/S6959/meta.ts +++ b/packages/jsts/src/rules/S6959/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: '"Array.reduce()" calls should include an initial value', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S6959/javascript', - requiresTypeChecking: true, - }, -}; - -export const sonarKey = 'S6959'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'reduce-initial-value'; diff --git a/packages/jsts/src/rules/S7059/meta.ts b/packages/jsts/src/rules/S7059/meta.ts index a6caf760e00..4b5be871218 100644 --- a/packages/jsts/src/rules/S7059/meta.ts +++ b/packages/jsts/src/rules/S7059/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Constructors should not contain asynchronous operations', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S7059/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S7059'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-async-constructor'; diff --git a/packages/jsts/src/rules/S7059/rule.ts b/packages/jsts/src/rules/S7059/rule.ts index 4bad0723bee..635c10ecb15 100644 --- a/packages/jsts/src/rules/S7059/rule.ts +++ b/packages/jsts/src/rules/S7059/rule.ts @@ -25,7 +25,6 @@ import { } from '../helpers/index.js'; import estree from 'estree'; import { meta } from './meta.js'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; const flaggedStatements = new Set(); @@ -57,7 +56,7 @@ export const rule: Rule.RuleModule = { let classConstructor: estree.MethodDefinition | undefined; let statement: estree.Statement | undefined; context.sourceCode.getAncestors(node).forEach(node => { - if (node.type === AST_NODE_TYPES.MethodDefinition && node.kind === 'constructor') { + if (node.type === 'MethodDefinition' && node.kind === 'constructor') { classConstructor = node; } if (classConstructor && node.type.endsWith('Statement')) { diff --git a/packages/jsts/src/rules/S7060/meta.ts b/packages/jsts/src/rules/S7060/meta.ts index 4117a39906d..7bd523f6e68 100644 --- a/packages/jsts/src/rules/S7060/meta.ts +++ b/packages/jsts/src/rules/S7060/meta.ts @@ -14,17 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Module should not import itself', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S7060/javascript', - requiresTypeChecking: false, - }, - fixable: 'code', -}; - -export const sonarKey = 'S7060'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-self-import'; +export const externalRules = [{ externalPlugin: 'import', externalRule: 'no-self-import' }]; diff --git a/packages/jsts/src/rules/S878/index.ts b/packages/jsts/src/rules/S878/index.ts new file mode 100644 index 00000000000..85d4296b8e0 --- /dev/null +++ b/packages/jsts/src/rules/S878/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-sequences'); diff --git a/packages/jsts/src/rules/S878/meta.ts b/packages/jsts/src/rules/S878/meta.ts new file mode 100644 index 00000000000..1ac58bf0654 --- /dev/null +++ b/packages/jsts/src/rules/S878/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-sequences'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S881/meta.ts b/packages/jsts/src/rules/S881/meta.ts index 515d5c9c158..91c090f6e6e 100644 --- a/packages/jsts/src/rules/S881/meta.ts +++ b/packages/jsts/src/rules/S881/meta.ts @@ -14,17 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: - 'Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression', - recommended: false, - url: 'https://sonarsource.github.io/rspec/#/rspec/S881/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S881'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-nested-incdec'; diff --git a/packages/jsts/src/rules/S888/meta.ts b/packages/jsts/src/rules/S888/meta.ts index 84c8de2fba6..ec2b236cae0 100644 --- a/packages/jsts/src/rules/S888/meta.ts +++ b/packages/jsts/src/rules/S888/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'suggestion', - docs: { - description: 'Equality operators should not be used in "for" loop termination conditions', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S888/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S888'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-equals-in-for-termination'; diff --git a/packages/jsts/src/rules/S905/decorator.ts b/packages/jsts/src/rules/S905/decorator.ts index 152166d7560..7066ae7f091 100644 --- a/packages/jsts/src/rules/S905/decorator.ts +++ b/packages/jsts/src/rules/S905/decorator.ts @@ -16,7 +16,7 @@ */ import type { Rule } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { generateMeta, interceptReport } from '../helpers/index.js'; import { meta } from './meta.js'; diff --git a/packages/jsts/src/rules/S905/index.ts b/packages/jsts/src/rules/S905/index.ts index ea8065dc7ad..c875275107b 100644 --- a/packages/jsts/src/rules/S905/index.ts +++ b/packages/jsts/src/rules/S905/index.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { tsEslintRules } from '../typescript-eslint/index.js'; +import { rules as tsEslintRules } from '../external/typescript-eslint/index.js'; import { decorate } from './decorator.js'; export const rule = decorate(tsEslintRules['no-unused-expressions']); diff --git a/packages/jsts/src/rules/S905/meta.ts b/packages/jsts/src/rules/S905/meta.ts index d332359c176..5fa3e1a3e89 100644 --- a/packages/jsts/src/rules/S905/meta.ts +++ b/packages/jsts/src/rules/S905/meta.ts @@ -14,16 +14,9 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Non-empty statements should change control flow or have at least one side-effect', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S905/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S905'; +export * from './generated-meta.js'; +export const implementation = 'decorated'; +export const eslintId = 'no-unused-expressions'; +export const externalRules = [ + { externalPlugin: 'typescript-eslint', externalRule: 'no-unused-expressions' }, +]; diff --git a/packages/jsts/src/rules/S909/index.ts b/packages/jsts/src/rules/S909/index.ts new file mode 100644 index 00000000000..4fc9611eeb8 --- /dev/null +++ b/packages/jsts/src/rules/S909/index.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { getESLintCoreRule } from '../external/core.js'; +export const rule = getESLintCoreRule('no-continue'); diff --git a/packages/jsts/src/rules/S909/meta.ts b/packages/jsts/src/rules/S909/meta.ts new file mode 100644 index 00000000000..83707694af5 --- /dev/null +++ b/packages/jsts/src/rules/S909/meta.ts @@ -0,0 +1,20 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +export * from './generated-meta.js'; +export const implementation = 'external'; +export const eslintId = 'no-continue'; +export const externalPlugin = 'eslint'; diff --git a/packages/jsts/src/rules/S930/meta.ts b/packages/jsts/src/rules/S930/meta.ts index d8fad09657d..bb7e5c41588 100644 --- a/packages/jsts/src/rules/S930/meta.ts +++ b/packages/jsts/src/rules/S930/meta.ts @@ -14,16 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = { - type: 'problem', - docs: { - description: 'Function calls should not pass extra arguments', - recommended: true, - url: 'https://sonarsource.github.io/rspec/#/rspec/S930/javascript', - requiresTypeChecking: false, - }, -}; - -export const sonarKey = 'S930'; +export * from './generated-meta.js'; +export const implementation = 'original'; +export const eslintId = 'no-extra-arguments'; diff --git a/packages/jsts/src/rules/S930/rule.ts b/packages/jsts/src/rules/S930/rule.ts index 4c86b351799..34638a5feb9 100644 --- a/packages/jsts/src/rules/S930/rule.ts +++ b/packages/jsts/src/rules/S930/rule.ts @@ -16,7 +16,7 @@ */ // https://sonarsource.github.io/rspec/#/rspec/S930 -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { Rule, Scope } from 'eslint'; import { generateMeta, @@ -82,7 +82,7 @@ export const rule: Rule.RuleModule = { ':function'(node: estree.Node) { const fn = node as TSESTree.FunctionExpression; if ( - fn.body.type === AST_NODE_TYPES.BlockStatement && + fn.body.type === 'BlockStatement' && fn.body.body.length === 0 && fn.params.length === 0 ) { diff --git a/packages/jsts/src/rules/core/index.ts b/packages/jsts/src/rules/core/index.ts deleted file mode 100644 index 8764704f215..00000000000 --- a/packages/jsts/src/rules/core/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -import { Linter } from 'eslint'; - -/** - * ESLint core rules. - * - * TODO: check typescript-eslint to import core rules: - * https://github.com/typescript-eslint/typescript-eslint/blob/75df60587d045438df448d76cc0ee093c8c31e28/packages/eslint-plugin/src/util/getESLintCoreRule.ts - */ -export const eslintRules = Object.fromEntries(new Linter({ configType: 'eslintrc' }).getRules()); diff --git a/packages/jsts/src/rules/decorated.ts b/packages/jsts/src/rules/decorated.ts deleted file mode 100644 index 2e658ca317e..00000000000 --- a/packages/jsts/src/rules/decorated.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -export { rule as S2376 } from './S2376/index.js'; // accessor-pairs -export { rule as S1077 } from './S1077/index.js'; // alt-text -export { rule as S6827 } from './S6827/index.js'; // anchor-has-content -export { rule as S6844 } from './S6844/index.js'; // anchor-is-valid -export { rule as S1105 } from './S1105/index.js'; // brace-style -export { rule as S1788 } from './S1788/index.js'; // default-param-last -export { rule as S5254 } from './S5254/index.js'; // html-has-lang -export { rule as S6749 } from './S6749/index.js'; // jsx-no-useless-fragment -export { rule as S6853 } from './S6853/index.js'; // label-has-associated-control -export { rule as S4084 } from './S4084/index.js'; // media-has-caption -export { rule as S2430 } from './S2430/index.js'; // new-cap -export { rule as S4275 } from './S4275/index.js'; // no-accessor-field-mismatch -export { rule as S6551 } from './S6551/index.js'; // no-base-to-string -export { rule as S1186 } from './S1186/index.js'; // no-empty-function -export { rule as S4023 } from './S4023/index.js'; // no-empty-interface -export { rule as S6643 } from './S6643/index.js'; // no-extend-native -export { rule as S1116 } from './S1116/index.js'; // no-extra-semi -export { rule as S6788 } from './S6788/index.js'; // no-find-dom-node -export { rule as S2189 } from './S2189/index.js'; // no-infinite-loop -export { rule as S6660 } from './S6660/index.js'; // no-lonely-if -export { rule as S6544 } from './S6544/index.js'; // no-misused-promises -export { rule as S2814 } from './S2814/index.js'; // no-redeclare -export { rule as S6440 } from './S6440/index.js'; // rules-of-hooks -export { rule as S6571 } from './S6571/index.js'; // no-redundant-type-constituents -export { rule as S6679 } from './S6679/index.js'; // no-self-compare -export { rule as S7060 } from './S7060/index.js'; // no-self-import -export { rule as S4327 } from './S4327/index.js'; // no-this-alias -export { rule as S3696 } from './S3696/index.js'; // no-throw-literal -export { rule as S6747 } from './S6747/index.js'; // no-unknown-property -export { rule as S1763 } from './S1763/index.js'; // no-unreachable -export { rule as S905 } from './S905/index.js'; // no-unused-expressions -export { rule as S1068 } from './S1068/index.js'; // no-unused-private-class-members -export { rule as S6676 } from './S6676/index.js'; // no-useless-call -export { rule as S6647 } from './S6647/index.js'; // no-useless-constructor -export { rule as S3504 } from './S3504/index.js'; // no-var -export { rule as S3498 } from './S3498/index.js'; // object-shorthand -export { rule as S6572 } from './S6572/index.js'; // prefer-enum-initializers -export { rule as S4138 } from './S4138/index.js'; // prefer-for-of -export { rule as S6598 } from './S6598/index.js'; // prefer-function-type -export { rule as S4156 } from './S4156/index.js'; // prefer-namespace-keyword -export { rule as S6606 } from './S6606/index.js'; // prefer-nullish-coalescing -export { rule as S6661 } from './S6661/index.js'; // prefer-object-spread -export { rule as S6666 } from './S6666/index.js'; // prefer-spread -export { rule as S6557 } from './S6557/index.js'; // prefer-string-starts-ends-with -export { rule as S3512 } from './S3512/index.js'; // prefer-template -export { rule as S1438 } from './S1438/index.js'; // semi -export { rule as S107 } from './S107/index.js'; // sonar-max-params -export { rule as S1534 } from './S1534/index.js'; // sonar-no-dupe-keys -export { rule as S131 } from './S131/index.js'; // switch-without-default -export { rule as S6535 } from './S6535/index.js'; // unnecessary-character-escapes -export { rule as S2688 } from './S2688/index.js'; // use-isnan diff --git a/packages/jsts/src/rules/external.ts b/packages/jsts/src/rules/external.ts deleted file mode 100644 index c478c5c47c4..00000000000 --- a/packages/jsts/src/rules/external.ts +++ /dev/null @@ -1,138 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -import { eslintRules } from './core/index.js'; -import pkg from 'eslint-plugin-react'; -const reactPluginRules = pkg.rules; -import { tsEslintRules } from './typescript-eslint/index.js'; -import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'; -const { rules: a11yPluginRules } = jsxA11yPlugin; -import { rules as importPluginRules } from 'eslint-plugin-import'; - -export const rules = { - S103: eslintRules['max-len'], - S106: eslintRules['no-console'], - S108: eslintRules['no-empty'], - S1090: a11yPluginRules['iframe-has-title'], - S1117: tsEslintRules['no-shadow'], - S113: eslintRules['eol-last'], - S1131: eslintRules['no-trailing-spaces'], - S1143: eslintRules['no-unsafe-finally'], - S1199: eslintRules['no-lone-blocks'], - S121: eslintRules['curly'], - S122: eslintRules['max-statements-per-line'], - S1314: eslintRules['no-octal'], - S1321: eslintRules['no-with'], - S139: eslintRules['line-comment-position'], - S1440: eslintRules['eqeqeq'], - S1441: eslintRules['quotes'], - S1442: eslintRules['no-alert'], - S1516: eslintRules['no-multi-str'], - S1525: eslintRules['no-debugger'], - S1536: eslintRules['no-dupe-args'], - S1537: tsEslintRules['comma-dangle'], - S1539: eslintRules['strict'], - S1656: eslintRules['no-self-assign'], - S1774: eslintRules['no-ternary'], - S2094: tsEslintRules['no-extraneous-class'], - S2427: eslintRules['radix'], - S2432: eslintRules['no-setter-return'], - S2685: eslintRules['no-caller'], - S2933: tsEslintRules['prefer-readonly'], - S2966: tsEslintRules['no-non-null-assertion'], - S3257: tsEslintRules['no-inferrable-types'], - S3353: eslintRules['prefer-const'], - S3523: eslintRules['no-new-func'], - S3786: eslintRules['no-template-curly-in-string'], - S3799: eslintRules['no-empty-pattern'], - S3812: eslintRules['no-unsafe-negation'], - S3834: eslintRules['no-new-native-nonconstructor'], - S3863: importPluginRules['no-duplicates'], - S4124: tsEslintRules['no-misused-new'], - S4125: eslintRules['valid-typeof'], - S4136: tsEslintRules['adjacent-overload-signatures'], - S4137: tsEslintRules['consistent-type-assertions'], - S4140: eslintRules['no-sparse-arrays'], - S4157: tsEslintRules['no-unnecessary-type-arguments'], - S4204: tsEslintRules['no-explicit-any'], - S4325: tsEslintRules['no-unnecessary-type-assertion'], - S4326: eslintRules['no-return-await'], - S6325: eslintRules['prefer-regex-literals'], - S6435: reactPluginRules['require-render-return'], - S6438: reactPluginRules['jsx-no-comment-textnodes'], - S6480: reactPluginRules['jsx-no-bind'], - S6509: eslintRules['no-extra-boolean-cast'], - S6522: eslintRules['no-import-assign'], - S6523: eslintRules['no-unsafe-optional-chaining'], - S6534: eslintRules['no-loss-of-precision'], - S6550: tsEslintRules['prefer-literal-enum-member'], - S6565: tsEslintRules['prefer-return-this-type'], - S6568: tsEslintRules['no-confusing-non-null-assertion'], - S6569: tsEslintRules['no-unnecessary-type-constraint'], - S6578: tsEslintRules['no-duplicate-enum-values'], - S6583: tsEslintRules['no-mixed-enums'], - S6590: tsEslintRules['prefer-as-const'], - S6635: eslintRules['no-constructor-return'], - S6637: eslintRules['no-extra-bind'], - S6638: eslintRules['no-constant-binary-expression'], - S6644: eslintRules['no-unneeded-ternary'], - S6645: eslintRules['no-undef-init'], - S6650: eslintRules['no-useless-rename'], - S6653: eslintRules['prefer-object-has-own'], - S6654: eslintRules['no-proto'], - S6657: eslintRules['no-octal-escape'], - S6671: tsEslintRules['prefer-promise-reject-errors'], - S6746: reactPluginRules['no-direct-mutation-state'], - S6748: reactPluginRules['no-children-prop'], - S6750: reactPluginRules['no-render-return-value'], - S6756: reactPluginRules['no-access-state-in-setstate'], - S6757: reactPluginRules['no-this-in-sfc'], - S6761: reactPluginRules['no-danger-with-children'], - S6763: reactPluginRules['no-redundant-should-component-update'], - S6766: reactPluginRules['no-unescaped-entities'], - S6767: reactPluginRules['no-unused-prop-types'], - S6770: reactPluginRules['jsx-pascal-case'], - S6772: reactPluginRules['jsx-child-element-spacing'], - S6774: reactPluginRules['prop-types'], - S6775: reactPluginRules['default-props-match-prop-types'], - S6789: reactPluginRules['no-is-mounted'], - S6790: reactPluginRules['no-string-refs'], - S6793: a11yPluginRules['aria-proptypes'], - S6807: a11yPluginRules['role-has-required-aria-props'], - S6811: a11yPluginRules['role-supports-aria-props'], - S6819: a11yPluginRules['prefer-tag-over-role'], - S6821: a11yPluginRules['aria-role'], - S6822: a11yPluginRules['no-redundant-roles'], - S6823: a11yPluginRules['aria-activedescendant-has-tabindex'], - S6824: a11yPluginRules['aria-unsupported-elements'], - S6825: a11yPluginRules['no-aria-hidden-on-focusable'], - S6836: eslintRules['no-case-declarations'], - S6840: a11yPluginRules['autocomplete-valid'], - S6841: a11yPluginRules['tabindex-no-positive'], - S6842: a11yPluginRules['no-noninteractive-element-to-interactive-role'], - S6843: a11yPluginRules['no-interactive-element-to-noninteractive-role'], - S6845: a11yPluginRules['no-noninteractive-tabindex'], - S6846: a11yPluginRules['no-access-key'], - S6847: a11yPluginRules['no-noninteractive-element-interactions'], - S6848: a11yPluginRules['no-static-element-interactions'], - S6850: a11yPluginRules['heading-has-content'], - S6851: a11yPluginRules['img-redundant-alt'], - S6852: a11yPluginRules['interactive-supports-focus'], - S6859: importPluginRules['no-absolute-path'], - S6861: importPluginRules['no-mutable-exports'], - S878: eslintRules['no-sequences'], - S909: eslintRules['no-continue'], -}; diff --git a/packages/jsts/src/rules/external/a11y.ts b/packages/jsts/src/rules/external/a11y.ts new file mode 100644 index 00000000000..bb7cae3dfb4 --- /dev/null +++ b/packages/jsts/src/rules/external/a11y.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'; +export const { rules } = jsxA11yPlugin; diff --git a/packages/jsts/src/rules/external/core.ts b/packages/jsts/src/rules/external/core.ts new file mode 100644 index 00000000000..c94d3cf36ba --- /dev/null +++ b/packages/jsts/src/rules/external/core.ts @@ -0,0 +1,21 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { builtinRules } from 'eslint/use-at-your-own-risk'; + +export function getESLintCoreRule(key: string) { + return builtinRules.get(key)!; +} diff --git a/packages/jsts/src/rules/external/react.ts b/packages/jsts/src/rules/external/react.ts new file mode 100644 index 00000000000..870bb342ec9 --- /dev/null +++ b/packages/jsts/src/rules/external/react.ts @@ -0,0 +1,18 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import pkg from 'eslint-plugin-react'; +export const { rules } = pkg; diff --git a/packages/jsts/src/rules/external/typescript-eslint/index.ts b/packages/jsts/src/rules/external/typescript-eslint/index.ts new file mode 100644 index 00000000000..f1a1d5a4e4b --- /dev/null +++ b/packages/jsts/src/rules/external/typescript-eslint/index.ts @@ -0,0 +1,34 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import type { Rule } from 'eslint'; +import pkg from '@typescript-eslint/eslint-plugin'; +const { rules: tsEslintRules } = pkg; +import { sanitize } from './sanitize.js'; + +/** + * TypeScript ESLint rules that rely on type information fail at runtime because + * they unconditionally assume that TypeScript's type checker is available. + */ +const sanitized: Record = {}; +for (const ruleKey of Object.keys(tsEslintRules)) { + sanitized[ruleKey] = sanitize(tsEslintRules[ruleKey] as unknown as Rule.RuleModule); +} + +/** + * TypeScript ESLint rules. + */ +export const rules = sanitized; diff --git a/packages/jsts/src/rules/typescript-eslint/sanitize.ts b/packages/jsts/src/rules/external/typescript-eslint/sanitize.ts similarity index 97% rename from packages/jsts/src/rules/typescript-eslint/sanitize.ts rename to packages/jsts/src/rules/external/typescript-eslint/sanitize.ts index 16322521b9d..38c542c5f54 100644 --- a/packages/jsts/src/rules/typescript-eslint/sanitize.ts +++ b/packages/jsts/src/rules/external/typescript-eslint/sanitize.ts @@ -15,7 +15,7 @@ * along with this program; if not, see https://sonarsource.com/license/ssal/ */ import type { Rule } from 'eslint'; -import { isRequiredParserServices } from '../helpers/index.js'; +import { isRequiredParserServices } from '../../helpers/index.js'; /** * Sanitizes a TypeScript ESLint rule diff --git a/packages/jsts/src/rules/helpers/accessibility.ts b/packages/jsts/src/rules/helpers/accessibility.ts index 136fd6c1af7..db108fb8725 100644 --- a/packages/jsts/src/rules/helpers/accessibility.ts +++ b/packages/jsts/src/rules/helpers/accessibility.ts @@ -15,9 +15,8 @@ * along with this program; if not, see https://sonarsource.com/license/ssal/ */ import pkg from 'jsx-ast-utils'; -const { getProp, getLiteralPropValue } = pkg; -import getElementType from 'eslint-plugin-jsx-a11y/lib/util/getElementType.js'; -import { TSESTree } from '@typescript-eslint/utils'; +const { getProp, getLiteralPropValue, elementType } = pkg; +import type { TSESTree } from '@typescript-eslint/utils'; import type { Rule } from 'eslint'; export function isPresentationTable(context: Rule.RuleContext, node: TSESTree.JSXOpeningElement) { @@ -34,3 +33,30 @@ export function isPresentationTable(context: Rule.RuleContext, node: TSESTree.JS return DISALLOWED_VALUES.includes(roleValue?.toLowerCase()); } + +export const getElementType = ( + context: Rule.RuleContext, +): ((node: TSESTree.JSXOpeningElement) => string) => { + const { settings } = context; + const polymorphicPropName = settings['jsx-a11y']?.polymorphicPropName; + const polymorphicAllowList = settings['jsx-a11y']?.polymorphicAllowList; + + const componentMap = settings['jsx-a11y']?.components; + + return (node: TSESTree.JSXOpeningElement): string => { + const polymorphicProp = polymorphicPropName + ? getLiteralPropValue(getProp(node.attributes, polymorphicPropName)) + : undefined; + + let rawType: string = elementType(node); + if (polymorphicProp && (!polymorphicAllowList || polymorphicAllowList.includes(rawType))) { + rawType = `${polymorphicProp}`; + } + + if (!componentMap) { + return rawType; + } + + return componentMap.hasOwnProperty(rawType) ? componentMap[rawType] : rawType; + }; +}; diff --git a/packages/jsts/src/rules/helpers/ancestor.ts b/packages/jsts/src/rules/helpers/ancestor.ts index 32a8840a2b6..2e3ec5b6d91 100644 --- a/packages/jsts/src/rules/helpers/ancestor.ts +++ b/packages/jsts/src/rules/helpers/ancestor.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { Rule, SourceCode } from 'eslint'; import estree, { Node } from 'estree'; import { functionLike } from './ast.js'; diff --git a/packages/jsts/src/rules/helpers/ast.ts b/packages/jsts/src/rules/helpers/ast.ts index 6b5619d902b..7fd0c935c60 100644 --- a/packages/jsts/src/rules/helpers/ast.ts +++ b/packages/jsts/src/rules/helpers/ast.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { Rule, Scope } from 'eslint'; import estree from 'estree'; import { diff --git a/packages/jsts/src/rules/helpers/conditions.ts b/packages/jsts/src/rules/helpers/conditions.ts index 67ad389528f..48cf0246ae8 100644 --- a/packages/jsts/src/rules/helpers/conditions.ts +++ b/packages/jsts/src/rules/helpers/conditions.ts @@ -14,7 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import estree from 'estree'; /** Returns a list of statements corresponding to a `if - else if - else` chain */ @@ -24,7 +23,7 @@ export function collectIfBranches(node: estree.IfStatement) { let statement = node.alternate; while (statement) { - if (statement.type === AST_NODE_TYPES.IfStatement) { + if (statement.type === 'IfStatement') { branches.push(statement.consequent); statement = statement.alternate; } else { @@ -56,7 +55,7 @@ export function collectSwitchBranches(node: estree.SwitchStatement) { /** Excludes the break statement from the list */ export function takeWithoutBreak(nodes: estree.Statement[]) { - return nodes.length > 0 && nodes[nodes.length - 1].type === AST_NODE_TYPES.BreakStatement + return nodes.length > 0 && nodes[nodes.length - 1].type === 'BreakStatement' ? nodes.slice(0, -1) : nodes; } diff --git a/packages/jsts/src/rules/helpers/isHtmlElement.ts b/packages/jsts/src/rules/helpers/isHtmlElement.ts index 38596d25087..2592b4b5491 100644 --- a/packages/jsts/src/rules/helpers/isHtmlElement.ts +++ b/packages/jsts/src/rules/helpers/isHtmlElement.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; const HTML_TAG_NAMES = new Set([ 'a', diff --git a/packages/jsts/src/rules/helpers/jsx.ts b/packages/jsts/src/rules/helpers/jsx.ts index 4054fb1798e..a29bb64a109 100644 --- a/packages/jsts/src/rules/helpers/jsx.ts +++ b/packages/jsts/src/rules/helpers/jsx.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; export function getJsxShortCircuitNodes(logicalExpression: TSESTree.LogicalExpression) { if (logicalExpression.parent?.type !== 'JSXExpressionContainer') { diff --git a/packages/jsts/src/rules/helpers/location.ts b/packages/jsts/src/rules/helpers/location.ts index 31f9032fccb..2917afc1eb3 100644 --- a/packages/jsts/src/rules/helpers/location.ts +++ b/packages/jsts/src/rules/helpers/location.ts @@ -16,7 +16,7 @@ */ import estree from 'estree'; import type { AST, Rule } from 'eslint'; -import { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; export type LocationHolder = AST.Token | TSESTree.Node | estree.Node | { loc: AST.SourceLocation }; diff --git a/packages/jsts/src/rules/helpers/lva.ts b/packages/jsts/src/rules/helpers/lva.ts index 237a08cd353..1369c35ce1e 100644 --- a/packages/jsts/src/rules/helpers/lva.ts +++ b/packages/jsts/src/rules/helpers/lva.ts @@ -16,7 +16,7 @@ */ import type { Rule, Scope } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; export function lva(liveVariablesMap: Map) { const worklist = Array.from(liveVariablesMap.values(), lva => lva.segment); diff --git a/packages/jsts/src/rules/helpers/module.ts b/packages/jsts/src/rules/helpers/module.ts index 734bcf145b2..74c6190e6c0 100644 --- a/packages/jsts/src/rules/helpers/module.ts +++ b/packages/jsts/src/rules/helpers/module.ts @@ -16,7 +16,7 @@ */ import type { Rule, Scope } from 'eslint'; import estree from 'estree'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { Node, isIdentifier, getVariableFromScope, getUniqueWriteReference } from './ast.js'; export function getImportDeclarations(context: Rule.RuleContext) { diff --git a/packages/jsts/src/rules/helpers/regex/extract.ts b/packages/jsts/src/rules/helpers/regex/extract.ts index f66197fdce7..ff58d836415 100644 --- a/packages/jsts/src/rules/helpers/regex/extract.ts +++ b/packages/jsts/src/rules/helpers/regex/extract.ts @@ -27,7 +27,7 @@ import { isStaticTemplateLiteral, isStringLiteral, } from '../index.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { isRegExpConstructor } from './ast.js'; import { getFlags } from './flags.js'; diff --git a/packages/jsts/src/rules/helpers/table.ts b/packages/jsts/src/rules/helpers/table.ts index 32f3bd0ee78..8ba2c2f4cb4 100644 --- a/packages/jsts/src/rules/helpers/table.ts +++ b/packages/jsts/src/rules/helpers/table.ts @@ -14,12 +14,12 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import pkg from 'jsx-ast-utils'; const { getLiteralPropValue, getProp } = pkg; import type { Rule } from 'eslint'; -import getElementType from 'eslint-plugin-jsx-a11y/lib/util/getElementType.js'; import { isHtmlElement } from './isHtmlElement.js'; +import { getElementType } from './accessibility.js'; export type TableCell = { isHeader: boolean; diff --git a/packages/jsts/src/rules/helpers/type.ts b/packages/jsts/src/rules/helpers/type.ts index 6fc07ab9131..83efe693295 100644 --- a/packages/jsts/src/rules/helpers/type.ts +++ b/packages/jsts/src/rules/helpers/type.ts @@ -16,7 +16,7 @@ */ import estree from 'estree'; import ts from 'typescript'; -import { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { RequiredParserServices } from '../helpers/index.js'; import { getVariableFromScope } from './ast.js'; import type { Rule } from 'eslint'; diff --git a/packages/jsts/src/rules/index.ts b/packages/jsts/src/rules/index.ts index a79f1b67762..41dda77639b 100644 --- a/packages/jsts/src/rules/index.ts +++ b/packages/jsts/src/rules/index.ts @@ -14,14 +14,6 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import * as originalRules from './original.js'; -import * as decoratedRules from './decorated.js'; -import * as externalRules from './external.js'; - -export const rules = { - ...originalRules, - ...decoratedRules, - ...externalRules.rules, -}; +export * as rules from './rules.js'; export * from './helpers/index.js'; diff --git a/packages/jsts/src/rules/original.ts b/packages/jsts/src/rules/original.ts deleted file mode 100644 index 80fd8286a22..00000000000 --- a/packages/jsts/src/rules/original.ts +++ /dev/null @@ -1,295 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -export { rule as S5850 } from './S5850/index.js'; // anchor-precedence -export { rule as S3782 } from './S3782/index.js'; // argument-type -export { rule as S2234 } from './S2234/index.js'; // arguments-order -export { rule as S3513 } from './S3513/index.js'; // arguments-usage -export { rule as S3796 } from './S3796/index.js'; // array-callback-without-return -export { rule as S1528 } from './S1528/index.js'; // array-constructor -export { rule as S3524 } from './S3524/index.js'; // arrow-function-convention -export { rule as S2699 } from './S2699/index.js'; // assertions-in-tests -export { rule as S6333 } from './S6333/index.js'; // aws-apigateway-public-api -export { rule as S6329 } from './S6329/index.js'; // aws-ec2-rds-dms-public -export { rule as S6275 } from './S6275/index.js'; // aws-ec2-unencrypted-ebs-volume -export { rule as S6332 } from './S6332/index.js'; // aws-efs-unencrypted -export { rule as S6302 } from './S6302/index.js'; // aws-iam-all-privileges -export { rule as S6304 } from './S6304/index.js'; // aws-iam-all-resources-accessible -export { rule as S6317 } from './S6317/index.js'; // aws-iam-privilege-escalation -export { rule as S6270 } from './S6270/index.js'; // aws-iam-public-access -export { rule as S6308 } from './S6308/index.js'; // aws-opensearchservice-domain -export { rule as S6303 } from './S6303/index.js'; // aws-rds-unencrypted-databases -export { rule as S6321 } from './S6321/index.js'; // aws-restricted-ip-admin-access -export { rule as S6265 } from './S6265/index.js'; // aws-s3-bucket-granted-access -export { rule as S6249 } from './S6249/index.js'; // aws-s3-bucket-insecure-http -export { rule as S6281 } from './S6281/index.js'; // aws-s3-bucket-public-access -export { rule as S6245 } from './S6245/index.js'; // aws-s3-bucket-server-encryption -export { rule as S6252 } from './S6252/index.js'; // aws-s3-bucket-versioning -export { rule as S6319 } from './S6319/index.js'; // aws-sagemaker-unencrypted-notebook -export { rule as S6327 } from './S6327/index.js'; // aws-sns-unencrypted-topics -export { rule as S6330 } from './S6330/index.js'; // aws-sqs-unencrypted-queue -export { rule as S1529 } from './S1529/index.js'; // bitwise-operators -export { rule as S4798 } from './S4798/index.js'; // bool-param-default -export { rule as S1472 } from './S1472/index.js'; // call-argument-line -export { rule as S5742 } from './S5742/index.js'; // certificate-transparency -export { rule as S6092 } from './S6092/index.js'; // chai-determinate-assertion -export { rule as S101 } from './S101/index.js'; // class-name -export { rule as S3525 } from './S3525/index.js'; // class-prototype -export { rule as S1523 } from './S1523/index.js'; // code-eval -export { rule as S3776 } from './S3776/index.js'; // cognitive-complexity -export { rule as S3616 } from './S3616/index.js'; // comma-or-logical-or-case -export { rule as S124 } from './S124/index.js'; // comment-regex -export { rule as S6353 } from './S6353/index.js'; // concise-regex -export { rule as S3973 } from './S3973/index.js'; // conditional-indentation -export { rule as S5757 } from './S5757/index.js'; // confidential-information-logging -export { rule as S1848 } from './S1848/index.js'; // constructor-for-side-effects -export { rule as S5693 } from './S5693/index.js'; // content-length -export { rule as S5728 } from './S5728/index.js'; // content-security-policy -export { rule as S3330 } from './S3330/index.js'; // cookie-no-httponly -export { rule as S2255 } from './S2255/index.js'; // cookies -export { rule as S5122 } from './S5122/index.js'; // cors -export { rule as S4502 } from './S4502/index.js'; // csrf -export { rule as S1541 } from './S1541/index.js'; // cyclomatic-complexity -export { rule as S3798 } from './S3798/index.js'; // declarations-in-global-scope -export { rule as S1874 } from './S1874/index.js'; // deprecation -export { rule as S3514 } from './S3514/index.js'; // destructuring-assignment-syntax -export { rule as S3403 } from './S3403/index.js'; // different-types-comparison -export { rule as S5247 } from './S5247/index.js'; // disabled-auto-escaping -export { rule as S5725 } from './S5725/index.js'; // disabled-resource-integrity -export { rule as S6080 } from './S6080/index.js'; // disabled-timeout -export { rule as S5743 } from './S5743/index.js'; // dns-prefetching -export { rule as S5869 } from './S5869/index.js'; // duplicates-in-character-class -export { rule as S126 } from './S126/index.js'; // elseif-without-else -export { rule as S5842 } from './S5842/index.js'; // empty-string-repetition -export { rule as S4787 } from './S4787/index.js'; // encryption -export { rule as S5542 } from './S5542/index.js'; // encryption-secure-mode -export { rule as S3723 } from './S3723/index.js'; // enforce-trailing-comma -export { rule as S6328 } from './S6328/index.js'; // existing-groups -export { rule as S1067 } from './S1067/index.js'; // expression-complexity -export { rule as S1451 } from './S1451/index.js'; // file-header -export { rule as S3317 } from './S3317/index.js'; // file-name-differ-from-class -export { rule as S2612 } from './S2612/index.js'; // file-permissions -export { rule as S2598 } from './S2598/index.js'; // file-uploads -export { rule as S1134 } from './S1134/index.js'; // fixme-tag -export { rule as S1535 } from './S1535/index.js'; // for-in -export { rule as S2251 } from './S2251/index.js'; // for-loop-increment-sign -export { rule as S5732 } from './S5732/index.js'; // frame-ancestors -export { rule as S1515 } from './S1515/index.js'; // function-inside-loop -export { rule as S100 } from './S100/index.js'; // function-name -export { rule as S3800 } from './S3800/index.js'; // function-return-type -export { rule as S1527 } from './S1527/index.js'; // future-reserved-words -export { rule as S3531 } from './S3531/index.js'; // generator-without-yield -export { rule as S4790 } from './S4790/index.js'; // hashing -export { rule as S5691 } from './S5691/index.js'; // hidden-files -export { rule as S6754 } from './S6754/index.js'; // hook-use-state -export { rule as S3785 } from './S3785/index.js'; // in-operator-type-error -export { rule as S3686 } from './S3686/index.js'; // inconsistent-function-call -export { rule as S2692 } from './S2692/index.js'; // index-of-compare-to-positive-number -export { rule as S2092 } from './S2092/index.js'; // insecure-cookie -export { rule as S5659 } from './S5659/index.js'; // insecure-jwt-token -export { rule as S3415 } from './S3415/index.js'; // inverted-assertion-arguments -export { rule as S6477 } from './S6477/index.js'; // jsx-key -export { rule as S6481 } from './S6481/index.js'; // jsx-no-constructed-context-values -export { rule as S1439 } from './S1439/index.js'; // label-position -export { rule as S5148 } from './S5148/index.js'; // link-with-target-blank -export { rule as S1479 } from './S1479/index.js'; // max-switch-cases -export { rule as S4622 } from './S4622/index.js'; // max-union-size -export { rule as S1994 } from './S1994/index.js'; // misplaced-loop-counter -export { rule as S1082 } from './S1082/index.js'; // mouse-events-a11y -export { rule as S134 } from './S134/index.js'; // nested-control-flow -export { rule as S2999 } from './S2999/index.js'; // new-operator-misuse -export { rule as S3923 } from './S3923/index.js'; // no-all-duplicated-branches -export { rule as S2871 } from './S2871/index.js'; // no-alphabetical-sort -export { rule as S6268 } from './S6268/index.js'; // no-angular-bypass-sanitization -export { rule as S2870 } from './S2870/index.js'; // no-array-delete -export { rule as S6479 } from './S6479/index.js'; // no-array-index-key -export { rule as S3579 } from './S3579/index.js'; // no-associative-arrays -export { rule as S7059 } from './S7059/index.js'; // no-async-constructor -export { rule as S2424 } from './S2424/index.js'; // no-built-in-override -export { rule as S1219 } from './S1219/index.js'; // no-case-label-in-switch -export { rule as S5332 } from './S5332/index.js'; // no-clear-text-protocols -export { rule as S6079 } from './S6079/index.js'; // no-code-after-done -export { rule as S1066 } from './S1066/index.js'; // no-collapsible-if -export { rule as S3981 } from './S3981/index.js'; // no-collection-size-mischeck -export { rule as S125 } from './S125/index.js'; // no-commented-code -export { rule as S1854 } from './S1854/index.js'; // no-dead-store -export { rule as S3001 } from './S3001/index.js'; // no-delete-var -export { rule as S6957 } from './S6957/index.js'; // no-deprecated-react -export { rule as S4621 } from './S4621/index.js'; // no-duplicate-in-composite -export { rule as S1192 } from './S1192/index.js'; // no-duplicate-string -export { rule as S1871 } from './S1871/index.js'; // no-duplicated-branches -export { rule as S4143 } from './S4143/index.js'; // no-element-overwrite -export { rule as S6019 } from './S6019/index.js'; // no-empty-after-reluctant -export { rule as S6323 } from './S6323/index.js'; // no-empty-alternatives -export { rule as S4158 } from './S4158/index.js'; // no-empty-collection -export { rule as S6331 } from './S6331/index.js'; // no-empty-group -export { rule as S2187 } from './S2187/index.js'; // no-empty-test-file -export { rule as S888 } from './S888/index.js'; // no-equals-in-for-termination -export { rule as S6426 } from './S6426/index.js'; // no-exclusive-tests -export { rule as S930 } from './S930/index.js'; // no-extra-arguments -export { rule as S4139 } from './S4139/index.js'; // no-for-in-iterable -export { rule as S1530 } from './S1530/index.js'; // no-function-declaration-in-block -export { rule as S2990 } from './S2990/index.js'; // no-global-this -export { rule as S2137 } from './S2137/index.js'; // no-globals-shadowing -export { rule as S2589 } from './S2589/index.js'; // no-gratuitous-expressions -export { rule as S1313 } from './S1313/index.js'; // no-hardcoded-ip -export { rule as S2068 } from './S2068/index.js'; // no-hardcoded-passwords -export { rule as S6418 } from './S6418/index.js'; // no-hardcoded-secrets -export { rule as S6442 } from './S6442/index.js'; // no-hook-setter-in-body -export { rule as S1862 } from './S1862/index.js'; // no-identical-conditions -export { rule as S1764 } from './S1764/index.js'; // no-identical-expressions -export { rule as S4144 } from './S4144/index.js'; // no-identical-functions -export { rule as S2486 } from './S2486/index.js'; // no-ignored-exceptions -export { rule as S2201 } from './S2201/index.js'; // no-ignored-return -export { rule as S4328 } from './S4328/index.js'; // no-implicit-dependencies -export { rule as S2703 } from './S2703/index.js'; // no-implicit-global -export { rule as S4619 } from './S4619/index.js'; // no-in-misuse -export { rule as S1940 } from './S1940/index.js'; // no-inverted-boolean-check -export { rule as S2970 } from './S2970/index.js'; // no-incomplete-assertions -export { rule as S3801 } from './S3801/index.js'; // no-inconsistent-returns -export { rule as S3402 } from './S3402/index.js'; // no-incorrect-string-concat -export { rule as S6627 } from './S6627/index.js'; // no-internal-api-use -export { rule as S5604 } from './S5604/index.js'; // no-intrusive-permissions -export { rule as S4123 } from './S4123/index.js'; // no-invalid-await -export { rule as S3516 } from './S3516/index.js'; // no-invariant-returns -export { rule as S5759 } from './S5759/index.js'; // no-ip-forward -export { rule as S1119 } from './S1119/index.js'; // no-labels -export { rule as S6958 } from './S6958/index.js'; // no-literal-call -export { rule as S5734 } from './S5734/index.js'; // no-mime-sniff -export { rule as S4043 } from './S4043/index.js'; // no-misleading-array-reverse -export { rule as S5730 } from './S5730/index.js'; // no-mixed-content -export { rule as S1121 } from './S1121/index.js'; // no-nested-assignment -export { rule as S3358 } from './S3358/index.js'; // no-nested-conditional -export { rule as S2004 } from './S2004/index.js'; // no-nested-functions -export { rule as S1821 } from './S1821/index.js'; // no-nested-switch -export { rule as S4624 } from './S4624/index.js'; // no-nested-template-literals -export { rule as S881 } from './S881/index.js'; // no-nested-incdec -export { rule as S1751 } from './S1751/index.js'; // no-one-iteration-loop -export { rule as S4036 } from './S4036/index.js'; // no-os-command-from-path -export { rule as S1226 } from './S1226/index.js'; // no-parameter-reassignment -export { rule as S1533 } from './S1533/index.js'; // no-primitive-wrappers -export { rule as S4165 } from './S4165/index.js'; // no-redundant-assignments -export { rule as S1125 } from './S1125/index.js'; // no-redundant-boolean -export { rule as S3626 } from './S3626/index.js'; // no-redundant-jump -export { rule as S4782 } from './S4782/index.js'; // no-redundant-optional -export { rule as S1110 } from './S1110/index.js'; // no-redundant-parentheses -export { rule as S3827 } from './S3827/index.js'; // no-reference-error -export { rule as S5736 } from './S5736/index.js'; // no-referrer-policy -export { rule as S3533 } from './S3533/index.js'; // no-require-or-define -export { rule as S4324 } from './S4324/index.js'; // no-return-type-any -export { rule as S5863 } from './S5863/index.js'; // no-same-argument-assert -export { rule as S3972 } from './S3972/index.js'; // no-same-line-conditional -export { rule as S1607 } from './S1607/index.js'; // no-skipped-tests -export { rule as S1301 } from './S1301/index.js'; // no-small-switch -export { rule as S1291 } from './S1291/index.js'; // no-sonar-comments -export { rule as S105 } from './S105/index.js'; // no-tab -export { rule as S5257 } from './S5257/index.js'; // no-table-as-layout -export { rule as S4822 } from './S4822/index.js'; // no-try-promise -export { rule as S4623 } from './S4623/index.js'; // no-undefined-argument -export { rule as S2138 } from './S2138/index.js'; // no-undefined-assignment -export { rule as S2681 } from './S2681/index.js'; // no-unenclosed-multiline-block -export { rule as S6486 } from './S6486/index.js'; // no-uniq-key -export { rule as S6791 } from './S6791/index.js'; // no-unsafe -export { rule as S5042 } from './S5042/index.js'; // no-unsafe-unzip -export { rule as S6478 } from './S6478/index.js'; // no-unstable-nested-components -export { rule as S3984 } from './S3984/index.js'; // no-unthrown-error -export { rule as S4030 } from './S4030/index.js'; // no-unused-collection -export { rule as S1172 } from './S1172/index.js'; // no-unused-function-argument -export { rule as S3699 } from './S3699/index.js'; // no-use-of-empty-return-value -export { rule as S2737 } from './S2737/index.js'; // no-useless-catch -export { rule as S2123 } from './S2123/index.js'; // no-useless-increment -export { rule as S4335 } from './S4335/index.js'; // no-useless-intersection -export { rule as S6443 } from './S6443/index.js'; // no-useless-react-setstate -export { rule as S1526 } from './S1526/index.js'; // no-variable-usage-before-declaration -export { rule as S6299 } from './S6299/index.js'; // no-vue-bypass-sanitization -export { rule as S5547 } from './S5547/index.js'; // no-weak-cipher -export { rule as S4426 } from './S4426/index.js'; // no-weak-keys -export { rule as S2208 } from './S2208/index.js'; // no-wildcard-import -export { rule as S2757 } from './S2757/index.js'; // non-existent-operator -export { rule as S3760 } from './S3760/index.js'; // non-number-in-arithmetic-expression -export { rule as S2259 } from './S2259/index.js'; // null-dereference -export { rule as S5264 } from './S5264/index.js'; // object-alt-content -export { rule as S3757 } from './S3757/index.js'; // operation-returning-nan -export { rule as S4721 } from './S4721/index.js'; // os-command -export { rule as S2819 } from './S2819/index.js'; // post-message -export { rule as S4524 } from './S4524/index.js'; // prefer-default-last -export { rule as S1488 } from './S1488/index.js'; // prefer-immediate-return -export { rule as S2428 } from './S2428/index.js'; // prefer-object-literal -export { rule as S4634 } from './S4634/index.js'; // prefer-promise-shorthand -export { rule as S1126 } from './S1126/index.js'; // prefer-single-boolean-return -export { rule as S4322 } from './S4322/index.js'; // prefer-type-guard -export { rule as S1264 } from './S1264/index.js'; // prefer-while -export { rule as S4823 } from './S4823/index.js'; // process-argv -export { rule as S4507 } from './S4507/index.js'; // production-debug -export { rule as S2245 } from './S2245/index.js'; // pseudo-random -export { rule as S1444 } from './S1444/index.js'; // public-static-readonly -export { rule as S5443 } from './S5443/index.js'; // publicly-writable-directories -export { rule as S6959 } from './S6959/index.js'; // reduce-initial-value -export { rule as S6564 } from './S6564/index.js'; // redundant-type-aliases -export { rule as S5843 } from './S5843/index.js'; // regex-complexity -export { rule as S4784 } from './S4784/index.js'; // regular-expr -export { rule as S5876 } from './S5876/index.js'; // session-regeneration -export { rule as S3499 } from './S3499/index.js'; // shorthand-property-grouping -export { rule as S6397 } from './S6397/index.js'; // single-char-in-character-classes -export { rule as S6035 } from './S6035/index.js'; // single-character-alternation -export { rule as S5852 } from './S5852/index.js'; // slow-regex -export { rule as S4818 } from './S4818/index.js'; // sockets -export { rule as S2392 } from './S2392/index.js'; // sonar-block-scoped-var -export { rule as S6439 } from './S6439/index.js'; // sonar-jsx-no-leaked-render -export { rule as S104 } from './S104/index.js'; // sonar-max-lines -export { rule as S138 } from './S138/index.js'; // sonar-max-lines-per-function -export { rule as S6324 } from './S6324/index.js'; // sonar-no-control-regex -export { rule as S2639 } from './S2639/index.js'; // sonar-no-empty-character-class -export { rule as S128 } from './S128/index.js'; // sonar-no-fallthrough -export { rule as S5856 } from './S5856/index.js'; // sonar-no-invalid-regexp -export { rule as S109 } from './S109/index.js'; // sonar-no-magic-numbers -export { rule as S5868 } from './S5868/index.js'; // sonar-no-misleading-character-class -export { rule as S6326 } from './S6326/index.js'; // sonar-no-regex-spaces -export { rule as S6441 } from './S6441/index.js'; // sonar-no-unused-class-component-methods -export { rule as S1481 } from './S1481/index.js'; // sonar-no-unused-vars -export { rule as S6582 } from './S6582/index.js'; // sonar-prefer-optional-chain -export { rule as S6759 } from './S6759/index.js'; // sonar-prefer-read-only-props -export { rule as S6594 } from './S6594/index.js'; // sonar-prefer-regexp-exec -export { rule as S2077 } from './S2077/index.js'; // sql-queries -export { rule as S5973 } from './S5973/index.js'; // stable-tests -export { rule as S4829 } from './S4829/index.js'; // standard-input -export { rule as S6351 } from './S6351/index.js'; // stateful-regex -export { rule as S5739 } from './S5739/index.js'; // strict-transport-security -export { rule as S3003 } from './S3003/index.js'; // strings-comparison -export { rule as S3854 } from './S3854/index.js'; // super-invocation -export { rule as S5256 } from './S5256/index.js'; // table-header -export { rule as S5260 } from './S5260/index.js'; // table-header-reference -export { rule as S5958 } from './S5958/index.js'; // test-check-exception -export { rule as S1135 } from './S1135/index.js'; // todo-tag -export { rule as S135 } from './S135/index.js'; // too-many-break-or-continue-in-loop -export { rule as S5867 } from './S5867/index.js'; // unicode-aware-regex -export { rule as S1128 } from './S1128/index.js'; // unused-import -export { rule as S5860 } from './S5860/index.js'; // unused-named-groups -export { rule as S4830 } from './S4830/index.js'; // unverified-certificate -export { rule as S5527 } from './S5527/index.js'; // unverified-hostname -export { rule as S3500 } from './S3500/index.js'; // updated-const-var -export { rule as S2310 } from './S2310/index.js'; // updated-loop-counter -export { rule as S4323 } from './S4323/index.js'; // use-type-alias -export { rule as S1154 } from './S1154/index.js'; // useless-string-operation -export { rule as S3758 } from './S3758/index.js'; // values-not-convertible-to-numbers -export { rule as S117 } from './S117/index.js'; // variable-name -export { rule as S3735 } from './S3735/index.js'; // void-use -export { rule as S4423 } from './S4423/index.js'; // weak-ssl -export { rule as S2817 } from './S2817/index.js'; // web-sql-database -export { rule as S5689 } from './S5689/index.js'; // x-powered-by -export { rule as S2755 } from './S2755/index.js'; // xml-parser-xxe -export { rule as S4817 } from './S4817/index.js'; // xpath -export { rule as S2301 } from './S2301/index.js'; diff --git a/packages/jsts/src/rules/plugin.ts b/packages/jsts/src/rules/plugin.ts index a24b782adbd..f6cae2b9cdc 100644 --- a/packages/jsts/src/rules/plugin.ts +++ b/packages/jsts/src/rules/plugin.ts @@ -18,344 +18,9 @@ * This is the entry point of the ESLint Plugin. * Said differently, this is the public API of the ESLint Plugin. */ -import type { Linter, Rule } from 'eslint'; +import type { Linter } from 'eslint'; -import * as originalRules from './original.js'; -import * as decoratedRules from './decorated.js'; - -export const rules: Record = { - 'anchor-precedence': originalRules.S5850, - 'argument-type': originalRules.S3782, - 'arguments-order': originalRules.S2234, - 'arguments-usage': originalRules.S3513, - 'array-callback-without-return': originalRules.S3796, - 'array-constructor': originalRules.S1528, - 'arrow-function-convention': originalRules.S3524, - 'assertions-in-tests': originalRules.S2699, - 'aws-apigateway-public-api': originalRules.S6333, - 'aws-ec2-rds-dms-public': originalRules.S6329, - 'aws-ec2-unencrypted-ebs-volume': originalRules.S6275, - 'aws-efs-unencrypted': originalRules.S6332, - 'aws-iam-all-privileges': originalRules.S6302, - 'aws-iam-all-resources-accessible': originalRules.S6304, - 'aws-iam-privilege-escalation': originalRules.S6317, - 'aws-iam-public-access': originalRules.S6270, - 'aws-opensearchservice-domain': originalRules.S6308, - 'aws-rds-unencrypted-databases': originalRules.S6303, - 'aws-restricted-ip-admin-access': originalRules.S6321, - 'aws-s3-bucket-granted-access': originalRules.S6265, - 'aws-s3-bucket-insecure-http': originalRules.S6249, - 'aws-s3-bucket-public-access': originalRules.S6281, - 'aws-s3-bucket-server-encryption': originalRules.S6245, - 'aws-s3-bucket-versioning': originalRules.S6252, - 'aws-sagemaker-unencrypted-notebook': originalRules.S6319, - 'aws-sns-unencrypted-topics': originalRules.S6327, - 'aws-sqs-unencrypted-queue': originalRules.S6330, - 'bitwise-operators': originalRules.S1529, - 'bool-param-default': originalRules.S4798, - 'call-argument-line': originalRules.S1472, - 'certificate-transparency': originalRules.S5742, - 'chai-determinate-assertion': originalRules.S6092, - 'class-name': originalRules.S101, - 'class-prototype': originalRules.S3525, - 'code-eval': originalRules.S1523, - 'cognitive-complexity': originalRules.S3776, - 'comma-or-logical-or-case': originalRules.S3616, - 'comment-regex': originalRules.S124, - 'concise-regex': originalRules.S6353, - 'conditional-indentation': originalRules.S3973, - 'confidential-information-logging': originalRules.S5757, - 'constructor-for-side-effects': originalRules.S1848, - 'content-length': originalRules.S5693, - 'content-security-policy': originalRules.S5728, - 'cookie-no-httponly': originalRules.S3330, - cookies: originalRules.S2255, - cors: originalRules.S5122, - csrf: originalRules.S4502, - 'cyclomatic-complexity': originalRules.S1541, - 'declarations-in-global-scope': originalRules.S3798, - deprecation: originalRules.S1874, - 'destructuring-assignment-syntax': originalRules.S3514, - 'different-types-comparison': originalRules.S3403, - 'disabled-auto-escaping': originalRules.S5247, - 'disabled-resource-integrity': originalRules.S5725, - 'disabled-timeout': originalRules.S6080, - 'dns-prefetching': originalRules.S5743, - 'duplicates-in-character-class': originalRules.S5869, - 'elseif-without-else': originalRules.S126, - 'empty-string-repetition': originalRules.S5842, - encryption: originalRules.S4787, - 'encryption-secure-mode': originalRules.S5542, - 'enforce-trailing-comma': originalRules.S3723, - 'existing-groups': originalRules.S6328, - 'expression-complexity': originalRules.S1067, - 'file-header': originalRules.S1451, - 'file-name-differ-from-class': originalRules.S3317, - 'file-permissions': originalRules.S2612, - 'file-uploads': originalRules.S2598, - 'fixme-tag': originalRules.S1134, - 'for-in': originalRules.S1535, - 'for-loop-increment-sign': originalRules.S2251, - 'frame-ancestors': originalRules.S5732, - 'function-inside-loop': originalRules.S1515, - 'function-name': originalRules.S100, - 'function-return-type': originalRules.S3800, - 'future-reserved-words': originalRules.S1527, - 'generator-without-yield': originalRules.S3531, - hashing: originalRules.S4790, - 'hidden-files': originalRules.S5691, - 'hook-use-state': originalRules.S6754, - 'in-operator-type-error': originalRules.S3785, - 'inconsistent-function-call': originalRules.S3686, - 'index-of-compare-to-positive-number': originalRules.S2692, - 'insecure-cookie': originalRules.S2092, - 'insecure-jwt-token': originalRules.S5659, - 'inverted-assertion-arguments': originalRules.S3415, - 'jsx-key': originalRules.S6477, - 'jsx-no-constructed-context-values': originalRules.S6481, - 'label-position': originalRules.S1439, - 'link-with-target-blank': originalRules.S5148, - 'max-switch-cases': originalRules.S1479, - 'max-union-size': originalRules.S4622, - 'misplaced-loop-counter': originalRules.S1994, - 'mouse-events-a11y': originalRules.S1082, - 'nested-control-flow': originalRules.S134, - 'new-operator-misuse': originalRules.S2999, - 'no-all-duplicated-branches': originalRules.S3923, - 'no-alphabetical-sort': originalRules.S2871, - 'no-angular-bypass-sanitization': originalRules.S6268, - 'no-array-delete': originalRules.S2870, - 'no-array-index-key': originalRules.S6479, - 'no-associative-arrays': originalRules.S3579, - 'no-async-constructor': originalRules.S7059, - 'no-built-in-override': originalRules.S2424, - 'no-case-label-in-switch': originalRules.S1219, - 'no-clear-text-protocols': originalRules.S5332, - 'no-code-after-done': originalRules.S6079, - 'no-collapsible-if': originalRules.S1066, - 'no-collection-size-mischeck': originalRules.S3981, - 'no-commented-code': originalRules.S125, - 'no-dead-store': originalRules.S1854, - 'no-delete-var': originalRules.S3001, - 'no-deprecated-react': originalRules.S6957, - 'no-duplicate-in-composite': originalRules.S4621, - 'no-duplicate-string': originalRules.S1192, - 'no-duplicated-branches': originalRules.S1871, - 'no-element-overwrite': originalRules.S4143, - 'no-empty-after-reluctant': originalRules.S6019, - 'no-empty-alternatives': originalRules.S6323, - 'no-empty-collection': originalRules.S4158, - 'no-empty-group': originalRules.S6331, - 'no-empty-test-file': originalRules.S2187, - 'no-equals-in-for-termination': originalRules.S888, - 'no-exclusive-tests': originalRules.S6426, - 'no-extra-arguments': originalRules.S930, - 'no-for-in-iterable': originalRules.S4139, - 'no-function-declaration-in-block': originalRules.S1530, - 'no-global-this': originalRules.S2990, - 'no-globals-shadowing': originalRules.S2137, - 'no-gratuitous-expressions': originalRules.S2589, - 'no-hardcoded-ip': originalRules.S1313, - 'no-hardcoded-passwords': originalRules.S2068, - 'no-hardcoded-secrets': originalRules.S6418, - 'no-hook-setter-in-body': originalRules.S6442, - 'no-identical-conditions': originalRules.S1862, - 'no-identical-expressions': originalRules.S1764, - 'no-identical-functions': originalRules.S4144, - 'no-ignored-exceptions': originalRules.S2486, - 'no-ignored-return': originalRules.S2201, - 'no-implicit-dependencies': originalRules.S4328, - 'no-implicit-global': originalRules.S2703, - 'no-in-misuse': originalRules.S4619, - 'no-incomplete-assertions': originalRules.S2970, - 'no-inconsistent-returns': originalRules.S3801, - 'no-incorrect-string-concat': originalRules.S3402, - 'no-internal-api-use': originalRules.S6627, - 'no-intrusive-permissions': originalRules.S5604, - 'no-invalid-await': originalRules.S4123, - 'no-invariant-returns': originalRules.S3516, - 'no-inverted-boolean-check': originalRules.S1940, - 'no-ip-forward': originalRules.S5759, - 'no-labels': originalRules.S1119, - 'no-literal-call': originalRules.S6958, - 'no-mime-sniff': originalRules.S5734, - 'no-misleading-array-reverse': originalRules.S4043, - 'no-mixed-content': originalRules.S5730, - 'no-nested-assignment': originalRules.S1121, - 'no-nested-conditional': originalRules.S3358, - 'no-nested-functions': originalRules.S2004, - 'no-nested-incdec': originalRules.S881, - 'no-nested-switch': originalRules.S1821, - 'no-nested-template-literals': originalRules.S4624, - 'no-one-iteration-loop': originalRules.S1751, - 'no-os-command-from-path': originalRules.S4036, - 'no-parameter-reassignment': originalRules.S1226, - 'no-primitive-wrappers': originalRules.S1533, - 'no-redundant-assignments': originalRules.S4165, - 'no-redundant-boolean': originalRules.S1125, - 'no-redundant-jump': originalRules.S3626, - 'no-redundant-optional': originalRules.S4782, - 'no-redundant-parentheses': originalRules.S1110, - 'no-reference-error': originalRules.S3827, - 'no-referrer-policy': originalRules.S5736, - 'no-require-or-define': originalRules.S3533, - 'no-return-type-any': originalRules.S4324, - 'no-same-argument-assert': originalRules.S5863, - 'no-same-line-conditional': originalRules.S3972, - 'no-selector-parameter': originalRules.S2301, - 'no-skipped-test': originalRules.S1607, - 'no-sonar-comments': originalRules.S1291, - 'no-small-switch': originalRules.S1301, - 'no-tab': originalRules.S105, - 'no-table-as-layout': originalRules.S5257, - 'no-try-promise': originalRules.S4822, - 'no-undefined-argument': originalRules.S4623, - 'no-undefined-assignment': originalRules.S2138, - 'no-unenclosed-multiline-block': originalRules.S2681, - 'no-uniq-key': originalRules.S6486, - 'no-unsafe': originalRules.S6791, - 'no-unsafe-unzip': originalRules.S5042, - 'no-unstable-nested-components': originalRules.S6478, - 'no-unthrown-error': originalRules.S3984, - 'no-unused-collection': originalRules.S4030, - 'no-unused-function-argument': originalRules.S1172, - 'no-use-of-empty-return-value': originalRules.S3699, - 'no-useless-catch': originalRules.S2737, - 'no-useless-increment': originalRules.S2123, - 'no-useless-intersection': originalRules.S4335, - 'no-useless-react-setstate': originalRules.S6443, - 'no-variable-usage-before-declaration': originalRules.S1526, - 'no-vue-bypass-sanitization': originalRules.S6299, - 'no-weak-cipher': originalRules.S5547, - 'no-weak-keys': originalRules.S4426, - 'no-wildcard-import': originalRules.S2208, - 'non-existent-operator': originalRules.S2757, - 'non-number-in-arithmetic-expression': originalRules.S3760, - 'null-dereference': originalRules.S2259, - 'object-alt-content': originalRules.S5264, - 'operation-returning-nan': originalRules.S3757, - 'os-command': originalRules.S4721, - 'post-message': originalRules.S2819, - 'prefer-default-last': originalRules.S4524, - 'prefer-immediate-return': originalRules.S1488, - 'prefer-object-literal': originalRules.S2428, - 'prefer-promise-shorthand': originalRules.S4634, - 'prefer-single-boolean-return': originalRules.S1126, - 'prefer-type-guard': originalRules.S4322, - 'prefer-while': originalRules.S1264, - 'process-argv': originalRules.S4823, - 'production-debug': originalRules.S4507, - 'pseudo-random': originalRules.S2245, - 'public-static-readonly': originalRules.S1444, - 'publicly-writable-directories': originalRules.S5443, - 'reduce-initial-value': originalRules.S6959, - 'redundant-type-aliases': originalRules.S6564, - 'regex-complexity': originalRules.S5843, - 'regular-expr': originalRules.S4784, - 'session-regeneration': originalRules.S5876, - 'shorthand-property-grouping': originalRules.S3499, - 'single-char-in-character-classes': originalRules.S6397, - 'single-character-alternation': originalRules.S6035, - 'slow-regex': originalRules.S5852, - sockets: originalRules.S4818, - 'sonar-block-scoped-var': originalRules.S2392, - 'sonar-jsx-no-leaked-render': originalRules.S6439, - 'sonar-max-lines': originalRules.S104, - 'sonar-max-lines-per-function': originalRules.S138, - 'sonar-no-control-regex': originalRules.S6324, - 'sonar-no-empty-character-class': originalRules.S2639, - 'sonar-no-fallthrough': originalRules.S128, - 'sonar-no-invalid-regexp': originalRules.S5856, - 'sonar-no-magic-numbers': originalRules.S109, - 'sonar-no-misleading-character-class': originalRules.S5868, - 'sonar-no-regex-spaces': originalRules.S6326, - 'sonar-no-unused-class-component-methods': originalRules.S6441, - 'sonar-no-unused-vars': originalRules.S1481, - 'sonar-prefer-optional-chain': originalRules.S6582, - 'sonar-prefer-read-only-props': originalRules.S6759, - 'sonar-prefer-regexp-exec': originalRules.S6594, - 'sql-queries': originalRules.S2077, - 'stable-tests': originalRules.S5973, - 'standard-input': originalRules.S4829, - 'stateful-regex': originalRules.S6351, - 'strict-transport-security': originalRules.S5739, - 'strings-comparison': originalRules.S3003, - 'super-invocation': originalRules.S3854, - 'table-header': originalRules.S5256, - 'table-header-reference': originalRules.S5260, - 'test-check-exception': originalRules.S5958, - 'todo-tag': originalRules.S1135, - 'too-many-break-or-continue-in-loop': originalRules.S135, - 'unicode-aware-regex': originalRules.S5867, - 'unused-import': originalRules.S1128, - 'unused-named-groups': originalRules.S5860, - 'unverified-certificate': originalRules.S4830, - 'unverified-hostname': originalRules.S5527, - 'updated-const-var': originalRules.S3500, - 'updated-loop-counter': originalRules.S2310, - 'use-type-alias': originalRules.S4323, - 'useless-string-operation': originalRules.S1154, - 'values-not-convertible-to-numbers': originalRules.S3758, - 'variable-name': originalRules.S117, - 'void-use': originalRules.S3735, - 'weak-ssl': originalRules.S4423, - 'web-sql-database': originalRules.S2817, - 'x-powered-by': originalRules.S5689, - 'xml-parser-xxe': originalRules.S2755, - xpath: originalRules.S4817, - - 'sonar-max-params': decoratedRules.S107, - 'no-unused-private-class-members': decoratedRules.S1068, - 'alt-text': decoratedRules.S1077, - 'brace-style': decoratedRules.S1105, - 'no-extra-semi': decoratedRules.S1116, - 'no-empty-function': decoratedRules.S1186, - 'switch-without-default': decoratedRules.S131, - semi: decoratedRules.S1438, - 'sonar-no-dupe-keys': decoratedRules.S1534, - 'no-unreachable': decoratedRules.S1763, - 'default-param-last': decoratedRules.S1788, - 'no-infinite-loop': decoratedRules.S2189, - 'accessor-pairs': decoratedRules.S2376, - 'new-cap': decoratedRules.S2430, - 'use-isnan': decoratedRules.S2688, - 'no-redeclare': decoratedRules.S2814, - 'object-shorthand': decoratedRules.S3498, - 'no-var': decoratedRules.S3504, - 'prefer-template': decoratedRules.S3512, - 'no-throw-literal': decoratedRules.S3696, - 'no-empty-interface': decoratedRules.S4023, - 'media-has-caption': decoratedRules.S4084, - 'prefer-for-of': decoratedRules.S4138, - 'prefer-namespace-keyword': decoratedRules.S4156, - 'no-accessor-field-mismatch': decoratedRules.S4275, - 'no-this-alias': decoratedRules.S4327, - 'html-has-lang': decoratedRules.S5254, - 'unnecessary-character-escapes': decoratedRules.S6535, - 'no-misused-promises': decoratedRules.S6544, - 'no-base-to-string': decoratedRules.S6551, - 'prefer-string-starts-ends-with': decoratedRules.S6557, - 'no-redundant-type-constituents': decoratedRules.S6571, - 'prefer-enum-initializers': decoratedRules.S6572, - 'prefer-function-type': decoratedRules.S6598, - 'prefer-nullish-coalescing': decoratedRules.S6606, - 'no-extend-native': decoratedRules.S6643, - 'no-useless-constructor': decoratedRules.S6647, - 'no-lonely-if': decoratedRules.S6660, - 'prefer-object-spread': decoratedRules.S6661, - 'prefer-spread': decoratedRules.S6666, - 'no-useless-call': decoratedRules.S6676, - 'no-self-compare': decoratedRules.S6679, - 'no-unknown-property': decoratedRules.S6747, - 'jsx-no-useless-fragment': decoratedRules.S6749, - 'no-find-dom-node': decoratedRules.S6788, - 'anchor-has-content': decoratedRules.S6827, - 'anchor-is-valid': decoratedRules.S6844, - 'label-has-associated-control': decoratedRules.S6853, - 'no-self-import': decoratedRules.S7060, - 'no-unused-expressions': decoratedRules.S905, - 'rules-of-hooks': decoratedRules.S6440, -}; +import { rules } from './plugin-rules.js'; const recommendedLegacyConfig: Linter.Config = { plugins: ['sonarjs'], rules: {} }; const recommendedConfig: Linter.FlatConfig & { @@ -397,4 +62,6 @@ export const meta = { version: '0.0.0-SNAPSHOT', }; +export { rules }; + export default { rules, configs, meta }; diff --git a/packages/jsts/src/rules/typescript-eslint/index.ts b/packages/jsts/src/rules/typescript-eslint/index.ts deleted file mode 100644 index cbe17211000..00000000000 --- a/packages/jsts/src/rules/typescript-eslint/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -import type { Rule } from 'eslint'; -import pkg from '@typescript-eslint/eslint-plugin'; -const { rules } = pkg; -import { sanitize } from './sanitize.js'; - -/** - * TypeScript ESLint rules that rely on type information fail at runtime because - * they unconditionally assume that TypeScript's type checker is available. - */ -const sanitized: Record = {}; -for (const ruleKey of Object.keys(rules)) { - sanitized[ruleKey] = sanitize(rules[ruleKey] as unknown as Rule.RuleModule); -} - -/** - * TypeScript ESLint rules. - */ -export const tsEslintRules = sanitized; diff --git a/packages/jsts/tests/linter/issues/message.test.ts b/packages/jsts/tests/linter/issues/message.test.ts index 7584d1214ca..674290be7cb 100644 --- a/packages/jsts/tests/linter/issues/message.test.ts +++ b/packages/jsts/tests/linter/issues/message.test.ts @@ -18,7 +18,7 @@ import { Linter, SourceCode } from 'eslint'; import { convertMessage } from '../../../src/linter/issues/message.js'; import path from 'path'; import { parseJavaScriptSourceFile } from '../../tools/index.js'; -import { S1116 } from '../../../src/rules/decorated.js'; +import { rule as S1116 } from '../../../src/rules/S1116/index.js'; import { describe, it, Mock, mock } from 'node:test'; import { expect } from 'expect'; diff --git a/packages/jsts/tests/parsers/ast.test.ts b/packages/jsts/tests/parsers/ast.test.ts index bcfafa41f9e..35543337e87 100644 --- a/packages/jsts/tests/parsers/ast.test.ts +++ b/packages/jsts/tests/parsers/ast.test.ts @@ -17,7 +17,7 @@ import path from 'path'; import { parsers, type ParseFunction } from '../../src/parsers/eslint.js'; -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { describe, test } from 'node:test'; import { expect } from 'expect'; import { readFile } from '../../../shared/src/helpers/files.js'; diff --git a/packages/jsts/tests/parsers/fixtures/ast/base.js b/packages/jsts/tests/parsers/fixtures/ast/base.js index e424266e495..ecbb3c3f313 100644 --- a/packages/jsts/tests/parsers/fixtures/ast/base.js +++ b/packages/jsts/tests/parsers/fixtures/ast/base.js @@ -4,18 +4,15 @@ * 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. + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. * * 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. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available 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. + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ */ let a = null; require('module-alias/register'); diff --git a/packages/jsts/tests/rules/index.test.ts b/packages/jsts/tests/rules/index.test.ts index e9bd9ef4b56..7050f2884db 100644 --- a/packages/jsts/tests/rules/index.test.ts +++ b/packages/jsts/tests/rules/index.test.ts @@ -14,7 +14,7 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { configs, rules, meta } from '../../src/rules/plugin.js'; +import { configs, meta } from '../../src/rules/plugin.js'; import fs from 'fs'; import path from 'path'; import { valid } from 'semver'; @@ -22,39 +22,75 @@ import { describe, it } from 'node:test'; import { expect } from 'expect'; import { pathToFileURL } from 'node:url'; -const mappedRules = new Map( - Object.entries(rules).map(([eslintId, rule]) => [rule.meta.docs.url, eslintId]), -); +const externalPlugins = [ + 'eslint', + 'typescript-eslint', + 'jsx-a11y', + 'import', + 'react', + 'react-hooks', +]; + +import { rules as a11yRules } from '../../src/rules/external/a11y.js'; +import { rules as reactRules } from '../../src/rules/external/react.js'; +import { getESLintCoreRule } from '../../src/rules/external/core.js'; +import { rules as tsEslintRules } from '../../src/rules/external/typescript-eslint/index.js'; +import { rules as importRules } from 'eslint-plugin-import'; +import { rules as reactHooksRules } from 'eslint-plugin-react-hooks'; + +const allExternalRules = { + eslint: key => getESLintCoreRule(key), + 'typescript-eslint': key => tsEslintRules[key], + 'jsx-a11y': key => a11yRules[key], + import: key => importRules[key], + react: key => reactRules[key], + 'react-hooks': key => reactHooksRules[key], +}; describe('Plugin public API', () => { it('should map keys to rules definitions', async () => { const ruleFolder = path.join(import.meta.dirname, '../../src/rules'); - const sonarKeys = fs.readdirSync(ruleFolder).filter(name => /^S\d+/.test(name)); - const missing = []; - for (const sonarKey of sonarKeys) { - const { rule } = await import( - pathToFileURL(path.join(ruleFolder, sonarKey, 'index.js')).toString() - ); - expect(rule.meta.docs!.url).toBe( - `https://sonarsource.github.io/rspec/#/rspec/${sonarKey}/javascript`, - ); - const { meta } = await import( - pathToFileURL(path.join(ruleFolder, sonarKey, 'meta.js')).toString() + const ruleIds = fs.readdirSync(ruleFolder).filter(name => /^S\d+/.test(name)); + const usedExternalEslintIds = []; + + for (const ruleId of ruleIds) { + const metadata = await import( + pathToFileURL(path.join(ruleFolder, ruleId, 'meta.js')).toString() ); - const eslintId = mappedRules.get(rule.meta.docs.url); - if (!eslintId) { - missing.push(sonarKey); - } else { - if (meta.docs.recommended) { - expect(configs.recommended.rules).toHaveProperty(`sonarjs/${eslintId}`); - expect(configs.recommended.rules[`sonarjs/${eslintId}`]).toEqual('error'); + expect(metadata.eslintId).toBeDefined(); + expect(metadata.sonarKey).toEqual(ruleId); + expect(['original', 'decorated', 'external']).toContain(metadata.implementation); + if (metadata.implementation === 'original') { + const { rule } = await import( + pathToFileURL(path.join(ruleFolder, metadata.sonarKey, 'index.js')).toString() + ); + expect(rule.meta.docs!.url).toBe( + `https://sonarsource.github.io/rspec/#/rspec/${metadata.sonarKey}/javascript`, + ); + if (metadata.meta.docs.recommended) { + expect(configs.recommended.rules).toHaveProperty(`sonarjs/${metadata.eslintId}`); + expect(configs.recommended.rules[`sonarjs/${metadata.eslintId}`]).toEqual('error'); } else { - expect(configs.recommended.rules[`sonarjs/${eslintId}`]).toEqual('off'); + expect(configs.recommended.rules[`sonarjs/${metadata.eslintId}`]).toEqual('off'); } - expect(configs.recommended.plugins!['sonarjs'].rules).toHaveProperty(eslintId); + expect(configs.recommended.plugins!['sonarjs'].rules).toHaveProperty(metadata.eslintId); + } else if (metadata.implementation === 'external') { + expect(externalPlugins).toContain(metadata.externalPlugin); + expect(usedExternalEslintIds).not.toContain(metadata.eslintId); + expect(allExternalRules[metadata.externalPlugin](metadata.eslintId)).toBeDefined(); + usedExternalEslintIds.push(metadata.eslintId); + } else if (metadata.implementation === 'decorated') { + expect(metadata.externalRules.length).toBeGreaterThan(0); + metadata.externalRules.forEach(externalRule => { + expect(usedExternalEslintIds).not.toContain(externalRule.externalRule); + usedExternalEslintIds.push(externalRule.externalRule); + expect(externalPlugins).toContain(externalRule.externalPlugin); + expect( + allExternalRules[externalRule.externalPlugin](externalRule.externalRule), + ).toBeDefined(); + }); } } - expect(missing).toHaveLength(0); }); it('should export legacy config', () => { diff --git a/packages/jsts/tests/rules/typescript-eslint/sanitize.test.ts b/packages/jsts/tests/rules/typescript-eslint/sanitize.test.ts index 5aa71e8637d..2966a3774a4 100644 --- a/packages/jsts/tests/rules/typescript-eslint/sanitize.test.ts +++ b/packages/jsts/tests/rules/typescript-eslint/sanitize.test.ts @@ -16,7 +16,7 @@ */ import pkg from '@typescript-eslint/eslint-plugin'; import { Linter } from 'eslint'; -import { sanitize } from '../../../src/rules/typescript-eslint/sanitize.js'; +import { sanitize } from '../../../src/rules/external/typescript-eslint/sanitize.js'; import path from 'path'; import { parseTypeScriptSourceFile } from '../../tools/helpers/index.js'; import { describe, test } from 'node:test'; diff --git a/pom.xml b/pom.xml index aef6d4f2942..40417fe5bb8 100644 --- a/pom.xml +++ b/pom.xml @@ -168,9 +168,9 @@ 2.6 - org.sonarsource.sslr - sslr-core - ${sslr.version} + org.sonarsource.sslr + sslr-core + ${sslr.version} org.sonarsource.sonarlint.core diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/.gitignore b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/.gitignore new file mode 100644 index 00000000000..446ce059fd2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/.gitignore @@ -0,0 +1 @@ +AllChecks.java diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AdjacentOverloadSignaturesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AdjacentOverloadSignaturesCheck.java deleted file mode 100644 index 57debf94b80..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AdjacentOverloadSignaturesCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4136") -public class AdjacentOverloadSignaturesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AlertUseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AlertUseCheck.java deleted file mode 100644 index b6666c6b263..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AlertUseCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S1442") -public class AlertUseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AlphabeticalSortCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AlphabeticalSortCheck.java deleted file mode 100644 index 72cde96ec88..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AlphabeticalSortCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2871") -public class AlphabeticalSortCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AltTextCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AltTextCheck.java deleted file mode 100644 index 3e1d0a4487f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AltTextCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S1077") -public class AltTextCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AlwaysUseCurlyBracesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AlwaysUseCurlyBracesCheck.java deleted file mode 100644 index 766abf20868..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AlwaysUseCurlyBracesCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "CurlyBraces") -@Rule(key = "S121") -public class AlwaysUseCurlyBracesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AnchorHasContentCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AnchorHasContentCheck.java deleted file mode 100644 index 3785b23a03c..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AnchorHasContentCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6827") -public class AnchorHasContentCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AnchorIsValidCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AnchorIsValidCheck.java deleted file mode 100644 index f87bc2204a1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AnchorIsValidCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6844") -public class AnchorIsValidCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AnchorPrecedenceCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AnchorPrecedenceCheck.java deleted file mode 100644 index 79ead55f4ad..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AnchorPrecedenceCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5850") -public class AnchorPrecedenceCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AngleBracketTypeAssertionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AngleBracketTypeAssertionCheck.java deleted file mode 100644 index e690b06b821..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AngleBracketTypeAssertionCheck.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4137") -public class AngleBracketTypeAssertionCheck extends Check { - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - - - private static class Config { - - String assertionStyle = "as"; - String objectLiteralTypeAssertions = "allow"; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArgumentTypesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArgumentTypesCheck.java deleted file mode 100644 index bc7ab028693..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArgumentTypesCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3782") -public class ArgumentTypesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArgumentsCallerCalleeUsageCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArgumentsCallerCalleeUsageCheck.java deleted file mode 100644 index 7e6eaf4a432..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArgumentsCallerCalleeUsageCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2685") -public class ArgumentsCallerCalleeUsageCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArgumentsUsageCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArgumentsUsageCheck.java deleted file mode 100644 index b1392556ba3..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArgumentsUsageCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3513") -public class ArgumentsUsageCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AriaActivedescendantHasTabindexCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AriaActivedescendantHasTabindexCheck.java deleted file mode 100644 index bfa9d4429b9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AriaActivedescendantHasTabindexCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6823") -public class AriaActivedescendantHasTabindexCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AriaProptypesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AriaProptypesCheck.java deleted file mode 100644 index 59ecc126a0a..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AriaProptypesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6793") -public class AriaProptypesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AriaRoleCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AriaRoleCheck.java deleted file mode 100644 index a48604e80a2..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AriaRoleCheck.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6821") -public class AriaRoleCheck extends Check { - - - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - private static class Config { - - boolean ignoreNonDOM = true; - String[] allowedInvalidRoles = { "text" }; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AriaUnsupportedElementsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AriaUnsupportedElementsCheck.java deleted file mode 100644 index 4f7f56321b7..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AriaUnsupportedElementsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6824") -public class AriaUnsupportedElementsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArithmeticOperationReturningNanCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArithmeticOperationReturningNanCheck.java deleted file mode 100644 index a07819cb6b2..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArithmeticOperationReturningNanCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3757") -public class ArithmeticOperationReturningNanCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArrayCallbackWithoutReturnCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArrayCallbackWithoutReturnCheck.java deleted file mode 100644 index 8302028762d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArrayCallbackWithoutReturnCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3796") -public class ArrayCallbackWithoutReturnCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArrayConstructorsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArrayConstructorsCheck.java deleted file mode 100644 index d876099cbf5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArrayConstructorsCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1528") -@DeprecatedRuleKey(ruleKey = "ArrayAndObjectConstructors") -public class ArrayConstructorsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArrowFunctionConventionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArrowFunctionConventionCheck.java deleted file mode 100644 index 744f1163e50..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ArrowFunctionConventionCheck.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3524") -public class ArrowFunctionConventionCheck extends Check { - - private static final boolean DEFAULT_PARAMETER_PARENS = false; - private static final boolean DEFAULT_BODY_BRACES = false; - - @RuleProperty( - key = "parameter_parens", - description = "True to require parentheses around parameters. False to forbid them for single parameter.", - defaultValue = "" + DEFAULT_PARAMETER_PARENS - ) - boolean parameterParens = DEFAULT_PARAMETER_PARENS; - - @RuleProperty( - key = "body_braces", - description = "True to require curly braces around function body. False to forbid them for single-return bodies.", - defaultValue = "" + DEFAULT_BODY_BRACES - ) - boolean bodyBraces = DEFAULT_BODY_BRACES; - - - - @Override - public List configurations() { - return Collections.singletonList(new Config(parameterParens, bodyBraces)); - } - - private static class Config { - - boolean requireParameterParentheses; - boolean requireBodyBraces; - - Config(boolean requireParameterParentheses, boolean requireBodyBraces) { - this.requireParameterParentheses = requireParameterParentheses; - this.requireBodyBraces = requireBodyBraces; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AssertionsInTestsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AssertionsInTestsCheck.java deleted file mode 100644 index 7a5e7485b35..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AssertionsInTestsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TestFileCheck; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2699") -public class AssertionsInTestsCheck extends TestFileCheck { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AssociativeArraysCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AssociativeArraysCheck.java deleted file mode 100644 index 75559922617..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AssociativeArraysCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3579") -public class AssociativeArraysCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AutocompleteValidCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AutocompleteValidCheck.java deleted file mode 100644 index 39c221049ec..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AutocompleteValidCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6840") -public class AutocompleteValidCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsApigatewayPublicApiCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsApigatewayPublicApiCheck.java deleted file mode 100644 index 1cece76a2bd..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsApigatewayPublicApiCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6333") -public class AwsApigatewayPublicApiCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsEc2RdsDmsPublicCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsEc2RdsDmsPublicCheck.java deleted file mode 100644 index a6f6b6263b0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsEc2RdsDmsPublicCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6329") -public class AwsEc2RdsDmsPublicCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsEc2UnencryptedEbsVolumeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsEc2UnencryptedEbsVolumeCheck.java deleted file mode 100644 index d4457ef96ba..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsEc2UnencryptedEbsVolumeCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6275") -public class AwsEc2UnencryptedEbsVolumeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsEfsUnencryptedCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsEfsUnencryptedCheck.java deleted file mode 100644 index d58519abfaf..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsEfsUnencryptedCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6332") -public class AwsEfsUnencryptedCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsIamAllPrivilegesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsIamAllPrivilegesCheck.java deleted file mode 100644 index 6e7b3ccce12..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsIamAllPrivilegesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6302") -public class AwsIamAllPrivilegesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsIamAllResourcesAccessibleCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsIamAllResourcesAccessibleCheck.java deleted file mode 100644 index 5badab4cefc..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsIamAllResourcesAccessibleCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6304") -public class AwsIamAllResourcesAccessibleCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsIamPrivilegeEscalationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsIamPrivilegeEscalationCheck.java deleted file mode 100644 index 1a07d57c2ca..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsIamPrivilegeEscalationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6317") -public class AwsIamPrivilegeEscalationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsIamPublicAccessCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsIamPublicAccessCheck.java deleted file mode 100644 index 426a73aa7c4..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsIamPublicAccessCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6270") -public class AwsIamPublicAccessCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsOpenSearchServiceDomainCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsOpenSearchServiceDomainCheck.java deleted file mode 100644 index 853de390c57..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsOpenSearchServiceDomainCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6308") -public class AwsOpenSearchServiceDomainCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsRdsUnencryptedDatabasesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsRdsUnencryptedDatabasesCheck.java deleted file mode 100644 index a8e983073a6..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsRdsUnencryptedDatabasesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6303") -public class AwsRdsUnencryptedDatabasesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsRestrictedIpAdminAccessCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsRestrictedIpAdminAccessCheck.java deleted file mode 100644 index 8da5f6c3744..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsRestrictedIpAdminAccessCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6321") -public class AwsRestrictedIpAdminAccessCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketGrantedAccessCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketGrantedAccessCheck.java deleted file mode 100644 index e39921c84ab..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketGrantedAccessCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6265") -public class AwsS3BucketGrantedAccessCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketInsecureHttpCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketInsecureHttpCheck.java deleted file mode 100644 index 409fcb1099f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketInsecureHttpCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6249") -public class AwsS3BucketInsecureHttpCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketPublicAccessCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketPublicAccessCheck.java deleted file mode 100644 index 950eb8b1823..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketPublicAccessCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6281") -public class AwsS3BucketPublicAccessCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketServerEncryptionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketServerEncryptionCheck.java deleted file mode 100644 index c92dc89017f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketServerEncryptionCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6245") -public class AwsS3BucketServerEncryptionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketVersioningCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketVersioningCheck.java deleted file mode 100644 index e9404e10455..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsS3BucketVersioningCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6252") -public class AwsS3BucketVersioningCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsSagemakerUnencryptedNotebookCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsSagemakerUnencryptedNotebookCheck.java deleted file mode 100644 index 01c87c0a196..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsSagemakerUnencryptedNotebookCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6319") -public class AwsSagemakerUnencryptedNotebookCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsSnsUnencryptedTopicsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsSnsUnencryptedTopicsCheck.java deleted file mode 100644 index e56a63d5482..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsSnsUnencryptedTopicsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6327") -public class AwsSnsUnencryptedTopicsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsSqsUnencryptedQueueCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsSqsUnencryptedQueueCheck.java deleted file mode 100644 index 8f2cf8b7786..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AwsSqsUnencryptedQueueCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6330") -public class AwsSqsUnencryptedQueueCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/BitwiseOperatorsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/BitwiseOperatorsCheck.java deleted file mode 100644 index f21c343f428..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/BitwiseOperatorsCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "BitwiseOperators") -@Rule(key = "S1529") -public class BitwiseOperatorsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/BoolParamDefaultCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/BoolParamDefaultCheck.java deleted file mode 100644 index a75b9d076b2..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/BoolParamDefaultCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4798") -public class BoolParamDefaultCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/BooleanEqualityComparisonCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/BooleanEqualityComparisonCheck.java deleted file mode 100644 index 2d7abc63577..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/BooleanEqualityComparisonCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1125") -public class BooleanEqualityComparisonCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/BuiltInObjectOverriddenCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/BuiltInObjectOverriddenCheck.java deleted file mode 100644 index 78be83c7de8..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/BuiltInObjectOverriddenCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2424") -public class BuiltInObjectOverriddenCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CertificateTransparencyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CertificateTransparencyCheck.java deleted file mode 100644 index c486564afa0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CertificateTransparencyCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5742") -public class CertificateTransparencyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ChaiDeterminateAssertionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ChaiDeterminateAssertionCheck.java deleted file mode 100644 index 9b42195b4c3..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ChaiDeterminateAssertionCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TestFileCheck; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6092") -public class ChaiDeterminateAssertionCheck extends TestFileCheck { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CheckList.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CheckList.java index 6a29ed2d353..eb4fad9009a 100644 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CheckList.java +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CheckList.java @@ -17,7 +17,6 @@ package org.sonar.javascript.checks; import java.lang.annotation.Annotation; -import java.util.Arrays; import java.util.List; import org.sonar.plugins.javascript.api.JavaScriptCheck; import org.sonar.plugins.javascript.api.JavaScriptRule; @@ -48,451 +47,6 @@ private static List> filterChecksByAnnotation( } public static List> getAllChecks() { - return Arrays.asList( - AdjacentOverloadSignaturesCheck.class, - AlertUseCheck.class, - AlphabeticalSortCheck.class, - AltTextCheck.class, - AlwaysUseCurlyBracesCheck.class, - AnchorHasContentCheck.class, - AnchorIsValidCheck.class, - AnchorPrecedenceCheck.class, - AngleBracketTypeAssertionCheck.class, - ArgumentTypesCheck.class, - ArgumentsCallerCalleeUsageCheck.class, - ArgumentsUsageCheck.class, - AriaActivedescendantHasTabindexCheck.class, - AriaProptypesCheck.class, - AriaRoleCheck.class, - AriaUnsupportedElementsCheck.class, - ArithmeticOperationReturningNanCheck.class, - ArrayCallbackWithoutReturnCheck.class, - ArrayConstructorsCheck.class, - ArrowFunctionConventionCheck.class, - AssertionsInTestsCheck.class, - AssociativeArraysCheck.class, - AutocompleteValidCheck.class, - AwsApigatewayPublicApiCheck.class, - AwsEc2RdsDmsPublicCheck.class, - AwsEc2UnencryptedEbsVolumeCheck.class, - AwsEfsUnencryptedCheck.class, - AwsIamAllPrivilegesCheck.class, - AwsIamAllResourcesAccessibleCheck.class, - AwsIamPrivilegeEscalationCheck.class, - AwsIamPublicAccessCheck.class, - AwsOpenSearchServiceDomainCheck.class, - AwsRdsUnencryptedDatabasesCheck.class, - AwsRestrictedIpAdminAccessCheck.class, - AwsS3BucketGrantedAccessCheck.class, - AwsS3BucketInsecureHttpCheck.class, - AwsS3BucketPublicAccessCheck.class, - AwsS3BucketServerEncryptionCheck.class, - AwsS3BucketVersioningCheck.class, - AwsSagemakerUnencryptedNotebookCheck.class, - AwsSnsUnencryptedTopicsCheck.class, - AwsSqsUnencryptedQueueCheck.class, - BitwiseOperatorsCheck.class, - BoolParamDefaultCheck.class, - BooleanEqualityComparisonCheck.class, - BuiltInObjectOverriddenCheck.class, - CertificateTransparencyCheck.class, - ChaiDeterminateAssertionCheck.class, - ClassNameCheck.class, - ClassPrototypeCheck.class, - CognitiveComplexityFunctionCheck.class, - CollapsibleIfStatementsCheck.class, - CollectionSizeComparisonCheck.class, - CommaOperatorInSwitchCaseCheck.class, - CommaOperatorUseCheck.class, - CommentRegularExpressionCheck.class, - CommentedCodeCheck.class, - ComparisonWithNaNCheck.class, - ConciseRegexCheck.class, - ConditionalIndentationCheck.class, - ConditionalOperatorCheck.class, - ConfidentialInformationLoggingCheck.class, - ConsistentReturnsCheck.class, - ConsoleLoggingCheck.class, - ConstructorFunctionsForSideEffectsCheck.class, - ContentLengthCheck.class, - ContentSecurityPolicyCheck.class, - ContinueStatementCheck.class, - CookieNoHttpOnlyCheck.class, - CookiesCheck.class, - CorsCheck.class, - CounterUpdatedInLoopCheck.class, - CsrfCheck.class, - CyclomaticComplexityJavaScriptCheck.class, - CyclomaticComplexityTypeScriptCheck.class, - DeadStoreCheck.class, - DebuggerStatementCheck.class, - DeclarationInGlobalScopeCheck.class, - DefaultParametersNotLastCheck.class, - DefaultPropsMatchPropTypesCheck.class, - DeleteNonPropertyCheck.class, - DeprecationCheck.class, - DestructuringAssignmentSyntaxCheck.class, - DifferentTypesComparisonCheck.class, - DisabledAutoEscapingCheck.class, - DisabledResourceIntegrityCheck.class, - DisabledTimeoutCheck.class, - DnsPrefetchingCheck.class, - DuplicateAllBranchImplementationCheck.class, - DuplicateBranchImplementationCheck.class, - DuplicateConditionIfCheck.class, - DuplicateFunctionArgumentCheck.class, - DuplicatePropertyNameCheck.class, - DuplicatesInCharacterClassCheck.class, - ElseIfWithoutElseCheck.class, - EmptyBlockCheck.class, - EmptyCharacterClassesCheck.class, - EmptyDestructuringPatternCheck.class, - EmptyFunctionCheck.class, - EmptyStatementCheck.class, - EmptyStringRepetitionCheck.class, - EncryptionCheck.class, - EncryptionSecureModeCheck.class, - EqEqEqCheck.class, - EqualInForLoopTerminationCheck.class, - ErrorWithoutThrowCheck.class, - EvalCheck.class, - ExistingGroupsCheck.class, - ExpressionComplexityCheck.class, - FileHeaderCheck.class, - FileNameDiffersFromClassCheck.class, - FilePermissionsCheck.class, - FileUploadsCheck.class, - FixmeTagPresenceCheck.class, - ForHidingWhileCheck.class, - ForInCheck.class, - ForLoopConditionAndUpdateCheck.class, - ForLoopIncrementSignCheck.class, - FrameAncestorsCheck.class, - FunctionCallArgumentsOnNewLineCheck.class, - FunctionConstructorCheck.class, - FunctionDeclarationsWithinBlocksCheck.class, - FunctionDefinitionInsideLoopCheck.class, - FunctionNameCheck.class, - FunctionReturnTypeCheck.class, - FutureReservedWordsCheck.class, - GeneratorWithoutYieldCheck.class, - GetterSetterCheck.class, - GlobalThisCheck.class, - GlobalsShadowingCheck.class, - GratuitousConditionCheck.class, - HashingCheck.class, - HeadingHasContentCheck.class, - HiddenFilesCheck.class, - HookUseStateCheck.class, - HtmlHasLangCheck.class, - IdenticalExpressionOnBinaryOperatorCheck.class, - IdenticalFunctionsCheck.class, - IframeHasTitleCheck.class, - IgnoredReturnCheck.class, - ImgRedundantAltCheck.class, - ImmediatelyReturnedVariableCheck.class, - ImplicitDependenciesCheck.class, - InOperatorTypeErrorCheck.class, - InconsistentFunctionCallCheck.class, - IncrementDecrementInSubExpressionCheck.class, - IndexOfCompareToPositiveNumberCheck.class, - InsecureCookieCheck.class, - InsecureJwtTokenCheck.class, - InstanceofInMisuseCheck.class, - InteractiveElementsShouldBeFocusableCheck.class, - IntrusivePermissionsCheck.class, - InvariantReturnCheck.class, - InvertedAssertionArgumentsCheck.class, - IpForwardCheck.class, - JsxChildElementSpacingCheck.class, - JsxKeyCheck.class, - JsxNoBindCheck.class, - JsxNoCommentTextnodesCheck.class, - JsxNoConstructedContextValuesCheck.class, - JsxNoLeakedRenderCheck.class, - JsxNoUselessFragmentCheck.class, - JsxPascalCaseCheck.class, - JumpStatementInFinallyCheck.class, - LabelHasAssociatedControlCheck.class, - LabelPlacementCheck.class, - LabelledStatementCheck.class, - LineLengthCheck.class, - LinkWithTargetBlankCheck.class, - LoopsShouldNotBeInfiniteCheck.class, - MaxParameterCheck.class, - MaxSwitchCasesCheck.class, - MaxUnionSizeCheck.class, - MediaHasCaptionCheck.class, - MisorderedParameterListCheck.class, - MissingNewlineAtEndOfFileCheck.class, - MissingTrailingCommaCheck.class, - MouseEventsA11YCheck.class, - MultilineBlockCurlyBraceCheck.class, - MultilineStringLiteralsCheck.class, - NestedAssignmentCheck.class, - NestedConditionalOperatorsCheck.class, - NestedControlFlowDepthCheck.class, - NewCapCheck.class, - NewOperatorMisuseCheck.class, - NoAbsolutePathCheck.class, - NoAccessKeyCheck.class, - NoAccessStateInSetstateCheck.class, - NoAccessorFieldMismatchCheck.class, - NoAngularBypassSanitizationCheck.class, - NoAnyCheck.class, - NoAriaHiddenOnFocusableCheck.class, - NoArrayDeleteCheck.class, - NoArrayIndexKeyCheck.class, - NoAsyncConstructorCheck.class, - NoBaseToStringCheck.class, - NoCaseDeclarationsCheck.class, - NoChildrenPropCheck.class, - NoClearTextProtocolsCheck.class, - NoCodeAfterDoneCheck.class, - NoConfusingNonNullAssertionCheck.class, - NoConstantBinaryExpressionCheck.class, - NoConstructorReturnCheck.class, - NoControlRegexCheck.class, - NoDangerWithChildrenCheck.class, - NoDeprecatedReactCheck.class, - NoDirectMutationStateCheck.class, - NoDuplicateEnumValuesCheck.class, - NoDuplicateImportsCheck.class, - NoDuplicateInCompositeCheck.class, - NoDuplicateStringCheck.class, - NoElementOverwriteCheck.class, - NoEmptyAfterReluctantCheck.class, - NoEmptyAlternativesCheck.class, - NoEmptyClassCheck.class, - NoEmptyCollectionCheck.class, - NoEmptyGroupCheck.class, - NoEmptyInterfaceCheck.class, - NoEmptyTestFileCheck.class, - NoExclusiveTestsCheck.class, - NoExtendNativeCheck.class, - NoExtraBindCheck.class, - NoExtraBooleanCastCheck.class, - NoFindDomNodeCheck.class, - NoForInArrayCheck.class, - NoHardcodedIpCheck.class, - NoHardcodedPasswordsCheck.class, - NoHardcodedSecretsCheck.class, - NoHookSetterInBodyCheck.class, - NoIgnoredExceptionsCheck.class, - NoImportAssignCheck.class, - NoInMisuseCheck.class, - NoIncompleteAssertionsCheck.class, - NoInferrableTypesCheck.class, - NoInteractiveElementToNoninteractiveRoleCheck.class, - NoInternalApiUseCheck.class, - NoInvalidAwaitCheck.class, - NoInvertedBooleanCheckCheck.class, - NoIsMountedCheck.class, - NoLiteralCallCheck.class, - NoLoneBlocksCheck.class, - NoLonelyIfCheck.class, - NoLossOfPrecisionCheck.class, - NoMagicNumbersCheck.class, - NoMimeSniffCheck.class, - NoMisleadingArrayReverseCheck.class, - NoMisusedNewCheck.class, - NoMisusedPromisesCheck.class, - NoMixedContentCheck.class, - NoMixedEnumsCheck.class, - NoMutableExportsCheck.class, - NoNestedFunctionsCheck.class, - NoNestedSwitchCheck.class, - NoNestedTemplateLiteralsCheck.class, - NoNewNativeNonconstructorCheck.class, - NoNonInteractiveElementsWithHandlersCheck.class, - NoNonNullAssertionCheck.class, - NoNoninteractiveElementToInteractiveRoleCheck.class, - NoNoninteractiveTabindexCheck.class, - NoOctalEscapeCheck.class, - NoOneIterationLoopCheck.class, - NoOsCommandsFromPathCheck.class, - NoProtoCheck.class, - NoRedundantJumpCheck.class, - NoRedundantOptionalCheck.class, - NoRedundantRolesCheck.class, - NoRedundantShouldComponentUpdateCheck.class, - NoRedundantTypeConstituentsCheck.class, - NoReferrerPolicyCheck.class, - NoRegexSpacesCheck.class, - NoRenderReturnValueCheck.class, - NoReturnAwaitCheck.class, - NoReturnTypeAnyCheck.class, - NoSameArgumentAssertCheck.class, - NoSelfCompareCheck.class, - NoSelfImportCheck.class, - NoSkippedTestsCheck.class, - NoSonarCommentsCheck.class, - NoSparseArraysCheck.class, - NoStaticElementInteractionsCheck.class, - NoStringRefsCheck.class, - NoTableAsLayoutCheck.class, - NoThisAliasCheck.class, - NoThisInSfcCheck.class, - NoUndefInitCheck.class, - NoUnescapedEntitiesCheck.class, - NoUniqKeyCheck.class, - NoUnknownPropertyCheck.class, - NoUnnecessaryTypeAssertionCheck.class, - NoUnnecessaryTypeConstraintCheck.class, - NoUnneededTernaryCheck.class, - NoUnsafeCheck.class, - NoUnsafeOptionalChainingCheck.class, - NoUnstableNestedComponentsCheck.class, - NoUnusedClassComponentMethodsCheck.class, - NoUnusedPrivateClassMembersCheck.class, - NoUnusedPropTypesCheck.class, - NoUselessCallCheck.class, - NoUselessCatchCheck.class, - NoUselessConstructorCheck.class, - NoUselessReactSetstateCheck.class, - NoUselessRenameCheck.class, - NoVueBypassSanitizationCheck.class, - NoWeakCipherCheck.class, - NoWeakKeysCheck.class, - NonCaseLabelInSwitchCheck.class, - NonEmptyCaseWithoutBreakCheck.class, - NonExistentAssignmentOperatorCheck.class, - NonNumberInArithmeticExpressionCheck.class, - NonStandardImportCheck.class, - NullDereferenceCheck.class, - OSCommandCheck.class, - ObjectAltContentCheck.class, - ObjectLiteralShorthandCheck.class, - OctalNumberCheck.class, - OneStatementPerLineCheck.class, - OpenCurlyBracesAtEOLCheck.class, - ParenthesesCheck.class, - ParseIntCallWithoutBaseCheck.class, - ParsingErrorCheck.class, - PostMessageCheck.class, - PreferAsConstCheck.class, - PreferDefaultLastCheck.class, - PreferEnumInitializersCheck.class, - PreferForOfCheck.class, - PreferFunctionTypeCheck.class, - PreferLiteralEnumMemberCheck.class, - PreferNamespaceCheck.class, - PreferNullishCoalescingCheck.class, - PreferObjectHasOwnCheck.class, - PreferObjectLiteralCheck.class, - PreferObjectSpreadCheck.class, - PreferPromiseRejectErrorsCheck.class, - PreferPromiseShorthandCheck.class, - PreferReadOnlyPropsCheck.class, - PreferReadonlyCheck.class, - PreferRegexLiteralsCheck.class, - PreferRegexpExecCheck.class, - PreferReturnThisTypeCheck.class, - PreferSpreadCheck.class, - PreferStringStartsEndsWithCheck.class, - PreferTagOverRoleCheck.class, - PreferTypeGuardCheck.class, - PrimitiveWrappersCheck.class, - ProcessArgvCheck.class, - ProductionDebugCheck.class, - PropTypesCheck.class, - PseudoRandomCheck.class, - PublicStaticReadonlyCheck.class, - PubliclyWritableDirectoriesCheck.class, - ReassignedParameterCheck.class, - RedeclaredSymbolCheck.class, - ReduceInitialValueCheck.class, - RedundantAssignmentCheck.class, - RedundantTypeAliasesCheck.class, - ReferenceErrorCheck.class, - RegexComplexityCheck.class, - RegularExprCheck.class, - RequireRenderReturnCheck.class, - ReturnInSetterCheck.class, - ReturnOfBooleanExpressionCheck.class, - RoleHasRequiredAriaPropsCheck.class, - RoleSupportsAriaPropsCheck.class, - RulesOfHooksCheck.class, - SameLineConditionalCheck.class, - SelfAssignmentCheck.class, - SemicolonCheck.class, - SessionRegenerationCheck.class, - ShorthandPropertiesNotGroupedCheck.class, - SingleCharInCharacterClassesCheck.class, - SingleCharacterAlternativeCheck.class, - SlowRegexCheck.class, - SocketsCheck.class, - SonarNoInvalidRegexCheck.class, - SonarNoMisleadingCharacterClassCheck.class, - SonarPreferOptionalChainCheck.class, - SqlQueriesCheck.class, - StableTestsCheck.class, - StandardInputCheck.class, - StatefulRegexCheck.class, - StrictModeCheck.class, - StrictTransportSecurityCheck.class, - StringConcatenatedWithNonStringCheck.class, - StringConcatenationCheck.class, - StringLiteralsQuotesCheck.class, - StringsComparisonCheck.class, - SuperInvocationCheck.class, - SwitchWithNotEnoughCaseCheck.class, - SwitchWithoutDefaultCheck.class, - TabCharacterCheck.class, - TabindexNoPositiveCheck.class, - TableHeaderCheck.class, - TableHeaderReferenceCheck.class, - TemplateStringMisuseCheck.class, - TestCheckExceptionCheck.class, - ThrowLiteralCheck.class, - TodoTagPresenceCheck.class, - TooManyArgumentsCheck.class, - TooManyBreakOrContinueInLoopCheck.class, - TooManyLinesInFileCheck.class, - TooManyLinesInFunctionCheck.class, - TrailingCommaCheck.class, - TrailingCommentCheck.class, - TrailingWhitespaceCheck.class, - TryPromiseCheck.class, - UnchangedLetVariableCheck.class, - UndefinedArgumentCheck.class, - UndefinedAssignmentCheck.class, - UnicodeAwareRegexCheck.class, - UnnecessaryCharacterEscapesCheck.class, - UnnecessaryTypeArgumentsCheck.class, - UnreachableCodeCheck.class, - UnsafeUnzipCheck.class, - UnusedCollectionCheck.class, - UnusedFunctionArgumentCheck.class, - UnusedImportCheck.class, - UnusedNamedGroupsCheck.class, - UnusedVariableCheck.class, - UnverifiedCertificateCheck.class, - UnverifiedHostnameCheck.class, - UpdatedConstVariableCheck.class, - UseOfEmptyReturnValueCheck.class, - UseTypeAliasCheck.class, - UselessExpressionStatementCheck.class, - UselessIncrementCheck.class, - UselessIntersectionCheck.class, - UselessStringOperationCheck.class, - ValidTypeOfCheck.class, - ValuesNotConvertibleToNumbersCheck.class, - VarDeclarationCheck.class, - VariableDeclarationAfterUsageCheck.class, - VariableDeclarationWithoutVarCheck.class, - VariableNameCheck.class, - VariableShadowingCheck.class, - VoidUseCheck.class, - WeakSslCheck.class, - WebSQLDatabaseCheck.class, - WildcardImportCheck.class, - WithStatementCheck.class, - WrongScopeDeclarationCheck.class, - XMLParserXXEVulnerableCheck.class, - XPoweredByCheck.class, - XpathCheck.class, - S2301Check.class - ); + return AllChecks.rules; } } diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ClassNameCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ClassNameCheck.java deleted file mode 100644 index 087ad4ca9ac..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ClassNameCheck.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S101") -public class ClassNameCheck extends Check { - - private static final String DEFAULT_FORMAT = "^[A-Z][a-zA-Z0-9]*$"; - - @RuleProperty( - key = "format", - description = "Regular expression used to check the class names against.", - defaultValue = "" + DEFAULT_FORMAT - ) - public String format = DEFAULT_FORMAT; - - @Override - public List configurations() { - return Collections.singletonList(new FormatRuleProperty(format)); - } - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ClassPrototypeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ClassPrototypeCheck.java deleted file mode 100644 index 816442b4c4b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ClassPrototypeCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3525") -public class ClassPrototypeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CognitiveComplexityFunctionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CognitiveComplexityFunctionCheck.java deleted file mode 100644 index 69bdfef937b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CognitiveComplexityFunctionCheck.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3776") -public class CognitiveComplexityFunctionCheck extends Check { - - private static final int DEFAULT_THRESHOLD = 15; - - @RuleProperty( - key = "threshold", - description = "The maximum authorized complexity.", - defaultValue = "" + DEFAULT_THRESHOLD - ) - int threshold = DEFAULT_THRESHOLD; - - - - @Override - public List configurations() { - return Collections.singletonList(threshold); - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CollapsibleIfStatementsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CollapsibleIfStatementsCheck.java deleted file mode 100644 index dccf682a05f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CollapsibleIfStatementsCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "CollapsibleIfStatements") -@Rule(key = "S1066") -public class CollapsibleIfStatementsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CollectionSizeComparisonCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CollectionSizeComparisonCheck.java deleted file mode 100644 index 7221098a854..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CollectionSizeComparisonCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3981") -public class CollectionSizeComparisonCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CommaOperatorInSwitchCaseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CommaOperatorInSwitchCaseCheck.java deleted file mode 100644 index 6e24c51c3e6..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CommaOperatorInSwitchCaseCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3616") -public class CommaOperatorInSwitchCaseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CommaOperatorUseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CommaOperatorUseCheck.java deleted file mode 100644 index 5eb6bf922cc..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CommaOperatorUseCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S878") -public class CommaOperatorUseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CommentRegularExpressionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CommentRegularExpressionCheck.java deleted file mode 100644 index 038f4905fb9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CommentRegularExpressionCheck.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "CommentRegularExpression") -@Rule(key = "S124") -public class CommentRegularExpressionCheck extends Check { - - private static final String DEFAULT_MESSAGE = "The regular expression matches this comment."; - private static final String DEFAULT_REGULAR_EXPRESSION = ""; - private static final String DEFAULT_FLAGS = ""; - - @RuleProperty( - key = "regularExpression", - description = "The regular expression (JavaScript syntax)", - defaultValue = DEFAULT_REGULAR_EXPRESSION - ) - public String regularExpression = DEFAULT_REGULAR_EXPRESSION; - - @RuleProperty(key = "message", description = "The issue message", defaultValue = DEFAULT_MESSAGE) - public String message = DEFAULT_MESSAGE; - - @RuleProperty( - key = "flags", - description = "Regular expression modifier flags", - defaultValue = DEFAULT_FLAGS - ) - public String flags = DEFAULT_FLAGS; - - - - @Override - public List configurations() { - return Collections.singletonList( - new CommentRegularExpressionCheck.Config(regularExpression, message, flags) - ); - } - - private static class Config { - - String regularExpression; - String message; - String flags; - - Config(String regularExpression, String message, String flags) { - this.regularExpression = regularExpression; - this.message = message; - this.flags = flags; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CommentedCodeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CommentedCodeCheck.java deleted file mode 100644 index 814c41f23ed..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CommentedCodeCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "CommentedCode") -@Rule(key = "S125") -public class CommentedCodeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ComparisonWithNaNCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ComparisonWithNaNCheck.java deleted file mode 100644 index e34855f775d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ComparisonWithNaNCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2688") -public class ComparisonWithNaNCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConciseRegexCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConciseRegexCheck.java deleted file mode 100644 index 6fc4067a43d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConciseRegexCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6353") -public class ConciseRegexCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConditionalIndentationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConditionalIndentationCheck.java deleted file mode 100644 index b613f166b1e..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConditionalIndentationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3973") -public class ConditionalIndentationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConditionalOperatorCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConditionalOperatorCheck.java deleted file mode 100644 index 6c617b76fd9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConditionalOperatorCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1774") -@DeprecatedRuleKey(ruleKey = "ConditionalOperator") -public class ConditionalOperatorCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConfidentialInformationLoggingCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConfidentialInformationLoggingCheck.java deleted file mode 100644 index 840d65fc5ee..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConfidentialInformationLoggingCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5757") -public class ConfidentialInformationLoggingCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConsistentReturnsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConsistentReturnsCheck.java deleted file mode 100644 index ee4527d120e..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConsistentReturnsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3801") -public class ConsistentReturnsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConsoleLoggingCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConsoleLoggingCheck.java deleted file mode 100644 index 336c3903ff9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConsoleLoggingCheck.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -// deprecated key in TS -@DeprecatedRuleKey(ruleKey = "S2228") -@Rule(key = "S106") -public class ConsoleLoggingCheck extends Check { - - - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - private static class Config { - - List allow = Arrays.asList( - "assert", - "clear", - "count", - "group", - "groupCollapsed", - "groupEnd", - "info", - "table", - "time", - "timeEnd", - "trace" - ); - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConstructorFunctionsForSideEffectsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConstructorFunctionsForSideEffectsCheck.java deleted file mode 100644 index 43de4a030b6..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ConstructorFunctionsForSideEffectsCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "ConstructorFunctionsForSideEffects") -@Rule(key = "S1848") -public class ConstructorFunctionsForSideEffectsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ContentLengthCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ContentLengthCheck.java deleted file mode 100644 index c46b59e1635..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ContentLengthCheck.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5693") -public class ContentLengthCheck extends Check { - - private static final int DEFAULT_FILE_UPLOAD_SIZE_LIMIT = 8_000_000; - - @RuleProperty( - key = "fileUploadSizeLimit", - description = "The maximum size of HTTP requests handling file uploads (in bytes)", - defaultValue = "" + DEFAULT_FILE_UPLOAD_SIZE_LIMIT - ) - long fileUploadSizeLimit = DEFAULT_FILE_UPLOAD_SIZE_LIMIT; - - private static final int DEFAULT_STANDARD_SIZE_LIMIT = 2_000_000; - - @RuleProperty( - key = "standardSizeLimit", - description = "The maximum size of regular HTTP requests (in bytes)", - defaultValue = "" + DEFAULT_STANDARD_SIZE_LIMIT - ) - long standardSizeLimit = DEFAULT_STANDARD_SIZE_LIMIT; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(fileUploadSizeLimit, standardSizeLimit) - ); - } - - - - private static class Config { - - long fileUploadSizeLimit; - - long standardSizeLimit; - - Config(long fileUploadSizeLimit, long standardSizeLimit) { - this.fileUploadSizeLimit = fileUploadSizeLimit; - this.standardSizeLimit = standardSizeLimit; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ContentSecurityPolicyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ContentSecurityPolicyCheck.java deleted file mode 100644 index 667fb2ef288..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ContentSecurityPolicyCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5728") -public class ContentSecurityPolicyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ContinueStatementCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ContinueStatementCheck.java deleted file mode 100644 index 5d75ae139e1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ContinueStatementCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S909") -@DeprecatedRuleKey(ruleKey = "ContinueStatement") -public class ContinueStatementCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CookieNoHttpOnlyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CookieNoHttpOnlyCheck.java deleted file mode 100644 index 096d7a0adcf..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CookieNoHttpOnlyCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3330") -public class CookieNoHttpOnlyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CookiesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CookiesCheck.java deleted file mode 100644 index 2fa7dffb604..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CookiesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2255") -public class CookiesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CorsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CorsCheck.java deleted file mode 100644 index 695ecd2c149..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CorsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5122") -public class CorsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CounterUpdatedInLoopCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CounterUpdatedInLoopCheck.java deleted file mode 100644 index 37e8882bfa5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CounterUpdatedInLoopCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2310") -public class CounterUpdatedInLoopCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CsrfCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CsrfCheck.java deleted file mode 100644 index 63dfa209d9d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CsrfCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4502") -public class CsrfCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CyclomaticComplexityJavaScriptCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CyclomaticComplexityJavaScriptCheck.java deleted file mode 100644 index 3aeb234197d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CyclomaticComplexityJavaScriptCheck.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -// This rule is duplicated for TypeScript because both rules actually map to the -// same eslint key while defining a different name for the same rule property. - -@JavaScriptRule -@DeprecatedRuleKey(ruleKey = "FunctionComplexity") -@Rule(key = "S1541") -public class CyclomaticComplexityJavaScriptCheck extends Check { - - private static final int DEFAULT_THRESHOLD = 10; - - @RuleProperty( - key = "maximumFunctionComplexityThreshold", - description = "The maximum authorized complexity in function", - defaultValue = "" + DEFAULT_THRESHOLD - ) - int threshold = DEFAULT_THRESHOLD; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(threshold) - ); - } - - - - private static class Config { - - int threshold; - - Config(int threshold) { - this.threshold = threshold; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CyclomaticComplexityTypeScriptCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CyclomaticComplexityTypeScriptCheck.java deleted file mode 100644 index 2006a72e2cb..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CyclomaticComplexityTypeScriptCheck.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S1541") -public class CyclomaticComplexityTypeScriptCheck extends Check { - - private static final int DEFAULT_THRESHOLD = 10; - - @RuleProperty( - key = "Threshold", - description = "The maximum authorized complexity.", - defaultValue = "" + DEFAULT_THRESHOLD - ) - int threshold = DEFAULT_THRESHOLD; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(threshold) - ); - } - - - private static class Config { - - int threshold; - - Config(int threshold) { - this.threshold = threshold; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DeadStoreCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DeadStoreCheck.java deleted file mode 100644 index d89cecb7a6e..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DeadStoreCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S1854") -public class DeadStoreCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DebuggerStatementCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DebuggerStatementCheck.java deleted file mode 100644 index 2bbb64f51b8..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DebuggerStatementCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "DebuggerStatement") -@Rule(key = "S1525") -public class DebuggerStatementCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DeclarationInGlobalScopeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DeclarationInGlobalScopeCheck.java deleted file mode 100644 index 7966debded0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DeclarationInGlobalScopeCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3798") -public class DeclarationInGlobalScopeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DefaultParametersNotLastCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DefaultParametersNotLastCheck.java deleted file mode 100644 index 9fb9e75df94..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DefaultParametersNotLastCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1788") -public class DefaultParametersNotLastCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DefaultPropsMatchPropTypesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DefaultPropsMatchPropTypesCheck.java deleted file mode 100644 index dfe8c267b85..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DefaultPropsMatchPropTypesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6775") -public class DefaultPropsMatchPropTypesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DeleteNonPropertyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DeleteNonPropertyCheck.java deleted file mode 100644 index 511cdec461b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DeleteNonPropertyCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3001") -public class DeleteNonPropertyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DeprecationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DeprecationCheck.java deleted file mode 100644 index 4566df6f9dc..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DeprecationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1874") -public class DeprecationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DestructuringAssignmentSyntaxCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DestructuringAssignmentSyntaxCheck.java deleted file mode 100644 index c381752ab88..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DestructuringAssignmentSyntaxCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3514") -public class DestructuringAssignmentSyntaxCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DifferentTypesComparisonCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DifferentTypesComparisonCheck.java deleted file mode 100644 index b1aa603370b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DifferentTypesComparisonCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3403") -public class DifferentTypesComparisonCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DisabledAutoEscapingCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DisabledAutoEscapingCheck.java deleted file mode 100644 index bf88c314aee..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DisabledAutoEscapingCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5247") -public class DisabledAutoEscapingCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DisabledResourceIntegrityCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DisabledResourceIntegrityCheck.java deleted file mode 100644 index ef40ea64178..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DisabledResourceIntegrityCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5725") -public class DisabledResourceIntegrityCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DisabledTimeoutCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DisabledTimeoutCheck.java deleted file mode 100644 index f454e4a3c7e..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DisabledTimeoutCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TestFileCheck; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6080") -public class DisabledTimeoutCheck extends TestFileCheck { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DnsPrefetchingCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DnsPrefetchingCheck.java deleted file mode 100644 index be8eb9cdc01..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DnsPrefetchingCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5743") -public class DnsPrefetchingCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicateAllBranchImplementationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicateAllBranchImplementationCheck.java deleted file mode 100644 index 41888161bfc..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicateAllBranchImplementationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3923") -public class DuplicateAllBranchImplementationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicateBranchImplementationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicateBranchImplementationCheck.java deleted file mode 100644 index 05aca6dfa4f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicateBranchImplementationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1871") -public class DuplicateBranchImplementationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicateConditionIfCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicateConditionIfCheck.java deleted file mode 100644 index b2cec2b0fd0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicateConditionIfCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1862") -public class DuplicateConditionIfCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicateFunctionArgumentCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicateFunctionArgumentCheck.java deleted file mode 100644 index d06e913ed49..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicateFunctionArgumentCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@Rule(key = "S1536") -@DeprecatedRuleKey(ruleKey = "DuplicateFunctionArgument") -public class DuplicateFunctionArgumentCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicatePropertyNameCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicatePropertyNameCheck.java deleted file mode 100644 index 3f279172c16..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicatePropertyNameCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1534") -@DeprecatedRuleKey(ruleKey = "DuplicatePropertyName") -public class DuplicatePropertyNameCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicatesInCharacterClassCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicatesInCharacterClassCheck.java deleted file mode 100644 index d4c43a7353f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/DuplicatesInCharacterClassCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S5869") -public class DuplicatesInCharacterClassCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ElseIfWithoutElseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ElseIfWithoutElseCheck.java deleted file mode 100644 index 59235cbf21f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ElseIfWithoutElseCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "ElseIfWithoutElse") -@Rule(key = "S126") -public class ElseIfWithoutElseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyBlockCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyBlockCheck.java deleted file mode 100644 index 3dc44f88e98..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyBlockCheck.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "EmptyBlock") -@Rule(key = "S108") -public class EmptyBlockCheck extends Check { - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - - - private static class Config { - - boolean allowEmptyCatch = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyCharacterClassesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyCharacterClassesCheck.java deleted file mode 100644 index f0d42fafd6b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyCharacterClassesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2639") -public class EmptyCharacterClassesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyDestructuringPatternCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyDestructuringPatternCheck.java deleted file mode 100644 index deb2df82e27..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyDestructuringPatternCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3799") -public class EmptyDestructuringPatternCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyFunctionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyFunctionCheck.java deleted file mode 100644 index b891168f690..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyFunctionCheck.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1186") -public class EmptyFunctionCheck extends Check { - - - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - private static class Config { - - String[] allow = { "arrowFunctions", "constructors", "private-constructors" }; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyStatementCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyStatementCheck.java deleted file mode 100644 index ffbc94f2188..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyStatementCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1116") -public class EmptyStatementCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyStringRepetitionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyStringRepetitionCheck.java deleted file mode 100644 index 2bf6a34fb05..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EmptyStringRepetitionCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5842") -public class EmptyStringRepetitionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EncryptionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EncryptionCheck.java deleted file mode 100644 index 7ba0eecbb26..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EncryptionCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4787") -public class EncryptionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EncryptionSecureModeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EncryptionSecureModeCheck.java deleted file mode 100644 index df18245a9be..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EncryptionSecureModeCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5542") -public class EncryptionSecureModeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EqEqEqCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EqEqEqCheck.java deleted file mode 100644 index 53b43d9011d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EqEqEqCheck.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "EqEqEq") -@Rule(key = "S1440") -public class EqEqEqCheck extends Check { - - @Override - public List configurations() { - return Collections.singletonList("smart"); - } - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EqualInForLoopTerminationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EqualInForLoopTerminationCheck.java deleted file mode 100644 index 8ee8f0ce3bc..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EqualInForLoopTerminationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S888") -public class EqualInForLoopTerminationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ErrorWithoutThrowCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ErrorWithoutThrowCheck.java deleted file mode 100644 index c43f8893ad4..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ErrorWithoutThrowCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3984") -public class ErrorWithoutThrowCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EvalCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EvalCheck.java deleted file mode 100644 index f8435996206..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/EvalCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S1523") -@DeprecatedRuleKey(ruleKey = "Eval") -public class EvalCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ExistingGroupsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ExistingGroupsCheck.java deleted file mode 100644 index b9a9ba6ca5d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ExistingGroupsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6328") -public class ExistingGroupsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ExpressionComplexityCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ExpressionComplexityCheck.java deleted file mode 100644 index a8c5a24048e..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ExpressionComplexityCheck.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1067") -public class ExpressionComplexityCheck extends Check { - - private static final int DEFAULT = 3; - - @RuleProperty( - description = "Maximum number of allowed conditional operators in an expression", - defaultValue = "" + DEFAULT - ) - public int max = DEFAULT; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(this.max) - ); - } - - - - private static class Config { - - int max; - - Config(int max) { - this.max = max; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FileHeaderCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FileHeaderCheck.java deleted file mode 100644 index 5db1a0828a0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FileHeaderCheck.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1451") -public class FileHeaderCheck extends Check { - - private static final String DEFAULT_HEADER_FORMAT = ""; - - @RuleProperty( - key = "headerFormat", - description = "Expected copyright and license header", - defaultValue = DEFAULT_HEADER_FORMAT, - type = "TEXT" - ) - public String headerFormat = DEFAULT_HEADER_FORMAT; - - @RuleProperty( - key = "isRegularExpression", - description = "Whether the headerFormat is a regular expression", - defaultValue = "false" - ) - public boolean isRegularExpression = false; - - @Override - public List configurations() { - return Collections.singletonList(new Config(headerFormat, isRegularExpression)); - } - - - - private static class Config { - - String headerFormat; - boolean isRegularExpression; - - Config(String headerFormat, boolean isRegularExpression) { - this.headerFormat = headerFormat; - this.isRegularExpression = isRegularExpression; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FileNameDiffersFromClassCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FileNameDiffersFromClassCheck.java deleted file mode 100644 index 1778903e306..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FileNameDiffersFromClassCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3317") -public class FileNameDiffersFromClassCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FilePermissionsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FilePermissionsCheck.java deleted file mode 100644 index 310e7b7ebf1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FilePermissionsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2612") -public class FilePermissionsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FileUploadsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FileUploadsCheck.java deleted file mode 100644 index b22b8090fa3..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FileUploadsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2598") -public class FileUploadsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FixmeTagPresenceCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FixmeTagPresenceCheck.java deleted file mode 100644 index 7c13bafa568..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FixmeTagPresenceCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1134") -public class FixmeTagPresenceCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ForHidingWhileCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ForHidingWhileCheck.java deleted file mode 100644 index 322694eff7b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ForHidingWhileCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1264") -public class ForHidingWhileCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ForInCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ForInCheck.java deleted file mode 100644 index df9f35cfe14..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ForInCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1535") -@DeprecatedRuleKey(ruleKey = "ForIn") -public class ForInCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ForLoopConditionAndUpdateCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ForLoopConditionAndUpdateCheck.java deleted file mode 100644 index 57d062462f3..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ForLoopConditionAndUpdateCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1994") -public class ForLoopConditionAndUpdateCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ForLoopIncrementSignCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ForLoopIncrementSignCheck.java deleted file mode 100644 index b2513957f5b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ForLoopIncrementSignCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2251") -public class ForLoopIncrementSignCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FrameAncestorsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FrameAncestorsCheck.java deleted file mode 100644 index 790f47c9179..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FrameAncestorsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5732") -public class FrameAncestorsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionCallArgumentsOnNewLineCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionCallArgumentsOnNewLineCheck.java deleted file mode 100644 index 9088d517af9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionCallArgumentsOnNewLineCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1472") -public class FunctionCallArgumentsOnNewLineCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionConstructorCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionConstructorCheck.java deleted file mode 100644 index bb4b211816f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionConstructorCheck.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3523") -public class FunctionConstructorCheck extends Check { - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionDeclarationsWithinBlocksCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionDeclarationsWithinBlocksCheck.java deleted file mode 100644 index dabd273ec72..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionDeclarationsWithinBlocksCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "FunctionDeclarationsWithinBlocks") -@Rule(key = "S1530") -public class FunctionDeclarationsWithinBlocksCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionDefinitionInsideLoopCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionDefinitionInsideLoopCheck.java deleted file mode 100644 index d4a4d716b3e..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionDefinitionInsideLoopCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "FunctionDefinitionInsideLoop") -@Rule(key = "S1515") -public class FunctionDefinitionInsideLoopCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionNameCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionNameCheck.java deleted file mode 100644 index cbe9808f1c9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionNameCheck.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S100") -public class FunctionNameCheck extends Check { - - public static final String DEFAULT = "^[_a-z][a-zA-Z0-9]*$"; - - @RuleProperty( - key = "format", - description = "Regular expression used to check the function names against.", - defaultValue = "" + DEFAULT - ) - public String format = DEFAULT; - - @Override - public List configurations() { - return Collections.singletonList(new FormatRuleProperty(format)); - } - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionReturnTypeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionReturnTypeCheck.java deleted file mode 100644 index 5445a282cdf..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FunctionReturnTypeCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3800") -public class FunctionReturnTypeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FutureReservedWordsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FutureReservedWordsCheck.java deleted file mode 100644 index 9c7139c0f05..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/FutureReservedWordsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@Rule(key = "S1527") -@DeprecatedRuleKey(ruleKey = "FutureReservedWords") -public class FutureReservedWordsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GeneratorWithoutYieldCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GeneratorWithoutYieldCheck.java deleted file mode 100644 index 35b3d0746fd..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GeneratorWithoutYieldCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3531") -public class GeneratorWithoutYieldCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GetterSetterCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GetterSetterCheck.java deleted file mode 100644 index 5953686cc24..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GetterSetterCheck.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2376") -public class GetterSetterCheck extends Check { - - private static final boolean DEFAULT_GET_WITHOUT_SET = false; - - @RuleProperty( - key = "getWithoutSet", - description = "Reports on getters without setters.", - defaultValue = "" + DEFAULT_GET_WITHOUT_SET - ) - boolean getWithoutSet = DEFAULT_GET_WITHOUT_SET; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(getWithoutSet) - ); - } - - - - private static class Config { - - boolean getWithoutSet; - - Config(boolean getWithoutSet) { - this.getWithoutSet = getWithoutSet; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GlobalThisCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GlobalThisCheck.java deleted file mode 100644 index f32f5432376..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GlobalThisCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2990") -public class GlobalThisCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GlobalsShadowingCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GlobalsShadowingCheck.java deleted file mode 100644 index ab4d5ea52d2..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GlobalsShadowingCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2137") -public class GlobalsShadowingCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GratuitousConditionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GratuitousConditionCheck.java deleted file mode 100644 index a6821ece4ff..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/GratuitousConditionCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S2589") -public class GratuitousConditionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HashingCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HashingCheck.java deleted file mode 100644 index d6dfc6b44e0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HashingCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4790") -public class HashingCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HeadingHasContentCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HeadingHasContentCheck.java deleted file mode 100644 index 5912be101d6..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HeadingHasContentCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6850") -public class HeadingHasContentCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HiddenFilesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HiddenFilesCheck.java deleted file mode 100644 index 4b5058e9430..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HiddenFilesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5691") -public class HiddenFilesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HookUseStateCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HookUseStateCheck.java deleted file mode 100644 index 725cc51e469..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HookUseStateCheck.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6754") -public class HookUseStateCheck extends Check { - - - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - static class Config { - - boolean allowDestructuredState = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HtmlHasLangCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HtmlHasLangCheck.java deleted file mode 100644 index c869f6543dd..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/HtmlHasLangCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@TypeScriptRule -@JavaScriptRule -@DeprecatedRuleKey(ruleKey = "S6849") -@Rule(key = "S5254") -public class HtmlHasLangCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IdenticalExpressionOnBinaryOperatorCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IdenticalExpressionOnBinaryOperatorCheck.java deleted file mode 100644 index 1d58b6f325d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IdenticalExpressionOnBinaryOperatorCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1764") -public class IdenticalExpressionOnBinaryOperatorCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IdenticalFunctionsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IdenticalFunctionsCheck.java deleted file mode 100644 index 702212100f1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IdenticalFunctionsCheck.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4144") -public class IdenticalFunctionsCheck extends Check { - - private static final int DEFAULT_THRESHOLD = 3; - - @Override - public List configurations() { - return Collections.singletonList(DEFAULT_THRESHOLD); - } - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IframeHasTitleCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IframeHasTitleCheck.java deleted file mode 100644 index 23818c134fc..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IframeHasTitleCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "S6854") -@Rule(key = "S1090") -public class IframeHasTitleCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IgnoredReturnCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IgnoredReturnCheck.java deleted file mode 100644 index 7f8a8e94909..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IgnoredReturnCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2201") -public class IgnoredReturnCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ImgRedundantAltCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ImgRedundantAltCheck.java deleted file mode 100644 index c702d7e1ce5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ImgRedundantAltCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6851") -public class ImgRedundantAltCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ImmediatelyReturnedVariableCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ImmediatelyReturnedVariableCheck.java deleted file mode 100644 index dfe16f92948..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ImmediatelyReturnedVariableCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1488") -public class ImmediatelyReturnedVariableCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ImplicitDependenciesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ImplicitDependenciesCheck.java deleted file mode 100644 index bdb8e54a771..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ImplicitDependenciesCheck.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4328") -public class ImplicitDependenciesCheck extends Check { - - private static final String DEFAULT = ""; - - @RuleProperty( - key = "whitelist", - description = "Comma separated list of modules to ignore while checking in package.json.", - defaultValue = "" + DEFAULT - ) - public String whitelist = DEFAULT; - - @Override - public List configurations() { - return Collections.singletonList( - new Config( - Arrays.stream(whitelist.split(",")) - .map(String::trim) - .toArray(String[]::new) - ) - ); - } - - - - private static class Config { - - String[] whitelist; - - Config(String[] whitelist) { - this.whitelist = whitelist; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InOperatorTypeErrorCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InOperatorTypeErrorCheck.java deleted file mode 100644 index ec6e5faedf1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InOperatorTypeErrorCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3785") -public class InOperatorTypeErrorCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InconsistentFunctionCallCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InconsistentFunctionCallCheck.java deleted file mode 100644 index 09265413421..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InconsistentFunctionCallCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3686") -public class InconsistentFunctionCallCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IncrementDecrementInSubExpressionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IncrementDecrementInSubExpressionCheck.java deleted file mode 100644 index a38ab7385d7..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IncrementDecrementInSubExpressionCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S881") -public class IncrementDecrementInSubExpressionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IndexOfCompareToPositiveNumberCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IndexOfCompareToPositiveNumberCheck.java deleted file mode 100644 index 0d216262567..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IndexOfCompareToPositiveNumberCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2692") -public class IndexOfCompareToPositiveNumberCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InsecureCookieCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InsecureCookieCheck.java deleted file mode 100644 index f131fd8206a..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InsecureCookieCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2092") -public class InsecureCookieCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InsecureJwtTokenCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InsecureJwtTokenCheck.java deleted file mode 100644 index 8a9bd87ced3..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InsecureJwtTokenCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5659") -public class InsecureJwtTokenCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InstanceofInMisuseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InstanceofInMisuseCheck.java deleted file mode 100644 index 8eaab645d57..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InstanceofInMisuseCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3812") -public class InstanceofInMisuseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InteractiveElementsShouldBeFocusableCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InteractiveElementsShouldBeFocusableCheck.java deleted file mode 100644 index cb0aad0d7bd..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InteractiveElementsShouldBeFocusableCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6852") -public class InteractiveElementsShouldBeFocusableCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IntrusivePermissionsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IntrusivePermissionsCheck.java deleted file mode 100644 index d90a4dc6d5e..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IntrusivePermissionsCheck.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5604") -public class IntrusivePermissionsCheck extends Check { - - private static final String DEFAULT = "geolocation"; - - @RuleProperty( - key = "permissions", - description = "Comma-separated list of intrusive permissions to report " + - "(supported values: geolocation, camera, microphone, notifications, persistent-storage)", - defaultValue = "" + DEFAULT - ) - public String permissions = DEFAULT; - - @Override - public List configurations() { - return Collections.singletonList( - new Config( - permissions.split("\\s*,\\s*") - ) - ); - } - - - - private static class Config { - - String[] permissions; - - Config(String[] permissions) { - this.permissions = permissions; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InvariantReturnCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InvariantReturnCheck.java deleted file mode 100644 index 4827e9b9ef2..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InvariantReturnCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3516") -public class InvariantReturnCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InvertedAssertionArgumentsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InvertedAssertionArgumentsCheck.java deleted file mode 100644 index 823bec4d4a8..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/InvertedAssertionArgumentsCheck.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.api.batch.fs.InputFile.Type; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3415") -public class InvertedAssertionArgumentsCheck extends Check { - - @Override - public List targets() { - return Collections.singletonList(Type.TEST); - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IpForwardCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IpForwardCheck.java deleted file mode 100644 index c5f3dcab785..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/IpForwardCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5759") -public class IpForwardCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxChildElementSpacingCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxChildElementSpacingCheck.java deleted file mode 100644 index cde882e4110..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxChildElementSpacingCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6772") -public class JsxChildElementSpacingCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxKeyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxKeyCheck.java deleted file mode 100644 index dc1e99d8666..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxKeyCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6477") -public class JsxKeyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoBindCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoBindCheck.java deleted file mode 100644 index 9011d7dab96..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoBindCheck.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6480") -public class JsxNoBindCheck extends Check { - - - - @Override - public List configurations() { - return List.of(new Config()); - } - - private static class Config { - - boolean ignoreRefs = true; - boolean ignoreDOMComponents = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoCommentTextnodesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoCommentTextnodesCheck.java deleted file mode 100644 index 149de0d19de..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoCommentTextnodesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6438") -public class JsxNoCommentTextnodesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoConstructedContextValuesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoConstructedContextValuesCheck.java deleted file mode 100644 index 53326dc88e8..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoConstructedContextValuesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6481") -public class JsxNoConstructedContextValuesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoLeakedRenderCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoLeakedRenderCheck.java deleted file mode 100644 index 03e99e6e15f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoLeakedRenderCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6439") -public class JsxNoLeakedRenderCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoUselessFragmentCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoUselessFragmentCheck.java deleted file mode 100644 index 563f0596eb2..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxNoUselessFragmentCheck.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6749") -public class JsxNoUselessFragmentCheck extends Check { - - - - @Override - public List configurations() { - return List.of(new Config()); - } - - private static class Config { - - boolean allowExpressions = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxPascalCaseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxPascalCaseCheck.java deleted file mode 100644 index fcbeff74a4a..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JsxPascalCaseCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6770") -public class JsxPascalCaseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JumpStatementInFinallyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JumpStatementInFinallyCheck.java deleted file mode 100644 index 228e43e46f2..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/JumpStatementInFinallyCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1143") -public class JumpStatementInFinallyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LabelHasAssociatedControlCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LabelHasAssociatedControlCheck.java deleted file mode 100644 index 91331f308ef..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LabelHasAssociatedControlCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6853") -public class LabelHasAssociatedControlCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LabelPlacementCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LabelPlacementCheck.java deleted file mode 100644 index 5ab5d77178c..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LabelPlacementCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "LabelPlacement") -@Rule(key = "S1439") -public class LabelPlacementCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LabelledStatementCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LabelledStatementCheck.java deleted file mode 100644 index 0f1b9461343..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LabelledStatementCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1119") -public class LabelledStatementCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LineLengthCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LineLengthCheck.java deleted file mode 100644 index 566b486ae31..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LineLengthCheck.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "LineLength") -@Rule(key = "S103") -public class LineLengthCheck extends Check { - - private static final int DEFAULT_MAXIMUM_LINE_LENGTH = 180; - - @RuleProperty( - key = "maximumLineLength", - description = "The maximum authorized line length.", - defaultValue = "" + DEFAULT_MAXIMUM_LINE_LENGTH - ) - public int maximumLineLength = DEFAULT_MAXIMUM_LINE_LENGTH; - - @Override - public List configurations() { - Map configurationsMap = new HashMap<>(); - configurationsMap.put("code", maximumLineLength); - configurationsMap.put("tabWidth", 1); - return Collections.singletonList(configurationsMap); - } - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LinkWithTargetBlankCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LinkWithTargetBlankCheck.java deleted file mode 100644 index 4bb5ffe40f5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LinkWithTargetBlankCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5148") -public class LinkWithTargetBlankCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LoopsShouldNotBeInfiniteCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LoopsShouldNotBeInfiniteCheck.java deleted file mode 100644 index c6d30c56d13..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/LoopsShouldNotBeInfiniteCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S2189") -public class LoopsShouldNotBeInfiniteCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MaxParameterCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MaxParameterCheck.java deleted file mode 100644 index 1a72d779345..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MaxParameterCheck.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "ExcessiveParameterList") -@Rule(key = "S107") -public class MaxParameterCheck extends Check { - - private static final int DEFAULT_MAXIMUM_FUNCTION_PARAMETERS = 7; - - @RuleProperty( - key = "maximumFunctionParameters", - description = "The maximum authorized number of parameters", - defaultValue = "" + DEFAULT_MAXIMUM_FUNCTION_PARAMETERS - ) - int maximumFunctionParameters = DEFAULT_MAXIMUM_FUNCTION_PARAMETERS; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(maximumFunctionParameters) - ); - } - - - - private static class Config { - - int max; - - Config(int maximumFunctionParameters) { - this.max = maximumFunctionParameters; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MaxSwitchCasesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MaxSwitchCasesCheck.java deleted file mode 100644 index a1b06fc0013..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MaxSwitchCasesCheck.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1479") -public class MaxSwitchCasesCheck extends Check { - - private static final int DEFAULT_MAXIMUM = 30; - - @RuleProperty( - key = "maximum", - description = "Maximum number of \"case\".", - defaultValue = "" + DEFAULT_MAXIMUM - ) - int maximum = DEFAULT_MAXIMUM; - - @Override - public List configurations() { - return Collections.singletonList(maximum); - } - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MaxUnionSizeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MaxUnionSizeCheck.java deleted file mode 100644 index b8c447208aa..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MaxUnionSizeCheck.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4622") -public class MaxUnionSizeCheck extends Check { - - private static final int DEFAULT_THRESHOLD = 3; - - @RuleProperty( - key = "max", - description = "Maximum elements authorized in a union type definition.", - defaultValue = "" + DEFAULT_THRESHOLD - ) - int threshold = DEFAULT_THRESHOLD; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(threshold) - ); - } - - - - private static class Config { - - int threshold; - - Config(int threshold) { - this.threshold = threshold; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MediaHasCaptionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MediaHasCaptionCheck.java deleted file mode 100644 index 6ea5554a4ea..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MediaHasCaptionCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "S6855") -@Rule(key = "S4084") -public class MediaHasCaptionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MisorderedParameterListCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MisorderedParameterListCheck.java deleted file mode 100644 index c5b3400cb51..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MisorderedParameterListCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2234") -public class MisorderedParameterListCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MissingNewlineAtEndOfFileCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MissingNewlineAtEndOfFileCheck.java deleted file mode 100644 index 668d16b9966..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MissingNewlineAtEndOfFileCheck.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "MissingNewlineAtEndOfFile") -@Rule(key = "S113") -public class MissingNewlineAtEndOfFileCheck extends Check { - - @Override - public List configurations() { - return Collections.singletonList("always"); - } - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MissingTrailingCommaCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MissingTrailingCommaCheck.java deleted file mode 100644 index 91d6bda23d5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MissingTrailingCommaCheck.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3723") -public class MissingTrailingCommaCheck extends Check { - - - - @Override - public List configurations() { - return Collections.singletonList("always-multiline"); - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MouseEventsA11YCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MouseEventsA11YCheck.java deleted file mode 100644 index 40259c6d075..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MouseEventsA11YCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1082") -public class MouseEventsA11YCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MultilineBlockCurlyBraceCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MultilineBlockCurlyBraceCheck.java deleted file mode 100644 index 69de6efd4ca..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MultilineBlockCurlyBraceCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2681") -public class MultilineBlockCurlyBraceCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MultilineStringLiteralsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MultilineStringLiteralsCheck.java deleted file mode 100644 index e963f44fd3d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/MultilineStringLiteralsCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "MultilineStringLiterals") -@Rule(key = "S1516") -public class MultilineStringLiteralsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NestedAssignmentCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NestedAssignmentCheck.java deleted file mode 100644 index a71ff9afdd2..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NestedAssignmentCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "AssignmentWithinCondition") -@Rule(key = "S1121") -public class NestedAssignmentCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NestedConditionalOperatorsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NestedConditionalOperatorsCheck.java deleted file mode 100644 index 7e9b3ff450f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NestedConditionalOperatorsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3358") -public class NestedConditionalOperatorsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NestedControlFlowDepthCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NestedControlFlowDepthCheck.java deleted file mode 100644 index f7fd83d8570..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NestedControlFlowDepthCheck.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S134") -@DeprecatedRuleKey(ruleKey = "NestedIfDepth") -public class NestedControlFlowDepthCheck extends Check { - - private static final int DEFAULT_MAXIMUM_NESTING_LEVEL = 3; - - @RuleProperty( - key = "maximumNestingLevel", - description = "Maximum allowed \"if/for/while/switch/try\" statements nesting depth", - defaultValue = "" + DEFAULT_MAXIMUM_NESTING_LEVEL - ) - public int maximumNestingLevel = DEFAULT_MAXIMUM_NESTING_LEVEL; - - @Override - public List configurations() { - return Collections.singletonList(new Config(maximumNestingLevel)); - } - - - - private static class Config { - - int maximumNestingLevel; - - Config(int maximumNestingLevel) { - this.maximumNestingLevel = maximumNestingLevel; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NewCapCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NewCapCheck.java deleted file mode 100644 index 21afecd9557..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NewCapCheck.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S2430") -public class NewCapCheck extends Check { - - - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - private static class Config { - - boolean newIsCap = true; - boolean capIsNew = false; - boolean properties = false; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NewOperatorMisuseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NewOperatorMisuseCheck.java deleted file mode 100644 index 70ef3ed009b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NewOperatorMisuseCheck.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2999") -public class NewOperatorMisuseCheck extends Check { - - public static final boolean CONSIDER_JSDOC = false; - - @RuleProperty( - key = "considerJSDoc", - description = "Consider only functions with @constructor tag as constructor functions", - defaultValue = "" + CONSIDER_JSDOC - ) - public boolean considerJSDoc = CONSIDER_JSDOC; - - - - @Override - public List configurations() { - return Collections.singletonList(new Config(considerJSDoc)); - } - - private static class Config { - - public boolean considerJSDoc; - - Config(boolean considerJSDoc) { - this.considerJSDoc = considerJSDoc; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAbsolutePathCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAbsolutePathCheck.java deleted file mode 100644 index 766e1b30c89..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAbsolutePathCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6859") -public class NoAbsolutePathCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAccessKeyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAccessKeyCheck.java deleted file mode 100644 index ffd81e8ec8b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAccessKeyCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6846") -public class NoAccessKeyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAccessStateInSetstateCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAccessStateInSetstateCheck.java deleted file mode 100644 index 27abe9cc172..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAccessStateInSetstateCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6756") -public class NoAccessStateInSetstateCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAccessorFieldMismatchCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAccessorFieldMismatchCheck.java deleted file mode 100644 index ae40f689ff0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAccessorFieldMismatchCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4275") -public class NoAccessorFieldMismatchCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAngularBypassSanitizationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAngularBypassSanitizationCheck.java deleted file mode 100644 index 086f539df39..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAngularBypassSanitizationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6268") -public class NoAngularBypassSanitizationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAnyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAnyCheck.java deleted file mode 100644 index 3155dad1ef7..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAnyCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4204") -public class NoAnyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAriaHiddenOnFocusableCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAriaHiddenOnFocusableCheck.java deleted file mode 100644 index 6ef85e40560..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAriaHiddenOnFocusableCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6825") -public class NoAriaHiddenOnFocusableCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoArrayDeleteCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoArrayDeleteCheck.java deleted file mode 100644 index f63077f4e44..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoArrayDeleteCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2870") -public class NoArrayDeleteCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoArrayIndexKeyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoArrayIndexKeyCheck.java deleted file mode 100644 index ec235e5e7e5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoArrayIndexKeyCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6479") -public class NoArrayIndexKeyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAsyncConstructorCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAsyncConstructorCheck.java deleted file mode 100644 index b822bdd5f7d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoAsyncConstructorCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S7059") -public class NoAsyncConstructorCheck extends Check { -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoBaseToStringCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoBaseToStringCheck.java deleted file mode 100644 index c2813ed995c..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoBaseToStringCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6551") -public class NoBaseToStringCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoCaseDeclarationsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoCaseDeclarationsCheck.java deleted file mode 100644 index 4718deea125..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoCaseDeclarationsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6836") -public class NoCaseDeclarationsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoChildrenPropCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoChildrenPropCheck.java deleted file mode 100644 index a9dd1648695..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoChildrenPropCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6748") -public class NoChildrenPropCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoClearTextProtocolsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoClearTextProtocolsCheck.java deleted file mode 100644 index bff9360156e..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoClearTextProtocolsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5332") -public class NoClearTextProtocolsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoCodeAfterDoneCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoCodeAfterDoneCheck.java deleted file mode 100644 index 3c27413f5a8..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoCodeAfterDoneCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TestFileCheck; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6079") -public class NoCodeAfterDoneCheck extends TestFileCheck { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoConfusingNonNullAssertionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoConfusingNonNullAssertionCheck.java deleted file mode 100644 index 9e841ad217b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoConfusingNonNullAssertionCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S6568") -public class NoConfusingNonNullAssertionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoConstantBinaryExpressionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoConstantBinaryExpressionCheck.java deleted file mode 100644 index 662290f46ff..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoConstantBinaryExpressionCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6638") -public class NoConstantBinaryExpressionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoConstructorReturnCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoConstructorReturnCheck.java deleted file mode 100644 index c679080f524..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoConstructorReturnCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6635") -public class NoConstructorReturnCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoControlRegexCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoControlRegexCheck.java deleted file mode 100644 index 8c1d4d8bd11..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoControlRegexCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6324") -public class NoControlRegexCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDangerWithChildrenCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDangerWithChildrenCheck.java deleted file mode 100644 index 22d4f2581cb..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDangerWithChildrenCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6761") -public class NoDangerWithChildrenCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDeprecatedReactCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDeprecatedReactCheck.java deleted file mode 100644 index b1e9a74709a..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDeprecatedReactCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6957") -public class NoDeprecatedReactCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDirectMutationStateCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDirectMutationStateCheck.java deleted file mode 100644 index f613f63abda..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDirectMutationStateCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6746") -public class NoDirectMutationStateCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDuplicateEnumValuesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDuplicateEnumValuesCheck.java deleted file mode 100644 index 1e5ab2913cf..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDuplicateEnumValuesCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S6578") -public class NoDuplicateEnumValuesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDuplicateImportsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDuplicateImportsCheck.java deleted file mode 100644 index 8b6fd377c95..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDuplicateImportsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S3863") -public class NoDuplicateImportsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDuplicateInCompositeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDuplicateInCompositeCheck.java deleted file mode 100644 index 5f15524946f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDuplicateInCompositeCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4621") -public class NoDuplicateInCompositeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDuplicateStringCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDuplicateStringCheck.java deleted file mode 100644 index 50fad2bcfd5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoDuplicateStringCheck.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Arrays; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S1192") -public class NoDuplicateStringCheck extends Check { - - private static final int DEFAULT_THRESHOLD = 3; - private static final String DEFAULT_IGNORED_STRINGS = "application/json"; - - @RuleProperty( - key = "threshold", - description = "Number of times a literal must be duplicated to trigger an issue.", - defaultValue = "" + DEFAULT_THRESHOLD - ) - int threshold = DEFAULT_THRESHOLD; - - @RuleProperty( - key = "ignoreStrings", - description = "Comma-separated list of strings that must be ignored.", - defaultValue = "" + DEFAULT_IGNORED_STRINGS - ) - String ignoreStrings = DEFAULT_IGNORED_STRINGS; - - @Override - public List configurations() { - return Arrays.asList(new Config(threshold, ignoreStrings)); - } - - - - private static class Config { - - public int threshold; - public String ignoreStrings; - - public Config(int threshold, String ignoreStrings) { - this.threshold = threshold; - this.ignoreStrings = ignoreStrings; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoElementOverwriteCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoElementOverwriteCheck.java deleted file mode 100644 index 11a005582fc..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoElementOverwriteCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4143") -public class NoElementOverwriteCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyAfterReluctantCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyAfterReluctantCheck.java deleted file mode 100644 index c97ab86f1e1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyAfterReluctantCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6019") -public class NoEmptyAfterReluctantCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyAlternativesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyAlternativesCheck.java deleted file mode 100644 index 19ebcf28788..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyAlternativesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6323") -public class NoEmptyAlternativesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyClassCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyClassCheck.java deleted file mode 100644 index ad7fe03ed51..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyClassCheck.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S2094") -public class NoEmptyClassCheck extends Check { - - - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - private static class Config { - - boolean allowConstructorOnly = false; - boolean allowEmpty = false; - boolean allowStaticOnly = true; - boolean allowWithDecorator = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyCollectionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyCollectionCheck.java deleted file mode 100644 index 61e15132bf3..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyCollectionCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4158") -public class NoEmptyCollectionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyGroupCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyGroupCheck.java deleted file mode 100644 index b16a39f7647..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyGroupCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6331") -public class NoEmptyGroupCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyInterfaceCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyInterfaceCheck.java deleted file mode 100644 index f4f304b076f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyInterfaceCheck.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4023") -public class NoEmptyInterfaceCheck extends Check { - - - - @Override - public List configurations() { - return List.of(new Config()); - } - - private static class Config { - - boolean allowSingleExtends = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyTestFileCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyTestFileCheck.java deleted file mode 100644 index aa5e50e52fa..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoEmptyTestFileCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TestFileCheck; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2187") -public class NoEmptyTestFileCheck extends TestFileCheck { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoExclusiveTestsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoExclusiveTestsCheck.java deleted file mode 100644 index c2375144bef..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoExclusiveTestsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TestFileCheck; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6426") -public class NoExclusiveTestsCheck extends TestFileCheck { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoExtendNativeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoExtendNativeCheck.java deleted file mode 100644 index 0448ea6c71c..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoExtendNativeCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6643") -public class NoExtendNativeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoExtraBindCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoExtraBindCheck.java deleted file mode 100644 index d321b9427da..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoExtraBindCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6637") -public class NoExtraBindCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoExtraBooleanCastCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoExtraBooleanCastCheck.java deleted file mode 100644 index c34f00707ad..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoExtraBooleanCastCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6509") -public class NoExtraBooleanCastCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoFindDomNodeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoFindDomNodeCheck.java deleted file mode 100644 index fcce2bb558c..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoFindDomNodeCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6788") -public class NoFindDomNodeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoForInArrayCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoForInArrayCheck.java deleted file mode 100644 index efb421a8984..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoForInArrayCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4139") -public class NoForInArrayCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoHardcodedIpCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoHardcodedIpCheck.java deleted file mode 100644 index d150bba4972..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoHardcodedIpCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S1313") -public class NoHardcodedIpCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoHardcodedPasswordsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoHardcodedPasswordsCheck.java deleted file mode 100644 index dc5614bc553..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoHardcodedPasswordsCheck.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2068") -public class NoHardcodedPasswordsCheck extends Check { - - private static final String DEFAULT = "password, pwd, passwd"; - - @RuleProperty( - key = "passwordWords", - description = "Comma separated list of words identifying potential passwords.", - defaultValue = "" + DEFAULT - ) - public String passwordWords = DEFAULT; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(passwordWords.split("\\s*,\\s*")) - ); - } - - private static class Config { - String[] passwordWords; - Config(String[] passwordWords) { - this.passwordWords = passwordWords; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoHardcodedSecretsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoHardcodedSecretsCheck.java deleted file mode 100644 index 9e02d95f5e7..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoHardcodedSecretsCheck.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6418") -public class NoHardcodedSecretsCheck extends Check { - - private static final String DEFAULT_SECRET_WORDS = "api[_.-]?key,auth,credential,secret,token"; - private static final String DEFAULT_RANDOMNESS_SENSIBILITY = "5.0"; - - @RuleProperty( - key = "secretWords", - description = "Comma separated list of words identifying potential secrets", - defaultValue = DEFAULT_SECRET_WORDS - ) - public String secretWords = DEFAULT_SECRET_WORDS; - @RuleProperty( - key = "randomnessSensibility", - description = "Minimum shannon entropy threshold of the secret", - defaultValue = DEFAULT_RANDOMNESS_SENSIBILITY - ) - public String randomnessSensibility = DEFAULT_RANDOMNESS_SENSIBILITY; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(secretWords, randomnessSensibility) - ); - } - - private static class Config { - - String secretWords; - String randomnessSensibility; - - Config(String secretWords, String randomnessSensibility) { - this.secretWords = secretWords; - this.randomnessSensibility = randomnessSensibility; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoHookSetterInBodyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoHookSetterInBodyCheck.java deleted file mode 100644 index 2c4075a0374..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoHookSetterInBodyCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6442") -public class NoHookSetterInBodyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoIgnoredExceptionsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoIgnoredExceptionsCheck.java deleted file mode 100644 index a46088efc74..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoIgnoredExceptionsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TestFileCheck; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2486") -public class NoIgnoredExceptionsCheck extends TestFileCheck { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoImportAssignCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoImportAssignCheck.java deleted file mode 100644 index 69d901ce64c..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoImportAssignCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6522") -public class NoImportAssignCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInMisuseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInMisuseCheck.java deleted file mode 100644 index 67b20fa9539..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInMisuseCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4619") -public class NoInMisuseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoIncompleteAssertionsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoIncompleteAssertionsCheck.java deleted file mode 100644 index 55d5bfa68fe..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoIncompleteAssertionsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TestFileCheck; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S2970") -public class NoIncompleteAssertionsCheck extends TestFileCheck { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInferrableTypesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInferrableTypesCheck.java deleted file mode 100644 index 28d74707bf7..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInferrableTypesCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S3257") -public class NoInferrableTypesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInteractiveElementToNoninteractiveRoleCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInteractiveElementToNoninteractiveRoleCheck.java deleted file mode 100644 index 3c9e166f7f0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInteractiveElementToNoninteractiveRoleCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6843") -public class NoInteractiveElementToNoninteractiveRoleCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInternalApiUseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInternalApiUseCheck.java deleted file mode 100644 index 13296d772eb..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInternalApiUseCheck.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6627") -public class NoInternalApiUseCheck extends Check { - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInvalidAwaitCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInvalidAwaitCheck.java deleted file mode 100644 index 72dd2e2adc9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInvalidAwaitCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4123") -public class NoInvalidAwaitCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInvertedBooleanCheckCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInvertedBooleanCheckCheck.java deleted file mode 100644 index c6071fb47fb..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoInvertedBooleanCheckCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1940") -public class NoInvertedBooleanCheckCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoIsMountedCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoIsMountedCheck.java deleted file mode 100644 index 9634f75161d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoIsMountedCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6789") -public class NoIsMountedCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoLiteralCallCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoLiteralCallCheck.java deleted file mode 100644 index b186ae4b544..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoLiteralCallCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6958") -public class NoLiteralCallCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoLoneBlocksCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoLoneBlocksCheck.java deleted file mode 100644 index 8770d30aee8..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoLoneBlocksCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S1199") -public class NoLoneBlocksCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoLonelyIfCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoLonelyIfCheck.java deleted file mode 100644 index 4463490ad03..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoLonelyIfCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6660") -public class NoLonelyIfCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoLossOfPrecisionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoLossOfPrecisionCheck.java deleted file mode 100644 index e6ef5f3cbbf..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoLossOfPrecisionCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6534") -public class NoLossOfPrecisionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMagicNumbersCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMagicNumbersCheck.java deleted file mode 100644 index b19533a1250..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMagicNumbersCheck.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S109") -public class NoMagicNumbersCheck extends Check { - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - - - private static class Config { - - int[] ignore = { 0, 1, -1, 24, 60 }; - boolean ignoreEnums = true; - boolean ignoreReadonlyClassProperties = true; - boolean ignoreNumericLiteralTypes = true; - boolean ignoreDefaultValues = true; - boolean ignoreClassFieldInitialValues = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMimeSniffCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMimeSniffCheck.java deleted file mode 100644 index 8ca2498467f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMimeSniffCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5734") -public class NoMimeSniffCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMisleadingArrayReverseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMisleadingArrayReverseCheck.java deleted file mode 100644 index 5929b18b42b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMisleadingArrayReverseCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4043") -public class NoMisleadingArrayReverseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMisusedNewCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMisusedNewCheck.java deleted file mode 100644 index b90738bfe60..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMisusedNewCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4124") -public class NoMisusedNewCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMisusedPromisesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMisusedPromisesCheck.java deleted file mode 100644 index 3c5591f2341..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMisusedPromisesCheck.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6544") -public class NoMisusedPromisesCheck extends Check { - - private static class Config { - - boolean ignoreIIFE = true; - ChecksVoidReturn checksVoidReturn = new ChecksVoidReturn(); - - private static class ChecksVoidReturn { - - boolean attributes = false; - - boolean arguments = false; - } - } - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMixedContentCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMixedContentCheck.java deleted file mode 100644 index e1b8d4b0e65..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMixedContentCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5730") -public class NoMixedContentCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMixedEnumsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMixedEnumsCheck.java deleted file mode 100644 index db81d04e64d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMixedEnumsCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S6583") -public class NoMixedEnumsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMutableExportsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMutableExportsCheck.java deleted file mode 100644 index 3bd5f878488..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoMutableExportsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6861") -public class NoMutableExportsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNestedFunctionsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNestedFunctionsCheck.java deleted file mode 100644 index 33cc0e3b643..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNestedFunctionsCheck.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2004") -public class NoNestedFunctionsCheck extends Check { - - private static final int DEFAULT_THRESHOLD = 4; - - @RuleProperty( - key = "max", - description = "Maximum depth of allowed nested functions.", - defaultValue = "" + DEFAULT_THRESHOLD - ) - int threshold = DEFAULT_THRESHOLD; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(threshold) - ); - } - - - - private static class Config { - - int threshold; - - Config(int threshold) { - this.threshold = threshold; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNestedSwitchCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNestedSwitchCheck.java deleted file mode 100644 index 9edee5c9d5c..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNestedSwitchCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1821") -public class NoNestedSwitchCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNestedTemplateLiteralsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNestedTemplateLiteralsCheck.java deleted file mode 100644 index 9c63ccb7959..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNestedTemplateLiteralsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4624") -public class NoNestedTemplateLiteralsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNewNativeNonconstructorCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNewNativeNonconstructorCheck.java deleted file mode 100644 index 819ad499388..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNewNativeNonconstructorCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3834") -public class NoNewNativeNonconstructorCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNonInteractiveElementsWithHandlersCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNonInteractiveElementsWithHandlersCheck.java deleted file mode 100644 index 7808c321912..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNonInteractiveElementsWithHandlersCheck.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6847") -public class NoNonInteractiveElementsWithHandlersCheck extends Check { - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - private static class Config { - String[] handlers = {"onClick", "onMouseDown", "onMouseUp", "onKeyPress", "onKeyDown", "onKeyUp"}; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNonNullAssertionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNonNullAssertionCheck.java deleted file mode 100644 index e85f93d16b1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNonNullAssertionCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S2966") -public class NoNonNullAssertionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNoninteractiveElementToInteractiveRoleCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNoninteractiveElementToInteractiveRoleCheck.java deleted file mode 100644 index a92ac75f653..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNoninteractiveElementToInteractiveRoleCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6842") -public class NoNoninteractiveElementToInteractiveRoleCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNoninteractiveTabindexCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNoninteractiveTabindexCheck.java deleted file mode 100644 index ee6debbbce7..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoNoninteractiveTabindexCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6845") -public class NoNoninteractiveTabindexCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoOctalEscapeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoOctalEscapeCheck.java deleted file mode 100644 index c3993e24724..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoOctalEscapeCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6657") -public class NoOctalEscapeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoOneIterationLoopCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoOneIterationLoopCheck.java deleted file mode 100644 index 4490664f1ad..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoOneIterationLoopCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1751") -public class NoOneIterationLoopCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoOsCommandsFromPathCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoOsCommandsFromPathCheck.java deleted file mode 100644 index e16f64ca104..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoOsCommandsFromPathCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S4036") -public class NoOsCommandsFromPathCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoProtoCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoProtoCheck.java deleted file mode 100644 index 4fadd2b614d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoProtoCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6654") -public class NoProtoCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantJumpCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantJumpCheck.java deleted file mode 100644 index 2261c73706c..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantJumpCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3626") -public class NoRedundantJumpCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantOptionalCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantOptionalCheck.java deleted file mode 100644 index 471004bdfff..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantOptionalCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4782") -public class NoRedundantOptionalCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantRolesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantRolesCheck.java deleted file mode 100644 index 4549d6c8109..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantRolesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6822") -public class NoRedundantRolesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantShouldComponentUpdateCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantShouldComponentUpdateCheck.java deleted file mode 100644 index bd0862fe2bc..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantShouldComponentUpdateCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6763") -public class NoRedundantShouldComponentUpdateCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantTypeConstituentsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantTypeConstituentsCheck.java deleted file mode 100644 index d833cdf16c4..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRedundantTypeConstituentsCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S6571") -public class NoRedundantTypeConstituentsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoReferrerPolicyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoReferrerPolicyCheck.java deleted file mode 100644 index f83dd51ba56..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoReferrerPolicyCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5736") -public class NoReferrerPolicyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRegexSpacesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRegexSpacesCheck.java deleted file mode 100644 index 303a02965d5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRegexSpacesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6326") -public class NoRegexSpacesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRenderReturnValueCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRenderReturnValueCheck.java deleted file mode 100644 index 074b9332e8d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoRenderReturnValueCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6750") -public class NoRenderReturnValueCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoReturnAwaitCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoReturnAwaitCheck.java deleted file mode 100644 index c06fd722af0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoReturnAwaitCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4326") -public class NoReturnAwaitCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoReturnTypeAnyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoReturnTypeAnyCheck.java deleted file mode 100644 index d5dd8ec1786..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoReturnTypeAnyCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4324") -public class NoReturnTypeAnyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSameArgumentAssertCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSameArgumentAssertCheck.java deleted file mode 100644 index 2a62b631601..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSameArgumentAssertCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TestFileCheck; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S5863") -public class NoSameArgumentAssertCheck extends TestFileCheck { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSelfCompareCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSelfCompareCheck.java deleted file mode 100644 index cbc5a00cc6b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSelfCompareCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6679") -public class NoSelfCompareCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSelfImportCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSelfImportCheck.java deleted file mode 100644 index 823ffdd827e..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSelfImportCheck.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S7060") -public class NoSelfImportCheck extends Check { - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSkippedTestsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSkippedTestsCheck.java deleted file mode 100644 index 6de53c986c9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSkippedTestsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TestFileCheck; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1607") -public class NoSkippedTestsCheck extends TestFileCheck { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSonarCommentsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSonarCommentsCheck.java deleted file mode 100644 index 969e27dccae..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSonarCommentsCheck.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1291") -public class NoSonarCommentsCheck extends Check { - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSparseArraysCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSparseArraysCheck.java deleted file mode 100644 index 1f65ed3ef44..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoSparseArraysCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4140") -public class NoSparseArraysCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoStaticElementInteractionsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoStaticElementInteractionsCheck.java deleted file mode 100644 index e693f67c021..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoStaticElementInteractionsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6848") -public class NoStaticElementInteractionsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoStringRefsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoStringRefsCheck.java deleted file mode 100644 index 998344dc85a..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoStringRefsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6790") -public class NoStringRefsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoTableAsLayoutCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoTableAsLayoutCheck.java deleted file mode 100644 index c65eaa98e56..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoTableAsLayoutCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S5257") -public class NoTableAsLayoutCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoThisAliasCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoThisAliasCheck.java deleted file mode 100644 index 8ac29d17ad3..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoThisAliasCheck.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4327") -public class NoThisAliasCheck extends Check { - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - - - private static class Config { - - boolean allowDestructuring = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoThisInSfcCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoThisInSfcCheck.java deleted file mode 100644 index af946873484..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoThisInSfcCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6757") -public class NoThisInSfcCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUndefInitCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUndefInitCheck.java deleted file mode 100644 index 2bff1d007de..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUndefInitCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S6645") -public class NoUndefInitCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnescapedEntitiesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnescapedEntitiesCheck.java deleted file mode 100644 index 97fdb8cbf71..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnescapedEntitiesCheck.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6766") -public class NoUnescapedEntitiesCheck extends Check { - - - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - private static class Config { - - List forbid = List.of(">", "}"); - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUniqKeyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUniqKeyCheck.java deleted file mode 100644 index 4f515424754..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUniqKeyCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6486") -public class NoUniqKeyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnknownPropertyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnknownPropertyCheck.java deleted file mode 100644 index c16f514ead6..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnknownPropertyCheck.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6747") -public class NoUnknownPropertyCheck extends Check { - - @RuleProperty( - key = "whitelist", - description = "Comma-separated list of property and attribute names to ignore", - defaultValue = "" - ) - public String whitelist = ""; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(Arrays.asList(whitelist.split(",")).stream().map(String::trim).toList()) - ); - } - - - - private static class Config { - - List ignore; - - Config(List ignore) { - this.ignore = ignore; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnnecessaryTypeAssertionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnnecessaryTypeAssertionCheck.java deleted file mode 100644 index 7da2924cda4..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnnecessaryTypeAssertionCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4325") -public class NoUnnecessaryTypeAssertionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnnecessaryTypeConstraintCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnnecessaryTypeConstraintCheck.java deleted file mode 100644 index 2abb3f24509..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnnecessaryTypeConstraintCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S6569") -public class NoUnnecessaryTypeConstraintCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnneededTernaryCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnneededTernaryCheck.java deleted file mode 100644 index b7394d26d56..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnneededTernaryCheck.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6644") -public class NoUnneededTernaryCheck extends Check { - - - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - private static class Config { - - boolean defaultAssignment = false; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnsafeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnsafeCheck.java deleted file mode 100644 index f7c9356bebb..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnsafeCheck.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6791") -public class NoUnsafeCheck extends Check { - - - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - private static class Config { - - boolean checkAliases = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnsafeOptionalChainingCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnsafeOptionalChainingCheck.java deleted file mode 100644 index eb36dcdc718..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnsafeOptionalChainingCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6523") -public class NoUnsafeOptionalChainingCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnstableNestedComponentsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnstableNestedComponentsCheck.java deleted file mode 100644 index 13af5d878ed..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnstableNestedComponentsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6478") -public class NoUnstableNestedComponentsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnusedClassComponentMethodsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnusedClassComponentMethodsCheck.java deleted file mode 100644 index d354f1705a7..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnusedClassComponentMethodsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6441") -public class NoUnusedClassComponentMethodsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnusedPrivateClassMembersCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnusedPrivateClassMembersCheck.java deleted file mode 100644 index 5327bf6c88e..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnusedPrivateClassMembersCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S1068") -public class NoUnusedPrivateClassMembersCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnusedPropTypesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnusedPropTypesCheck.java deleted file mode 100644 index dbd1ab9aee9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUnusedPropTypesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6767") -public class NoUnusedPropTypesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessCallCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessCallCheck.java deleted file mode 100644 index d773f52be1a..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessCallCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6676") -public class NoUselessCallCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessCatchCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessCatchCheck.java deleted file mode 100644 index 8775d4ab4a0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessCatchCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2737") -public class NoUselessCatchCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessConstructorCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessConstructorCheck.java deleted file mode 100644 index 38d08a7683b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessConstructorCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6647") -public class NoUselessConstructorCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessReactSetstateCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessReactSetstateCheck.java deleted file mode 100644 index 9f9acc6baa1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessReactSetstateCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6443") -public class NoUselessReactSetstateCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessRenameCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessRenameCheck.java deleted file mode 100644 index dbfd9e65ffa..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoUselessRenameCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6650") -public class NoUselessRenameCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoVueBypassSanitizationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoVueBypassSanitizationCheck.java deleted file mode 100644 index eafeb629715..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoVueBypassSanitizationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6299") -public class NoVueBypassSanitizationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoWeakCipherCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoWeakCipherCheck.java deleted file mode 100644 index 0447c3b404a..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoWeakCipherCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5547") -public class NoWeakCipherCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoWeakKeysCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoWeakKeysCheck.java deleted file mode 100644 index 6b64acb27af..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NoWeakKeysCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4426") -public class NoWeakKeysCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonCaseLabelInSwitchCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonCaseLabelInSwitchCheck.java deleted file mode 100644 index bcf01b6ce10..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonCaseLabelInSwitchCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1219") -public class NonCaseLabelInSwitchCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonEmptyCaseWithoutBreakCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonEmptyCaseWithoutBreakCheck.java deleted file mode 100644 index 3cee32d04d7..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonEmptyCaseWithoutBreakCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "NonEmptyCaseWithoutBreak") -@Rule(key = "S128") -public class NonEmptyCaseWithoutBreakCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonExistentAssignmentOperatorCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonExistentAssignmentOperatorCheck.java deleted file mode 100644 index a705b27dd03..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonExistentAssignmentOperatorCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2757") -public class NonExistentAssignmentOperatorCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonNumberInArithmeticExpressionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonNumberInArithmeticExpressionCheck.java deleted file mode 100644 index 76c32e13070..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonNumberInArithmeticExpressionCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3760") -public class NonNumberInArithmeticExpressionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonStandardImportCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonStandardImportCheck.java deleted file mode 100644 index 5c5844552b2..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NonStandardImportCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S3533") -public class NonStandardImportCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NullDereferenceCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NullDereferenceCheck.java deleted file mode 100644 index 512e4811a9f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/NullDereferenceCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S2259") -public class NullDereferenceCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/OSCommandCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/OSCommandCheck.java deleted file mode 100644 index 1fe687d9744..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/OSCommandCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4721") -public class OSCommandCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ObjectAltContentCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ObjectAltContentCheck.java deleted file mode 100644 index e9aa4e8d104..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ObjectAltContentCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S5264") -public class ObjectAltContentCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ObjectLiteralShorthandCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ObjectLiteralShorthandCheck.java deleted file mode 100644 index 90fd4ab65a7..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ObjectLiteralShorthandCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3498") -public class ObjectLiteralShorthandCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/OctalNumberCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/OctalNumberCheck.java deleted file mode 100644 index e37265a8448..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/OctalNumberCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1314") -@DeprecatedRuleKey(ruleKey = "OctalNumber") -public class OctalNumberCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/OneStatementPerLineCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/OneStatementPerLineCheck.java deleted file mode 100644 index b92ef215ed5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/OneStatementPerLineCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S122") -@DeprecatedRuleKey(ruleKey = "OneStatementPerLine") -public class OneStatementPerLineCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/OpenCurlyBracesAtEOLCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/OpenCurlyBracesAtEOLCheck.java deleted file mode 100644 index 7a1adccadf1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/OpenCurlyBracesAtEOLCheck.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Arrays; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1105") -public class OpenCurlyBracesAtEOLCheck extends Check { - - private static final String DEFAULT_BRACE_STYLE = "1tbs"; - - @RuleProperty( - key = "braceStyle", - description = "enforced brace-style: 1tbs, stroustrup or allman.", - defaultValue = DEFAULT_BRACE_STYLE - ) - public String braceStyle = DEFAULT_BRACE_STYLE; - - @Override - public List configurations() { - return Arrays.asList(braceStyle, new Config()); - } - - - - private static class Config { - - boolean allowSingleLine = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ParenthesesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ParenthesesCheck.java deleted file mode 100644 index eb2ab242bb9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ParenthesesCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@TypeScriptRule -@JavaScriptRule -@DeprecatedRuleKey(ruleKey = "Parentheses") -@Rule(key = "S1110") -public class ParenthesesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ParseIntCallWithoutBaseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ParseIntCallWithoutBaseCheck.java deleted file mode 100644 index 0e29e4c6caa..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ParseIntCallWithoutBaseCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2427") -public class ParseIntCallWithoutBaseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ParsingErrorCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ParsingErrorCheck.java deleted file mode 100644 index bff843edbab..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ParsingErrorCheck.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.JavaScriptCheck; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2260") -@DeprecatedRuleKey(ruleKey = "ParsingError") -public class ParsingErrorCheck implements JavaScriptCheck { - // this class exists only to provide metadata for rule -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PostMessageCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PostMessageCheck.java deleted file mode 100644 index c05fb4b30bb..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PostMessageCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2819") -public class PostMessageCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferAsConstCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferAsConstCheck.java deleted file mode 100644 index 41874eb94fa..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferAsConstCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S6590") -public class PreferAsConstCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferDefaultLastCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferDefaultLastCheck.java deleted file mode 100644 index f887ad3e57d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferDefaultLastCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4524") -public class PreferDefaultLastCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferEnumInitializersCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferEnumInitializersCheck.java deleted file mode 100644 index 4f9b43de493..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferEnumInitializersCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S6572") -public class PreferEnumInitializersCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferForOfCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferForOfCheck.java deleted file mode 100644 index 97bf768d600..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferForOfCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4138") -public class PreferForOfCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferFunctionTypeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferFunctionTypeCheck.java deleted file mode 100644 index 96a2cd68b43..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferFunctionTypeCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S6598") -public class PreferFunctionTypeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferLiteralEnumMemberCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferLiteralEnumMemberCheck.java deleted file mode 100644 index f4515f6de39..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferLiteralEnumMemberCheck.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S6550") -public class PreferLiteralEnumMemberCheck extends Check { - - @Override - public List configurations() { - return List.of(new Config()); - } - - - - private static class Config { - - // Option to allow bitwise expressions in enum initializers (Default: false). - // We might consider changing this flag value if the rule is too noisy. - // For example, in the ruling, the rule reports +500 issues for the TypeScript project. - // Remark: Adding a rule property afterward might cause deployment issues with SonarCloud. - boolean allowBitwiseExpressions = false; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferNamespaceCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferNamespaceCheck.java deleted file mode 100644 index b09c5c8796c..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferNamespaceCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4156") -public class PreferNamespaceCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferNullishCoalescingCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferNullishCoalescingCheck.java deleted file mode 100644 index 1198a0f0f8f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferNullishCoalescingCheck.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S6606") -public class PreferNullishCoalescingCheck extends Check { - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - - - private static class Config { - - boolean ignoreConditionalTests = true; - boolean ignoreTernaryTests = false; - boolean ignoreMixedLogicalExpressions = true; - boolean allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferObjectHasOwnCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferObjectHasOwnCheck.java deleted file mode 100644 index f2cf6789e57..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferObjectHasOwnCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6653") -public class PreferObjectHasOwnCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferObjectLiteralCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferObjectLiteralCheck.java deleted file mode 100644 index c50eb08be1c..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferObjectLiteralCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S2428") -public class PreferObjectLiteralCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferObjectSpreadCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferObjectSpreadCheck.java deleted file mode 100644 index c914b5d4ecd..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferObjectSpreadCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6661") -public class PreferObjectSpreadCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferPromiseRejectErrorsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferPromiseRejectErrorsCheck.java deleted file mode 100644 index 5d9b37699cd..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferPromiseRejectErrorsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6671") -public class PreferPromiseRejectErrorsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferPromiseShorthandCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferPromiseShorthandCheck.java deleted file mode 100644 index 4668c88efb7..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferPromiseShorthandCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4634") -public class PreferPromiseShorthandCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferReadOnlyPropsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferReadOnlyPropsCheck.java deleted file mode 100644 index d91a12402d5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferReadOnlyPropsCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S6759") -public class PreferReadOnlyPropsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferReadonlyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferReadonlyCheck.java deleted file mode 100644 index 7f0519e9c91..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferReadonlyCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S2933") -public class PreferReadonlyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferRegexLiteralsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferRegexLiteralsCheck.java deleted file mode 100644 index 18e216eec49..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferRegexLiteralsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6325") -public class PreferRegexLiteralsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferRegexpExecCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferRegexpExecCheck.java deleted file mode 100644 index 5319a3c2c71..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferRegexpExecCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6594") -public class PreferRegexpExecCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferReturnThisTypeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferReturnThisTypeCheck.java deleted file mode 100644 index bd3a50f49b1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferReturnThisTypeCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S6565") -public class PreferReturnThisTypeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferSpreadCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferSpreadCheck.java deleted file mode 100644 index a38ec82fa46..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferSpreadCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6666") -public class PreferSpreadCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferStringStartsEndsWithCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferStringStartsEndsWithCheck.java deleted file mode 100644 index 474524c70dc..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferStringStartsEndsWithCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6557") -public class PreferStringStartsEndsWithCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferTagOverRoleCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferTagOverRoleCheck.java deleted file mode 100644 index ce0a82d2b68..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferTagOverRoleCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6819") -public class PreferTagOverRoleCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferTypeGuardCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferTypeGuardCheck.java deleted file mode 100644 index 132566a108a..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PreferTypeGuardCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4322") -public class PreferTypeGuardCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PrimitiveWrappersCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PrimitiveWrappersCheck.java deleted file mode 100644 index 1a9389d1858..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PrimitiveWrappersCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "PrimitiveWrappers") -@Rule(key = "S1533") -public class PrimitiveWrappersCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ProcessArgvCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ProcessArgvCheck.java deleted file mode 100644 index 24b7c0157a8..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ProcessArgvCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4823") -public class ProcessArgvCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ProductionDebugCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ProductionDebugCheck.java deleted file mode 100644 index 8bd63804ca2..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ProductionDebugCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4507") -public class ProductionDebugCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PropTypesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PropTypesCheck.java deleted file mode 100644 index f38cafec847..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PropTypesCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S6774") -public class PropTypesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PseudoRandomCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PseudoRandomCheck.java deleted file mode 100644 index 4690ace299d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PseudoRandomCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2245") -public class PseudoRandomCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PublicStaticReadonlyCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PublicStaticReadonlyCheck.java deleted file mode 100644 index 8e651727ad1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PublicStaticReadonlyCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S1444") -public class PublicStaticReadonlyCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PubliclyWritableDirectoriesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PubliclyWritableDirectoriesCheck.java deleted file mode 100644 index 63c7cf880e5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/PubliclyWritableDirectoriesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5443") -public class PubliclyWritableDirectoriesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReassignedParameterCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReassignedParameterCheck.java deleted file mode 100644 index f7bd8ac7570..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReassignedParameterCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1226") -public class ReassignedParameterCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RedeclaredSymbolCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RedeclaredSymbolCheck.java deleted file mode 100644 index f35777907e3..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RedeclaredSymbolCheck.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S2814") -public class RedeclaredSymbolCheck extends Check { - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - - - private static class Config { - - boolean builtinGlobals = false; - boolean ignoreDeclarationMerge = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReduceInitialValueCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReduceInitialValueCheck.java deleted file mode 100644 index 8100269468e..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReduceInitialValueCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6959") -public class ReduceInitialValueCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RedundantAssignmentCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RedundantAssignmentCheck.java deleted file mode 100644 index 721d5a540f0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RedundantAssignmentCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4165") -public class RedundantAssignmentCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RedundantTypeAliasesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RedundantTypeAliasesCheck.java deleted file mode 100644 index 1a7904824ff..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RedundantTypeAliasesCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S6564") -public class RedundantTypeAliasesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReferenceErrorCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReferenceErrorCheck.java deleted file mode 100644 index 36b0b6db7f2..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReferenceErrorCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3827") -public class ReferenceErrorCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RegexComplexityCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RegexComplexityCheck.java deleted file mode 100644 index aebe7d9b190..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RegexComplexityCheck.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5843") -public class RegexComplexityCheck extends Check { - - private static final int DEFAULT_THRESHOLD = 20; - - @RuleProperty( - key = "maxComplexity", - description = "The maximum authorized complexity.", - defaultValue = "" + DEFAULT_THRESHOLD - ) - int threshold = DEFAULT_THRESHOLD; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(threshold) - ); - } - - - - private static class Config { - - int threshold; - - Config(int threshold) { - this.threshold = threshold; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RegularExprCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RegularExprCheck.java deleted file mode 100644 index 42752dba13f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RegularExprCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4784") -public class RegularExprCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RequireRenderReturnCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RequireRenderReturnCheck.java deleted file mode 100644 index ed8987648cb..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RequireRenderReturnCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6435") -public class RequireRenderReturnCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReturnInSetterCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReturnInSetterCheck.java deleted file mode 100644 index 9d381e60ef9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReturnInSetterCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S2432") -public class ReturnInSetterCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReturnOfBooleanExpressionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReturnOfBooleanExpressionCheck.java deleted file mode 100644 index ad0d7555959..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ReturnOfBooleanExpressionCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S1126") -public class ReturnOfBooleanExpressionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RoleHasRequiredAriaPropsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RoleHasRequiredAriaPropsCheck.java deleted file mode 100644 index c8a29bbfcf1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RoleHasRequiredAriaPropsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6807") -public class RoleHasRequiredAriaPropsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RoleSupportsAriaPropsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RoleSupportsAriaPropsCheck.java deleted file mode 100644 index a7608eff60d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RoleSupportsAriaPropsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6811") -public class RoleSupportsAriaPropsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RulesOfHooksCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RulesOfHooksCheck.java deleted file mode 100644 index 259f1477807..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/RulesOfHooksCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6440") -public class RulesOfHooksCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S100.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S100.java new file mode 100644 index 00000000000..b2561e3d0b1 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S100.java @@ -0,0 +1,47 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S100") +public class S100 extends Check { + + public static final String DEFAULT = "^[_a-z][a-zA-Z0-9]*$"; + + @RuleProperty( + key = "format", + description = "Regular expression used to check the function names against.", + defaultValue = "" + DEFAULT + ) + public String format = DEFAULT; + + @Override + public List configurations() { + return Collections.singletonList(new FormatRuleProperty(format)); + } + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S101.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S101.java new file mode 100644 index 00000000000..d19baf263ad --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S101.java @@ -0,0 +1,47 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S101") +public class S101 extends Check { + + private static final String DEFAULT_FORMAT = "^[A-Z][a-zA-Z0-9]*$"; + + @RuleProperty( + key = "format", + description = "Regular expression used to check the class names against.", + defaultValue = "" + DEFAULT_FORMAT + ) + public String format = DEFAULT_FORMAT; + + @Override + public List configurations() { + return Collections.singletonList(new FormatRuleProperty(format)); + } + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S103.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S103.java new file mode 100644 index 00000000000..103bdee2261 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S103.java @@ -0,0 +1,54 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "LineLength") +@Rule(key = "S103") +public class S103 extends Check { + + private static final int DEFAULT_MAXIMUM_LINE_LENGTH = 180; + + @RuleProperty( + key = "maximumLineLength", + description = "The maximum authorized line length.", + defaultValue = "" + DEFAULT_MAXIMUM_LINE_LENGTH + ) + public int maximumLineLength = DEFAULT_MAXIMUM_LINE_LENGTH; + + @Override + public List configurations() { + Map configurationsMap = new HashMap<>(); + configurationsMap.put("code", maximumLineLength); + configurationsMap.put("tabWidth", 1); + return Collections.singletonList(configurationsMap); + } + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S104.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S104.java new file mode 100644 index 00000000000..e4da80ff8e2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S104.java @@ -0,0 +1,58 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S104") +public class S104 extends Check { + + private static final int DEFAULT = 1000; + + @RuleProperty( + key = "maximum", + description = "Maximum authorized lines in a file.", + defaultValue = "" + DEFAULT + ) + public int maximum = DEFAULT; + + @Override + public List configurations() { + return Collections.singletonList( + new Config(maximum) + ); + } + + + + private static class Config { + + int maximum; + + Config(int maximum) { + this.maximum = maximum; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S105.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S105.java new file mode 100644 index 00000000000..00773b2280a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S105.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "TabCharacter") +@Rule(key = "S105") +public class S105 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S106.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S106.java new file mode 100644 index 00000000000..5d6e6daf0cc --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S106.java @@ -0,0 +1,58 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +// deprecated key in TS +@DeprecatedRuleKey(ruleKey = "S2228") +@Rule(key = "S106") +public class S106 extends Check { + + + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + private static class Config { + + List allow = Arrays.asList( + "assert", + "clear", + "count", + "group", + "groupCollapsed", + "groupEnd", + "info", + "table", + "time", + "timeEnd", + "trace" + ); + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1066.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1066.java new file mode 100644 index 00000000000..14e30c55b12 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1066.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "CollapsibleIfStatements") +@Rule(key = "S1066") +public class S1066 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1067.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1067.java new file mode 100644 index 00000000000..f05e4bbeadd --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1067.java @@ -0,0 +1,57 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1067") +public class S1067 extends Check { + + private static final int DEFAULT = 3; + + @RuleProperty( + description = "Maximum number of allowed conditional operators in an expression", + defaultValue = "" + DEFAULT + ) + public int max = DEFAULT; + + @Override + public List configurations() { + return Collections.singletonList( + new Config(this.max) + ); + } + + + + private static class Config { + + int max; + + Config(int max) { + this.max = max; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1068.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1068.java new file mode 100644 index 00000000000..c4d9096952d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1068.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S1068") +public class S1068 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S107.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S107.java new file mode 100644 index 00000000000..557f96ae700 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S107.java @@ -0,0 +1,60 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "ExcessiveParameterList") +@Rule(key = "S107") +public class S107 extends Check { + + private static final int DEFAULT_MAXIMUM_FUNCTION_PARAMETERS = 7; + + @RuleProperty( + key = "maximumFunctionParameters", + description = "The maximum authorized number of parameters", + defaultValue = "" + DEFAULT_MAXIMUM_FUNCTION_PARAMETERS + ) + int maximumFunctionParameters = DEFAULT_MAXIMUM_FUNCTION_PARAMETERS; + + @Override + public List configurations() { + return Collections.singletonList( + new Config(maximumFunctionParameters) + ); + } + + + + private static class Config { + + int max; + + Config(int maximumFunctionParameters) { + this.max = maximumFunctionParameters; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1077.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1077.java new file mode 100644 index 00000000000..b370dd9be80 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1077.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S1077") +public class S1077 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S108.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S108.java new file mode 100644 index 00000000000..8db7f32a45f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S108.java @@ -0,0 +1,44 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "EmptyBlock") +@Rule(key = "S108") +public class S108 extends Check { + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + + + private static class Config { + + boolean allowEmptyCatch = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1082.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1082.java new file mode 100644 index 00000000000..a333ac7c7ff --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1082.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1082") +public class S1082 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S109.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S109.java new file mode 100644 index 00000000000..b002e33fd62 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S109.java @@ -0,0 +1,47 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S109") +public class S109 extends Check { + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + + + private static class Config { + + int[] ignore = { 0, 1, -1, 24, 60 }; + boolean ignoreEnums = true; + boolean ignoreReadonlyClassProperties = true; + boolean ignoreNumericLiteralTypes = true; + boolean ignoreDefaultValues = true; + boolean ignoreClassFieldInitialValues = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1090.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1090.java new file mode 100644 index 00000000000..6c46762fafa --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1090.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "S6854") +@Rule(key = "S1090") +public class S1090 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1105.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1105.java new file mode 100644 index 00000000000..beed832a074 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1105.java @@ -0,0 +1,52 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Arrays; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1105") +public class S1105 extends Check { + + private static final String DEFAULT_BRACE_STYLE = "1tbs"; + + @RuleProperty( + key = "braceStyle", + description = "enforced brace-style: 1tbs, stroustrup or allman.", + defaultValue = DEFAULT_BRACE_STYLE + ) + public String braceStyle = DEFAULT_BRACE_STYLE; + + @Override + public List configurations() { + return Arrays.asList(braceStyle, new Config()); + } + + + + private static class Config { + + boolean allowSingleLine = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1110.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1110.java new file mode 100644 index 00000000000..209cfd452ec --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1110.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@TypeScriptRule +@JavaScriptRule +@DeprecatedRuleKey(ruleKey = "Parentheses") +@Rule(key = "S1110") +public class S1110 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1116.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1116.java new file mode 100644 index 00000000000..c36b591fea3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1116.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1116") +public class S1116 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1117.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1117.java new file mode 100644 index 00000000000..f0a260a6cf6 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1117.java @@ -0,0 +1,45 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +// deprecated key in TS +@DeprecatedRuleKey(ruleKey = "S1524") +@Rule(key = "S1117") +public class S1117 extends Check { + + + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + private static class Config { + + String hoist = "all"; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1119.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1119.java new file mode 100644 index 00000000000..9fed007dd6c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1119.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1119") +public class S1119 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1121.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1121.java new file mode 100644 index 00000000000..ad47e41b185 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1121.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "AssignmentWithinCondition") +@Rule(key = "S1121") +public class S1121 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1125.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1125.java new file mode 100644 index 00000000000..31fe30aec8c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1125.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1125") +public class S1125 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1126.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1126.java new file mode 100644 index 00000000000..83c062e93e9 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1126.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S1126") +public class S1126 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1128.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1128.java new file mode 100644 index 00000000000..d617e42e169 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1128.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1128") +public class S1128 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S113.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S113.java new file mode 100644 index 00000000000..39b67a447ec --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S113.java @@ -0,0 +1,39 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "MissingNewlineAtEndOfFile") +@Rule(key = "S113") +public class S113 extends Check { + + @Override + public List configurations() { + return Collections.singletonList("always"); + } + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1131.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1131.java new file mode 100644 index 00000000000..4a6407c828a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1131.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1131") +@DeprecatedRuleKey(ruleKey = "TrailingWhitespace") +public class S1131 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1134.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1134.java new file mode 100644 index 00000000000..bb937eede75 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1134.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1134") +public class S1134 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1135.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1135.java new file mode 100644 index 00000000000..79799582663 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1135.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1135") +public class S1135 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1143.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1143.java new file mode 100644 index 00000000000..7908e07b2fa --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1143.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1143") +public class S1143 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1154.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1154.java new file mode 100644 index 00000000000..69afe068ae4 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1154.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1154") +public class S1154 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S117.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S117.java new file mode 100644 index 00000000000..c54a5d8de89 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S117.java @@ -0,0 +1,50 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S117") +public class S117 extends Check { + + private static final String CAMEL_CASED = "^[_$A-Za-z][$A-Za-z0-9]*$"; + private static final String UPPER_CASED = "^[_$A-Z][_$A-Z0-9]+$"; + + private static final String DEFAULT_FORMAT = CAMEL_CASED + "|" + UPPER_CASED; + + @RuleProperty( + key = "format", + description = "Regular expression used to check the names against.", + defaultValue = "" + DEFAULT_FORMAT + ) + public String format = DEFAULT_FORMAT; + + @Override + public List configurations() { + return Collections.singletonList(new FormatRuleProperty(format)); + } + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1172.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1172.java new file mode 100644 index 00000000000..a0ec744390d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1172.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1172") +@DeprecatedRuleKey(ruleKey = "UnusedFunctionArgument") +public class S1172 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1186.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1186.java new file mode 100644 index 00000000000..a70ac7f256d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1186.java @@ -0,0 +1,42 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1186") +public class S1186 extends Check { + + + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + private static class Config { + + String[] allow = { "arrowFunctions", "constructors", "private-constructors" }; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1192.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1192.java new file mode 100644 index 00000000000..ae5d5a77642 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1192.java @@ -0,0 +1,63 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Arrays; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S1192") +public class S1192 extends Check { + + private static final int DEFAULT_THRESHOLD = 3; + private static final String DEFAULT_IGNORED_STRINGS = "application/json"; + + @RuleProperty( + key = "threshold", + description = "Number of times a literal must be duplicated to trigger an issue.", + defaultValue = "" + DEFAULT_THRESHOLD + ) + int threshold = DEFAULT_THRESHOLD; + + @RuleProperty( + key = "ignoreStrings", + description = "Comma-separated list of strings that must be ignored.", + defaultValue = "" + DEFAULT_IGNORED_STRINGS + ) + String ignoreStrings = DEFAULT_IGNORED_STRINGS; + + @Override + public List configurations() { + return Arrays.asList(new Config(threshold, ignoreStrings)); + } + + private static class Config { + int threshold; + String ignoreStrings; + + public Config(int threshold, String ignoreStrings) { + this.threshold = threshold; + this.ignoreStrings = ignoreStrings; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1199.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1199.java new file mode 100644 index 00000000000..9fd5a21bef4 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1199.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S1199") +public class S1199 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S121.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S121.java new file mode 100644 index 00000000000..a1cb5e74222 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S121.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "CurlyBraces") +@Rule(key = "S121") +public class S121 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1219.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1219.java new file mode 100644 index 00000000000..cf5061b5f8b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1219.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1219") +public class S1219 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S122.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S122.java new file mode 100644 index 00000000000..e1f3e7af200 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S122.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S122") +@DeprecatedRuleKey(ruleKey = "OneStatementPerLine") +public class S122 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1226.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1226.java new file mode 100644 index 00000000000..cd93062e120 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1226.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1226") +public class S1226 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S124.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S124.java new file mode 100644 index 00000000000..674df3462c9 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S124.java @@ -0,0 +1,76 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "CommentRegularExpression") +@Rule(key = "S124") +public class S124 extends Check { + + private static final String DEFAULT_MESSAGE = "The regular expression matches this comment."; + private static final String DEFAULT_REGULAR_EXPRESSION = ""; + private static final String DEFAULT_FLAGS = ""; + + @RuleProperty( + key = "regularExpression", + description = "The regular expression (JavaScript syntax)", + defaultValue = DEFAULT_REGULAR_EXPRESSION + ) + public String regularExpression = DEFAULT_REGULAR_EXPRESSION; + + @RuleProperty(key = "message", description = "The issue message", defaultValue = DEFAULT_MESSAGE) + public String message = DEFAULT_MESSAGE; + + @RuleProperty( + key = "flags", + description = "Regular expression modifier flags", + defaultValue = DEFAULT_FLAGS + ) + public String flags = DEFAULT_FLAGS; + + + + @Override + public List configurations() { + return Collections.singletonList( + new S124.Config(regularExpression, message, flags) + ); + } + + private static class Config { + + String regularExpression; + String message; + String flags; + + Config(String regularExpression, String message, String flags) { + this.regularExpression = regularExpression; + this.message = message; + this.flags = flags; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S125.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S125.java new file mode 100644 index 00000000000..9650434fbab --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S125.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "CommentedCode") +@Rule(key = "S125") +public class S125 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S126.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S126.java new file mode 100644 index 00000000000..c6086d1c95d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S126.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "ElseIfWithoutElse") +@Rule(key = "S126") +public class S126 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1264.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1264.java new file mode 100644 index 00000000000..510600bca8c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1264.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1264") +public class S1264 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S128.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S128.java new file mode 100644 index 00000000000..4d0c6ebddb4 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S128.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "NonEmptyCaseWithoutBreak") +@Rule(key = "S128") +public class S128 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1291.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1291.java new file mode 100644 index 00000000000..180da079a81 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1291.java @@ -0,0 +1,29 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1291") +public class S1291 extends Check { + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1301.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1301.java new file mode 100644 index 00000000000..2ad643ce9af --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1301.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1301") +public class S1301 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S131.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S131.java new file mode 100644 index 00000000000..0a06485a446 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S131.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S131") +@DeprecatedRuleKey(ruleKey = "SwitchWithoutDefault") +public class S131 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1313.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1313.java new file mode 100644 index 00000000000..0914168b742 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1313.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S1313") +public class S1313 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1314.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1314.java new file mode 100644 index 00000000000..492b0887e32 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1314.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1314") +@DeprecatedRuleKey(ruleKey = "OctalNumber") +public class S1314 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1321.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1321.java new file mode 100644 index 00000000000..bbb493e1acf --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1321.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@Rule(key = "S1321") +@DeprecatedRuleKey(ruleKey = "WithStatement") +public class S1321 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S134.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S134.java new file mode 100644 index 00000000000..8aa359b8171 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S134.java @@ -0,0 +1,58 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S134") +@DeprecatedRuleKey(ruleKey = "NestedIfDepth") +public class S134 extends Check { + + private static final int DEFAULT_MAXIMUM_NESTING_LEVEL = 3; + + @RuleProperty( + key = "maximumNestingLevel", + description = "Maximum allowed \"if/for/while/switch/try\" statements nesting depth", + defaultValue = "" + DEFAULT_MAXIMUM_NESTING_LEVEL + ) + public int maximumNestingLevel = DEFAULT_MAXIMUM_NESTING_LEVEL; + + @Override + public List configurations() { + return Collections.singletonList(new Config(maximumNestingLevel)); + } + + + + private static class Config { + + int maximumNestingLevel; + + Config(int maximumNestingLevel) { + this.maximumNestingLevel = maximumNestingLevel; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S135.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S135.java new file mode 100644 index 00000000000..88ec63fea73 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S135.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S135") +@DeprecatedRuleKey(ruleKey = "TooManyBreakOrContinueInLoop") +public class S135 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S138.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S138.java new file mode 100644 index 00000000000..cfa4c75c844 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S138.java @@ -0,0 +1,58 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S138") +public class S138 extends Check { + + private static final int DEFAULT = 200; + + @RuleProperty( + key = "max", + description = "Maximum authorized lines in a function", + defaultValue = "" + DEFAULT + ) + public int max = DEFAULT; + + @Override + public List configurations() { + return Collections.singletonList( + new Config(max) + ); + } + + + + private static class Config { + + int maximum; + + Config(int maximum) { + this.maximum = maximum; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S139.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S139.java new file mode 100644 index 00000000000..097af7b6e91 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S139.java @@ -0,0 +1,58 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S139") +@DeprecatedRuleKey(ruleKey = "TrailingComment") +public class S139 extends Check { + + private static final String DEFAULT_LEGAL_COMMENT_PATTERN = "^\\s*[^\\s]+$"; + + @RuleProperty( + key = "pattern", + description = "Pattern (JavaScript syntax) for text of trailing comments that are allowed.", + defaultValue = DEFAULT_LEGAL_COMMENT_PATTERN + ) + String legalCommentPattern = DEFAULT_LEGAL_COMMENT_PATTERN; + + + + @Override + public List configurations() { + return Collections.singletonList(new Config(legalCommentPattern)); + } + + private static class Config { + + String ignorePattern; + + Config(String ignorePattern) { + this.ignorePattern = ignorePattern; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1438.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1438.java new file mode 100644 index 00000000000..f3227ec5917 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1438.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1438") +@DeprecatedRuleKey(ruleKey = "Semicolon") +public class S1438 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1439.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1439.java new file mode 100644 index 00000000000..0c7b04a06f3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1439.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "LabelPlacement") +@Rule(key = "S1439") +public class S1439 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1440.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1440.java new file mode 100644 index 00000000000..b190596c700 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1440.java @@ -0,0 +1,39 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "EqEqEq") +@Rule(key = "S1440") +public class S1440 extends Check { + + @Override + public List configurations() { + return Collections.singletonList("smart"); + } + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1441.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1441.java new file mode 100644 index 00000000000..4e2002031ea --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1441.java @@ -0,0 +1,55 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Arrays; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "SingleQuote") +@Rule(key = "S1441") +public class S1441 extends Check { + + private static final boolean DEFAULT = true; + + @RuleProperty( + key = "singleQuotes", + description = "Set to true to require single quotes, false for double quotes.", + defaultValue = "" + DEFAULT + ) + public boolean singleQuotes = DEFAULT; + + @Override + public List configurations() { + return Arrays.asList(singleQuotes ? "single" : "double", new Config()); + } + + + + private static class Config { + + boolean avoidEscape = true; + boolean allowTemplateLiterals = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1442.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1442.java new file mode 100644 index 00000000000..c30dfb009a7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1442.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S1442") +public class S1442 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1444.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1444.java new file mode 100644 index 00000000000..66fc3071d1b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1444.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S1444") +public class S1444 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1451.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1451.java new file mode 100644 index 00000000000..04377d366e9 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1451.java @@ -0,0 +1,66 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1451") +public class S1451 extends Check { + + private static final String DEFAULT_HEADER_FORMAT = ""; + + @RuleProperty( + key = "headerFormat", + description = "Expected copyright and license header", + defaultValue = DEFAULT_HEADER_FORMAT, + type = "TEXT" + ) + public String headerFormat = DEFAULT_HEADER_FORMAT; + + @RuleProperty( + key = "isRegularExpression", + description = "Whether the headerFormat is a regular expression", + defaultValue = "false" + ) + public boolean isRegularExpression = false; + + @Override + public List configurations() { + return Collections.singletonList(new Config(headerFormat, isRegularExpression)); + } + + + + private static class Config { + + String headerFormat; + boolean isRegularExpression; + + Config(String headerFormat, boolean isRegularExpression) { + this.headerFormat = headerFormat; + this.isRegularExpression = isRegularExpression; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1472.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1472.java new file mode 100644 index 00000000000..d9c862abf42 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1472.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1472") +public class S1472 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1479.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1479.java new file mode 100644 index 00000000000..b2618ed6466 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1479.java @@ -0,0 +1,47 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1479") +public class S1479 extends Check { + + private static final int DEFAULT_MAXIMUM = 30; + + @RuleProperty( + key = "maximum", + description = "Maximum number of \"case\".", + defaultValue = "" + DEFAULT_MAXIMUM + ) + int maximum = DEFAULT_MAXIMUM; + + @Override + public List configurations() { + return Collections.singletonList(maximum); + } + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1481.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1481.java new file mode 100644 index 00000000000..caf6b0ef6a3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1481.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@Rule(key = "S1481") +@DeprecatedRuleKey(ruleKey = "UnusedVariable") +public class S1481 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1488.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1488.java new file mode 100644 index 00000000000..569ebee24a0 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1488.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1488") +public class S1488 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1515.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1515.java new file mode 100644 index 00000000000..27c8f52495b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1515.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "FunctionDefinitionInsideLoop") +@Rule(key = "S1515") +public class S1515 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1516.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1516.java new file mode 100644 index 00000000000..8933a261c68 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1516.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "MultilineStringLiterals") +@Rule(key = "S1516") +public class S1516 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1523.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1523.java new file mode 100644 index 00000000000..bbfe25aded6 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1523.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S1523") +@DeprecatedRuleKey(ruleKey = "Eval") +public class S1523 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1525.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1525.java new file mode 100644 index 00000000000..d1e4e911154 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1525.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "DebuggerStatement") +@Rule(key = "S1525") +public class S1525 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1526.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1526.java new file mode 100644 index 00000000000..9dbe4852aea --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1526.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "VariableDeclarationAfterUsage") +@Rule(key = "S1526") +public class S1526 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1527.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1527.java new file mode 100644 index 00000000000..dbc8899e117 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1527.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@Rule(key = "S1527") +@DeprecatedRuleKey(ruleKey = "FutureReservedWords") +public class S1527 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1528.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1528.java new file mode 100644 index 00000000000..ccc9a65b833 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1528.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1528") +@DeprecatedRuleKey(ruleKey = "ArrayAndObjectConstructors") +public class S1528 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1529.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1529.java new file mode 100644 index 00000000000..aa865332127 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1529.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "BitwiseOperators") +@Rule(key = "S1529") +public class S1529 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1530.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1530.java new file mode 100644 index 00000000000..4c3a376b2a4 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1530.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "FunctionDeclarationsWithinBlocks") +@Rule(key = "S1530") +public class S1530 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1533.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1533.java new file mode 100644 index 00000000000..d7a08819dc2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1533.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "PrimitiveWrappers") +@Rule(key = "S1533") +public class S1533 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1534.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1534.java new file mode 100644 index 00000000000..27945f67565 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1534.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1534") +@DeprecatedRuleKey(ruleKey = "DuplicatePropertyName") +public class S1534 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1535.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1535.java new file mode 100644 index 00000000000..6ee37607fb7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1535.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1535") +@DeprecatedRuleKey(ruleKey = "ForIn") +public class S1535 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1536.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1536.java new file mode 100644 index 00000000000..a9723b7a1b5 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1536.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@Rule(key = "S1536") +@DeprecatedRuleKey(ruleKey = "DuplicateFunctionArgument") +public class S1536 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1537.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1537.java new file mode 100644 index 00000000000..a095440c7db --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1537.java @@ -0,0 +1,35 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +/** + * http://stackoverflow.com/questions/7246618/trailing-commas-in-javascript + */ +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1537") +@DeprecatedRuleKey(ruleKey = "TrailingComma") +public class S1537 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1539.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1539.java new file mode 100644 index 00000000000..80cd04f301b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1539.java @@ -0,0 +1,39 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "StrictMode") +@Rule(key = "S1539") +public class S1539 extends Check { + + @Override + public List configurations() { + return Collections.singletonList("never"); + } + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1541Js.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1541Js.java new file mode 100644 index 00000000000..a5cb3eef41f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1541Js.java @@ -0,0 +1,61 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +// This rule is duplicated for TypeScript because both rules actually map to the +// same eslint key while defining a different name for the same rule property. + +@JavaScriptRule +@DeprecatedRuleKey(ruleKey = "FunctionComplexity") +@Rule(key = "S1541") +public class S1541Js extends Check { + + private static final int DEFAULT_THRESHOLD = 10; + + @RuleProperty( + key = "maximumFunctionComplexityThreshold", + description = "The maximum authorized complexity in function", + defaultValue = "" + DEFAULT_THRESHOLD + ) + int threshold = DEFAULT_THRESHOLD; + + @Override + public List configurations() { + return Collections.singletonList( + new Config(threshold) + ); + } + + + + private static class Config { + + int threshold; + + Config(int threshold) { + this.threshold = threshold; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1541Ts.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1541Ts.java new file mode 100644 index 00000000000..982f2d05b2f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1541Ts.java @@ -0,0 +1,55 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S1541") +public class S1541Ts extends Check { + + private static final int DEFAULT_THRESHOLD = 10; + + @RuleProperty( + key = "Threshold", + description = "The maximum authorized complexity.", + defaultValue = "" + DEFAULT_THRESHOLD + ) + int threshold = DEFAULT_THRESHOLD; + + @Override + public List configurations() { + return Collections.singletonList( + new Config(threshold) + ); + } + + + private static class Config { + + int threshold; + + Config(int threshold) { + this.threshold = threshold; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1607.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1607.java new file mode 100644 index 00000000000..adb8fa9641f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1607.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TestFileCheck; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1607") +public class S1607 extends TestFileCheck { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1656.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1656.java new file mode 100644 index 00000000000..fb37b5f8106 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1656.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1656") +public class S1656 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1751.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1751.java new file mode 100644 index 00000000000..ee734f9c498 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1751.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1751") +public class S1751 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1763.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1763.java new file mode 100644 index 00000000000..fa36b4e09b2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1763.java @@ -0,0 +1,33 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1763") +@DeprecatedRuleKey(ruleKey = "S1736") +@DeprecatedRuleKey(ruleKey = "UnreachableCode") +public class S1763 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1764.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1764.java new file mode 100644 index 00000000000..5b22a5b7e8b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1764.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1764") +public class S1764 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1774.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1774.java new file mode 100644 index 00000000000..96bc7c302b5 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1774.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1774") +@DeprecatedRuleKey(ruleKey = "ConditionalOperator") +public class S1774 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1788.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1788.java new file mode 100644 index 00000000000..46363e843da --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1788.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1788") +public class S1788 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1821.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1821.java new file mode 100644 index 00000000000..a4d77c32ca7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1821.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1821") +public class S1821 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1848.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1848.java new file mode 100644 index 00000000000..c83abce1d29 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1848.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "ConstructorFunctionsForSideEffects") +@Rule(key = "S1848") +public class S1848 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1854.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1854.java new file mode 100644 index 00000000000..7a30d5293eb --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1854.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S1854") +public class S1854 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1862.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1862.java new file mode 100644 index 00000000000..be520599e22 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1862.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1862") +public class S1862 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1871.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1871.java new file mode 100644 index 00000000000..26716a55859 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1871.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1871") +public class S1871 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1874.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1874.java new file mode 100644 index 00000000000..7524f8cf514 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1874.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1874") +public class S1874 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1940.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1940.java new file mode 100644 index 00000000000..49f0658b81e --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1940.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1940") +public class S1940 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1994.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1994.java new file mode 100644 index 00000000000..8973020f38b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S1994.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S1994") +public class S1994 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2004.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2004.java new file mode 100644 index 00000000000..58826e2fa67 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2004.java @@ -0,0 +1,58 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2004") +public class S2004 extends Check { + + private static final int DEFAULT_THRESHOLD = 4; + + @RuleProperty( + key = "max", + description = "Maximum depth of allowed nested functions.", + defaultValue = "" + DEFAULT_THRESHOLD + ) + int threshold = DEFAULT_THRESHOLD; + + @Override + public List configurations() { + return Collections.singletonList( + new Config(threshold) + ); + } + + + + private static class Config { + + int threshold; + + Config(int threshold) { + this.threshold = threshold; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2068.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2068.java new file mode 100644 index 00000000000..fa5c0c29dc8 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2068.java @@ -0,0 +1,56 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2068") +public class S2068 extends Check { + + private static final String DEFAULT = "password, pwd, passwd"; + + @RuleProperty( + key = "passwordWords", + description = "Comma separated list of words identifying potential passwords.", + defaultValue = "" + DEFAULT + ) + public String passwordWords = DEFAULT; + + @Override + public List configurations() { + return Collections.singletonList( + new Config( + Arrays.stream(passwordWords.split(",")).map(String::trim).toArray(String[]::new)) + ); + } + + private static class Config { + String[] passwordWords; + Config(String[] passwordWords) { + this.passwordWords = passwordWords; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2077.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2077.java new file mode 100644 index 00000000000..9c3e3fe8a9d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2077.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2077") +public class S2077 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2092.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2092.java new file mode 100644 index 00000000000..c19cfa591ce --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2092.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2092") +public class S2092 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2094.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2094.java new file mode 100644 index 00000000000..f2407b82395 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2094.java @@ -0,0 +1,45 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S2094") +public class S2094 extends Check { + + + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + private static class Config { + + boolean allowConstructorOnly = false; + boolean allowEmpty = false; + boolean allowStaticOnly = true; + boolean allowWithDecorator = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2123.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2123.java new file mode 100644 index 00000000000..e7586b0ef63 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2123.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2123") +public class S2123 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2137.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2137.java new file mode 100644 index 00000000000..5ac9977d9c8 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2137.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2137") +public class S2137 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2138.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2138.java new file mode 100644 index 00000000000..8e0ecde0e27 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2138.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2138") +public class S2138 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2187.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2187.java new file mode 100644 index 00000000000..08d47618d51 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2187.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TestFileCheck; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2187") +public class S2187 extends TestFileCheck { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2189.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2189.java new file mode 100644 index 00000000000..1bdb081b267 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2189.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S2189") +public class S2189 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2201.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2201.java new file mode 100644 index 00000000000..3b910a89f02 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2201.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2201") +public class S2201 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2208.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2208.java new file mode 100644 index 00000000000..cc41b76b169 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2208.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2208") +public class S2208 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2234.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2234.java new file mode 100644 index 00000000000..f53b06eef71 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2234.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2234") +public class S2234 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2245.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2245.java new file mode 100644 index 00000000000..260c9aa5ccb --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2245.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2245") +public class S2245 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2251.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2251.java new file mode 100644 index 00000000000..f6a062608cf --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2251.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2251") +public class S2251 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2255.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2255.java new file mode 100644 index 00000000000..d0726a3af27 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2255.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2255") +public class S2255 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2259.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2259.java new file mode 100644 index 00000000000..21b784d8f0c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2259.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S2259") +public class S2259 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2260.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2260.java new file mode 100644 index 00000000000..e418dc99268 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2260.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.JavaScriptCheck; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2260") +@DeprecatedRuleKey(ruleKey = "ParsingError") +public class S2260 implements JavaScriptCheck { + // this class exists only to provide metadata for rule +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2301.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2301.java new file mode 100644 index 00000000000..9805755ade3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2301.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2301") +public class S2301 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2301Check.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2301Check.java deleted file mode 100644 index ac09656493f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2301Check.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2301") -public class S2301Check extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2310.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2310.java new file mode 100644 index 00000000000..dc2f3138ee5 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2310.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2310") +public class S2310 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2376.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2376.java new file mode 100644 index 00000000000..d80c1093a35 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2376.java @@ -0,0 +1,58 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2376") +public class S2376 extends Check { + + private static final boolean DEFAULT_GET_WITHOUT_SET = false; + + @RuleProperty( + key = "getWithoutSet", + description = "Reports on getters without setters.", + defaultValue = "" + DEFAULT_GET_WITHOUT_SET + ) + boolean getWithoutSet = DEFAULT_GET_WITHOUT_SET; + + @Override + public List configurations() { + return Collections.singletonList( + new Config(getWithoutSet) + ); + } + + + + private static class Config { + + boolean getWithoutSet; + + Config(boolean getWithoutSet) { + this.getWithoutSet = getWithoutSet; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2392.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2392.java new file mode 100644 index 00000000000..5b78e03f5bb --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2392.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2392") +public class S2392 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2424.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2424.java new file mode 100644 index 00000000000..90e0617c5be --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2424.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2424") +public class S2424 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2427.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2427.java new file mode 100644 index 00000000000..d95ce7dea77 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2427.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2427") +public class S2427 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2428.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2428.java new file mode 100644 index 00000000000..333205a1c9d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2428.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S2428") +public class S2428 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2430.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2430.java new file mode 100644 index 00000000000..6e7969e1a99 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2430.java @@ -0,0 +1,44 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S2430") +public class S2430 extends Check { + + + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + private static class Config { + + boolean newIsCap = true; + boolean capIsNew = false; + boolean properties = false; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2432.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2432.java new file mode 100644 index 00000000000..1784c0d3fa1 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2432.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S2432") +public class S2432 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2486.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2486.java new file mode 100644 index 00000000000..2fcc4ce2be6 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2486.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TestFileCheck; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2486") +public class S2486 extends TestFileCheck { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2589.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2589.java new file mode 100644 index 00000000000..f9995782fab --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2589.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S2589") +public class S2589 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2598.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2598.java new file mode 100644 index 00000000000..a58a78c4277 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2598.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2598") +public class S2598 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2612.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2612.java new file mode 100644 index 00000000000..e6d9d145f8a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2612.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2612") +public class S2612 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2639.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2639.java new file mode 100644 index 00000000000..4303d118f10 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2639.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2639") +public class S2639 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2681.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2681.java new file mode 100644 index 00000000000..4d9b4409703 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2681.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2681") +public class S2681 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2685.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2685.java new file mode 100644 index 00000000000..a2118be5aa8 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2685.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2685") +public class S2685 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2688.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2688.java new file mode 100644 index 00000000000..2cd74647126 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2688.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2688") +public class S2688 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2692.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2692.java new file mode 100644 index 00000000000..88251196b22 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2692.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2692") +public class S2692 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2699.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2699.java new file mode 100644 index 00000000000..3c685a6df09 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2699.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TestFileCheck; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2699") +public class S2699 extends TestFileCheck { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2703.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2703.java new file mode 100644 index 00000000000..558cb370961 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2703.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S2703") +public class S2703 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2737.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2737.java new file mode 100644 index 00000000000..1a518a02df1 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2737.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2737") +public class S2737 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2755.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2755.java new file mode 100644 index 00000000000..fd1e5f9d128 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2755.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2755") +public class S2755 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2757.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2757.java new file mode 100644 index 00000000000..47c5b51b5d3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2757.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2757") +public class S2757 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2814.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2814.java new file mode 100644 index 00000000000..b10b2186b55 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2814.java @@ -0,0 +1,41 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S2814") +public class S2814 extends Check { + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + + + private static class Config { + + boolean builtinGlobals = false; + boolean ignoreDeclarationMerge = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2817.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2817.java new file mode 100644 index 00000000000..5f88b33535a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2817.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2817") +public class S2817 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2819.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2819.java new file mode 100644 index 00000000000..d93df450192 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2819.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2819") +public class S2819 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2870.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2870.java new file mode 100644 index 00000000000..f48f2935ed5 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2870.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2870") +public class S2870 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2871.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2871.java new file mode 100644 index 00000000000..57070004cce --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2871.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2871") +public class S2871 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2933.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2933.java new file mode 100644 index 00000000000..289bd6e3d72 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2933.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S2933") +public class S2933 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2966.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2966.java new file mode 100644 index 00000000000..549e234a9d3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2966.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S2966") +public class S2966 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2970.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2970.java new file mode 100644 index 00000000000..bb87db6186e --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2970.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TestFileCheck; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S2970") +public class S2970 extends TestFileCheck { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2990.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2990.java new file mode 100644 index 00000000000..3b0b593b84e --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2990.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2990") +public class S2990 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2999.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2999.java new file mode 100644 index 00000000000..fb13a5e7318 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S2999.java @@ -0,0 +1,54 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S2999") +public class S2999 extends Check { + + public static final boolean CONSIDER_JSDOC = false; + + @RuleProperty( + key = "considerJSDoc", + description = "Consider only functions with @constructor tag as constructor functions", + defaultValue = "" + CONSIDER_JSDOC + ) + public boolean considerJSDoc = CONSIDER_JSDOC; + + + + @Override + public List configurations() { + return Collections.singletonList(new Config(considerJSDoc)); + } + + private static class Config { + boolean considerJSDoc; + Config(boolean considerJSDoc) { + this.considerJSDoc = considerJSDoc; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3001.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3001.java new file mode 100644 index 00000000000..d2220df6f9c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3001.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3001") +public class S3001 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3003.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3003.java new file mode 100644 index 00000000000..a67f230cb1f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3003.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3003") +public class S3003 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3257.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3257.java new file mode 100644 index 00000000000..069eb5f6dad --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3257.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S3257") +public class S3257 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3317.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3317.java new file mode 100644 index 00000000000..65e31def868 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3317.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3317") +public class S3317 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3330.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3330.java new file mode 100644 index 00000000000..b6e1806dba7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3330.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3330") +public class S3330 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3353.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3353.java new file mode 100644 index 00000000000..f2d63d96cbd --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3353.java @@ -0,0 +1,42 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3353") +public class S3353 extends Check { + + + + @Override + public List configurations() { + return Collections.singletonList(new Configuration()); + } + + static class Configuration { + + String destructuring = "all"; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3358.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3358.java new file mode 100644 index 00000000000..6b7ab9b35ae --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3358.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3358") +public class S3358 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3402.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3402.java new file mode 100644 index 00000000000..bbdb261803f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3402.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3402") +public class S3402 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3403.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3403.java new file mode 100644 index 00000000000..f9589947075 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3403.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3403") +public class S3403 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3415.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3415.java new file mode 100644 index 00000000000..4f176125bc3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3415.java @@ -0,0 +1,36 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.api.batch.fs.InputFile.Type; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3415") +public class S3415 extends Check { + + @Override + public List targets() { + return Collections.singletonList(Type.TEST); + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3498.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3498.java new file mode 100644 index 00000000000..4407d86d52c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3498.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3498") +public class S3498 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3499.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3499.java new file mode 100644 index 00000000000..761086e5d88 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3499.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3499") +public class S3499 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3500.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3500.java new file mode 100644 index 00000000000..ce057e83e3e --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3500.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3500") +public class S3500 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3504.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3504.java new file mode 100644 index 00000000000..5b258cc333b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3504.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3504") +public class S3504 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3512.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3512.java new file mode 100644 index 00000000000..9efc0a279a2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3512.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3512") +public class S3512 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3513.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3513.java new file mode 100644 index 00000000000..297a7f75917 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3513.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3513") +public class S3513 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3514.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3514.java new file mode 100644 index 00000000000..32fe5a29626 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3514.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3514") +public class S3514 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3516.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3516.java new file mode 100644 index 00000000000..8af21d7e119 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3516.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3516") +public class S3516 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3523.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3523.java new file mode 100644 index 00000000000..945445cc2cd --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3523.java @@ -0,0 +1,27 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3523") +public class S3523 extends Check { + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3524.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3524.java new file mode 100644 index 00000000000..1e110b276d1 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3524.java @@ -0,0 +1,66 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3524") +public class S3524 extends Check { + + private static final boolean DEFAULT_PARAMETER_PARENS = false; + private static final boolean DEFAULT_BODY_BRACES = false; + + @RuleProperty( + key = "parameter_parens", + description = "True to require parentheses around parameters. False to forbid them for single parameter.", + defaultValue = "" + DEFAULT_PARAMETER_PARENS + ) + boolean parameterParens = DEFAULT_PARAMETER_PARENS; + + @RuleProperty( + key = "body_braces", + description = "True to require curly braces around function body. False to forbid them for single-return bodies.", + defaultValue = "" + DEFAULT_BODY_BRACES + ) + boolean bodyBraces = DEFAULT_BODY_BRACES; + + + + @Override + public List configurations() { + return Collections.singletonList(new Config(parameterParens, bodyBraces)); + } + + private static class Config { + + boolean requireParameterParentheses; + boolean requireBodyBraces; + + Config(boolean requireParameterParentheses, boolean requireBodyBraces) { + this.requireParameterParentheses = requireParameterParentheses; + this.requireBodyBraces = requireBodyBraces; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3525.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3525.java new file mode 100644 index 00000000000..a677d16a35c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3525.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3525") +public class S3525 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3531.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3531.java new file mode 100644 index 00000000000..dccabd0df2f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3531.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3531") +public class S3531 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3533.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3533.java new file mode 100644 index 00000000000..1a5054269a8 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3533.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S3533") +public class S3533 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3579.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3579.java new file mode 100644 index 00000000000..5e5e8c1b92d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3579.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3579") +public class S3579 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3616.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3616.java new file mode 100644 index 00000000000..c8111a20866 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3616.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3616") +public class S3616 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3626.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3626.java new file mode 100644 index 00000000000..e4e95b628d2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3626.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3626") +public class S3626 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3686.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3686.java new file mode 100644 index 00000000000..28943861cb3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3686.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3686") +public class S3686 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3696.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3696.java new file mode 100644 index 00000000000..74eea4103a2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3696.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S3696") +public class S3696 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3699.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3699.java new file mode 100644 index 00000000000..d2a2a6a060e --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3699.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3699") +public class S3699 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3723.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3723.java new file mode 100644 index 00000000000..62684ffddd4 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3723.java @@ -0,0 +1,37 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3723") +public class S3723 extends Check { + + + + @Override + public List configurations() { + return Collections.singletonList("always-multiline"); + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3735.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3735.java new file mode 100644 index 00000000000..d3845318d98 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3735.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3735") +public class S3735 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3757.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3757.java new file mode 100644 index 00000000000..88f8b612dab --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3757.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3757") +public class S3757 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3758.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3758.java new file mode 100644 index 00000000000..85124f2f717 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3758.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3758") +public class S3758 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3760.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3760.java new file mode 100644 index 00000000000..db54ae7f06f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3760.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3760") +public class S3760 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3776.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3776.java new file mode 100644 index 00000000000..a9e06d5640a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3776.java @@ -0,0 +1,47 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3776") +public class S3776 extends Check { + + private static final int DEFAULT_THRESHOLD = 15; + + @RuleProperty( + key = "threshold", + description = "The maximum authorized complexity.", + defaultValue = "" + DEFAULT_THRESHOLD + ) + int threshold = DEFAULT_THRESHOLD; + + + + @Override + public List configurations() { + return Collections.singletonList(threshold); + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3782.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3782.java new file mode 100644 index 00000000000..fc543bb2571 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3782.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3782") +public class S3782 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3785.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3785.java new file mode 100644 index 00000000000..eab95726a49 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3785.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3785") +public class S3785 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3786.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3786.java new file mode 100644 index 00000000000..53321e74bea --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3786.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3786") +public class S3786 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3796.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3796.java new file mode 100644 index 00000000000..213aab4fe71 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3796.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3796") +public class S3796 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3798.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3798.java new file mode 100644 index 00000000000..7fb52ac7f03 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3798.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3798") +public class S3798 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3799.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3799.java new file mode 100644 index 00000000000..86bd7bdc54b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3799.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3799") +public class S3799 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3800.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3800.java new file mode 100644 index 00000000000..4afdcf06577 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3800.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3800") +public class S3800 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3801.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3801.java new file mode 100644 index 00000000000..33c7fc4b5c2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3801.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3801") +public class S3801 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3812.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3812.java new file mode 100644 index 00000000000..6d7a5260396 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3812.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3812") +public class S3812 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3827.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3827.java new file mode 100644 index 00000000000..27f2d412471 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3827.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3827") +public class S3827 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3834.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3834.java new file mode 100644 index 00000000000..b63595a3013 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3834.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S3834") +public class S3834 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3854.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3854.java new file mode 100644 index 00000000000..ae00043b206 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3854.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3854") +public class S3854 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3863.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3863.java new file mode 100644 index 00000000000..3d85ed7834f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3863.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S3863") +public class S3863 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3923.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3923.java new file mode 100644 index 00000000000..9fbfa86b718 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3923.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3923") +public class S3923 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3972.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3972.java new file mode 100644 index 00000000000..bae24b48fbf --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3972.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3972") +public class S3972 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3973.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3973.java new file mode 100644 index 00000000000..0d0421193f9 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3973.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3973") +public class S3973 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3981.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3981.java new file mode 100644 index 00000000000..1bd04548a76 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3981.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3981") +public class S3981 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3984.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3984.java new file mode 100644 index 00000000000..b9800127ac5 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S3984.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S3984") +public class S3984 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4023.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4023.java new file mode 100644 index 00000000000..d5baa0a6c57 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4023.java @@ -0,0 +1,39 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4023") +public class S4023 extends Check { + + + + @Override + public List configurations() { + return List.of(new Config()); + } + + private static class Config { + + boolean allowSingleExtends = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4030.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4030.java new file mode 100644 index 00000000000..cad19c03b87 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4030.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4030") +public class S4030 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4036.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4036.java new file mode 100644 index 00000000000..336067d27e7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4036.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S4036") +public class S4036 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4043.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4043.java new file mode 100644 index 00000000000..58ef6d86a2a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4043.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4043") +public class S4043 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4084.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4084.java new file mode 100644 index 00000000000..c99bc6dff31 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4084.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@DeprecatedRuleKey(ruleKey = "S6855") +@Rule(key = "S4084") +public class S4084 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4123.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4123.java new file mode 100644 index 00000000000..e6e483c00b2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4123.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4123") +public class S4123 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4124.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4124.java new file mode 100644 index 00000000000..929e0efccd4 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4124.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4124") +public class S4124 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4125.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4125.java new file mode 100644 index 00000000000..0034ed6d45c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4125.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S4125") +public class S4125 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4136.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4136.java new file mode 100644 index 00000000000..ac706b7be0b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4136.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4136") +public class S4136 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4137.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4137.java new file mode 100644 index 00000000000..0470aea4015 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4137.java @@ -0,0 +1,41 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4137") +public class S4137 extends Check { + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + + + private static class Config { + + String assertionStyle = "as"; + String objectLiteralTypeAssertions = "allow"; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4138.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4138.java new file mode 100644 index 00000000000..adccd844021 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4138.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4138") +public class S4138 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4139.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4139.java new file mode 100644 index 00000000000..726611a5eb2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4139.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4139") +public class S4139 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4140.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4140.java new file mode 100644 index 00000000000..7dcb6022eb0 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4140.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4140") +public class S4140 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4143.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4143.java new file mode 100644 index 00000000000..791e9edce5d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4143.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4143") +public class S4143 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4144.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4144.java new file mode 100644 index 00000000000..6db28580327 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4144.java @@ -0,0 +1,39 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4144") +public class S4144 extends Check { + + private static final int DEFAULT_THRESHOLD = 3; + + @Override + public List configurations() { + return Collections.singletonList(DEFAULT_THRESHOLD); + } + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4156.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4156.java new file mode 100644 index 00000000000..257bc958c64 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4156.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4156") +public class S4156 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4157.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4157.java new file mode 100644 index 00000000000..412cf483902 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4157.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4157") +public class S4157 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4158.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4158.java new file mode 100644 index 00000000000..e2919660dd6 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4158.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4158") +public class S4158 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4165.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4165.java new file mode 100644 index 00000000000..5918c4361fa --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4165.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4165") +public class S4165 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4204.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4204.java new file mode 100644 index 00000000000..8dd26f92cd2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4204.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4204") +public class S4204 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4275.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4275.java new file mode 100644 index 00000000000..43381b83824 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4275.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4275") +public class S4275 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4322.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4322.java new file mode 100644 index 00000000000..555ab551dfb --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4322.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4322") +public class S4322 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4323.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4323.java new file mode 100644 index 00000000000..8acd2737e14 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4323.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4323") +public class S4323 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4324.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4324.java new file mode 100644 index 00000000000..3da026c66c6 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4324.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4324") +public class S4324 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4325.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4325.java new file mode 100644 index 00000000000..64905ebcb8f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4325.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4325") +public class S4325 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4326.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4326.java new file mode 100644 index 00000000000..6943f6c053b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4326.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4326") +public class S4326 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4327.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4327.java new file mode 100644 index 00000000000..10515b7f79c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4327.java @@ -0,0 +1,40 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4327") +public class S4327 extends Check { + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + + + private static class Config { + + boolean allowDestructuring = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4328.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4328.java new file mode 100644 index 00000000000..cd96c2ad8d2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4328.java @@ -0,0 +1,61 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4328") +public class S4328 extends Check { + + private static final String DEFAULT = ""; + + @RuleProperty( + key = "whitelist", + description = "Comma separated list of modules to ignore while checking in package.json.", + defaultValue = "" + DEFAULT + ) + public String whitelist = DEFAULT; + + @Override + public List configurations() { + return Collections.singletonList( + new Config( + Arrays.stream(whitelist.split(",")) + .map(String::trim) + .toArray(String[]::new) + ) + ); + } + + + + private static class Config { + + String[] whitelist; + + Config(String[] whitelist) { + this.whitelist = whitelist; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4335.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4335.java new file mode 100644 index 00000000000..b22a9271e27 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4335.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4335") +public class S4335 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4423.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4423.java new file mode 100644 index 00000000000..2cdf9ab88d2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4423.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4423") +public class S4423 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4426.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4426.java new file mode 100644 index 00000000000..00471bf05af --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4426.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4426") +public class S4426 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4502.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4502.java new file mode 100644 index 00000000000..47f6ff640b1 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4502.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4502") +public class S4502 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4507.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4507.java new file mode 100644 index 00000000000..5fc7f52ea91 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4507.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4507") +public class S4507 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4524.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4524.java new file mode 100644 index 00000000000..e697e1f07f7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4524.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4524") +public class S4524 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4619.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4619.java new file mode 100644 index 00000000000..374b0ecea8d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4619.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4619") +public class S4619 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4621.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4621.java new file mode 100644 index 00000000000..d84525ef66f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4621.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4621") +public class S4621 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4622.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4622.java new file mode 100644 index 00000000000..fd44874cc4a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4622.java @@ -0,0 +1,56 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4622") +public class S4622 extends Check { + + private static final int DEFAULT_THRESHOLD = 3; + + @RuleProperty( + key = "max", + description = "Maximum elements authorized in a union type definition.", + defaultValue = "" + DEFAULT_THRESHOLD + ) + int threshold = DEFAULT_THRESHOLD; + + @Override + public List configurations() { + return Collections.singletonList( + new Config(threshold) + ); + } + + + + private static class Config { + + int threshold; + + Config(int threshold) { + this.threshold = threshold; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4623.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4623.java new file mode 100644 index 00000000000..b74b748b44a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4623.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4623") +public class S4623 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4624.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4624.java new file mode 100644 index 00000000000..6cc4ea17ed4 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4624.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4624") +public class S4624 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4634.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4634.java new file mode 100644 index 00000000000..fbe7e2f9ffa --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4634.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4634") +public class S4634 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4721.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4721.java new file mode 100644 index 00000000000..aa674317a4e --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4721.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4721") +public class S4721 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4782.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4782.java new file mode 100644 index 00000000000..9c5128059f9 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4782.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4782") +public class S4782 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4784.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4784.java new file mode 100644 index 00000000000..bd826ce500d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4784.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4784") +public class S4784 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4787.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4787.java new file mode 100644 index 00000000000..1a735d19a03 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4787.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4787") +public class S4787 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4790.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4790.java new file mode 100644 index 00000000000..95497db80a8 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4790.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4790") +public class S4790 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4798.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4798.java new file mode 100644 index 00000000000..a3decc77622 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4798.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S4798") +public class S4798 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4817.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4817.java new file mode 100644 index 00000000000..01b2c2a1bc5 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4817.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4817") +public class S4817 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4818.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4818.java new file mode 100644 index 00000000000..1b62452e892 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4818.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4818") +public class S4818 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4822.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4822.java new file mode 100644 index 00000000000..735fa880d2c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4822.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4822") +public class S4822 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4823.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4823.java new file mode 100644 index 00000000000..3455d1eb9c7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4823.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4823") +public class S4823 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4829.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4829.java new file mode 100644 index 00000000000..739abedda09 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4829.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4829") +public class S4829 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4830.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4830.java new file mode 100644 index 00000000000..24965198eae --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S4830.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S4830") +public class S4830 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5042.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5042.java new file mode 100644 index 00000000000..5e408b113fe --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5042.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5042") +public class S5042 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5122.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5122.java new file mode 100644 index 00000000000..8041448d99a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5122.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5122") +public class S5122 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5148.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5148.java new file mode 100644 index 00000000000..77199f50165 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5148.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5148") +public class S5148 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5247.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5247.java new file mode 100644 index 00000000000..8c3cd7fee9c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5247.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5247") +public class S5247 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5254.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5254.java new file mode 100644 index 00000000000..bccb1bb3510 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5254.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@TypeScriptRule +@JavaScriptRule +@DeprecatedRuleKey(ruleKey = "S6849") +@Rule(key = "S5254") +public class S5254 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5256.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5256.java new file mode 100644 index 00000000000..f0377f3da2b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5256.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5256") +public class S5256 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5257.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5257.java new file mode 100644 index 00000000000..15599be1dab --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5257.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S5257") +public class S5257 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5260.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5260.java new file mode 100644 index 00000000000..e278f6d4ef1 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5260.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5260") +public class S5260 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5264.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5264.java new file mode 100644 index 00000000000..77e6e1e794a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5264.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S5264") +public class S5264 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5332.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5332.java new file mode 100644 index 00000000000..35b5602ce85 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5332.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5332") +public class S5332 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5443.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5443.java new file mode 100644 index 00000000000..b78e627cd5d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5443.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5443") +public class S5443 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5527.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5527.java new file mode 100644 index 00000000000..b718f02652f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5527.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5527") +public class S5527 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5542.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5542.java new file mode 100644 index 00000000000..d2405756c33 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5542.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5542") +public class S5542 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5547.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5547.java new file mode 100644 index 00000000000..d47261ff534 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5547.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5547") +public class S5547 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5604.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5604.java new file mode 100644 index 00000000000..3d40ae13c13 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5604.java @@ -0,0 +1,62 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5604") +public class S5604 extends Check { + + private static final String DEFAULT = "geolocation"; + + @RuleProperty( + key = "permissions", + description = "Comma-separated list of intrusive permissions to report " + + "(supported values: geolocation, camera, microphone, notifications, persistent-storage)", + defaultValue = "" + DEFAULT + ) + public String permissions = DEFAULT; + + @Override + public List configurations() { + return Collections.singletonList( + new Config( + Arrays.stream(permissions.split(",")).map(String::trim).toArray(String[]::new) + ) + ); + } + + + + private static class Config { + + String[] permissions; + + Config(String[] permissions) { + this.permissions = permissions; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5659.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5659.java new file mode 100644 index 00000000000..2d876bb370d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5659.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5659") +public class S5659 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5689.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5689.java new file mode 100644 index 00000000000..a63792174e1 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5689.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5689") +public class S5689 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5691.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5691.java new file mode 100644 index 00000000000..8aebc0257d7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5691.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5691") +public class S5691 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5693.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5693.java new file mode 100644 index 00000000000..84de1a483d2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5693.java @@ -0,0 +1,67 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5693") +public class S5693 extends Check { + private static final int DEFAULT_FILE_UPLOAD_SIZE_LIMIT = 8_000_000; + private static final int DEFAULT_STANDARD_SIZE_LIMIT = 2_000_000; + + @RuleProperty( + key = "fileUploadSizeLimit", + description = "The maximum size of HTTP requests handling file uploads (in bytes)", + defaultValue = "" + DEFAULT_FILE_UPLOAD_SIZE_LIMIT + ) + long fileUploadSizeLimit = DEFAULT_FILE_UPLOAD_SIZE_LIMIT; + + + @RuleProperty( + key = "standardSizeLimit", + description = "The maximum size of regular HTTP requests (in bytes)", + defaultValue = "" + DEFAULT_STANDARD_SIZE_LIMIT + ) + long standardSizeLimit = DEFAULT_STANDARD_SIZE_LIMIT; + + @Override + public List configurations() { + return Collections.singletonList( + new Config(fileUploadSizeLimit, standardSizeLimit) + ); + } + + + + private static class Config { + long fileUploadSizeLimit; + long standardSizeLimit; + + Config(long fileUploadSizeLimit, long standardSizeLimit) { + this.fileUploadSizeLimit = fileUploadSizeLimit; + this.standardSizeLimit = standardSizeLimit; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5725.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5725.java new file mode 100644 index 00000000000..66e249c9491 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5725.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5725") +public class S5725 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5728.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5728.java new file mode 100644 index 00000000000..f6879bcb499 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5728.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5728") +public class S5728 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5730.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5730.java new file mode 100644 index 00000000000..3e84eb8e20c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5730.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5730") +public class S5730 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5732.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5732.java new file mode 100644 index 00000000000..f6c20a0af63 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5732.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5732") +public class S5732 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5734.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5734.java new file mode 100644 index 00000000000..a5af22e17ef --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5734.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5734") +public class S5734 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5736.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5736.java new file mode 100644 index 00000000000..b7104ee5550 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5736.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5736") +public class S5736 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5739.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5739.java new file mode 100644 index 00000000000..f3621fdd447 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5739.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5739") +public class S5739 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5742.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5742.java new file mode 100644 index 00000000000..d05840850f2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5742.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5742") +public class S5742 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5743.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5743.java new file mode 100644 index 00000000000..bf9f8dc28b3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5743.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5743") +public class S5743 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5757.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5757.java new file mode 100644 index 00000000000..51379654efc --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5757.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5757") +public class S5757 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5759.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5759.java new file mode 100644 index 00000000000..89fe1234892 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5759.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5759") +public class S5759 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5842.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5842.java new file mode 100644 index 00000000000..cd4be0b7404 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5842.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5842") +public class S5842 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5843.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5843.java new file mode 100644 index 00000000000..9533ce924b3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5843.java @@ -0,0 +1,58 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5843") +public class S5843 extends Check { + + private static final int DEFAULT_THRESHOLD = 20; + + @RuleProperty( + key = "maxComplexity", + description = "The maximum authorized complexity.", + defaultValue = "" + DEFAULT_THRESHOLD + ) + int threshold = DEFAULT_THRESHOLD; + + @Override + public List configurations() { + return Collections.singletonList( + new Config(threshold) + ); + } + + + + private static class Config { + + int threshold; + + Config(int threshold) { + this.threshold = threshold; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5850.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5850.java new file mode 100644 index 00000000000..4451b751064 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5850.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5850") +public class S5850 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5852.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5852.java new file mode 100644 index 00000000000..9a472de122f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5852.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S5852") +public class S5852 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5856.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5856.java new file mode 100644 index 00000000000..8a156c90720 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5856.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5856") +public class S5856 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5860.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5860.java new file mode 100644 index 00000000000..6183440ecbe --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5860.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5860") +public class S5860 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5863.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5863.java new file mode 100644 index 00000000000..ad7dc7b3d53 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5863.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TestFileCheck; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S5863") +public class S5863 extends TestFileCheck { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5867.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5867.java new file mode 100644 index 00000000000..e77a7818d6b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5867.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5867") +public class S5867 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5868.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5868.java new file mode 100644 index 00000000000..368de69edae --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5868.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S5868") +public class S5868 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5869.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5869.java new file mode 100644 index 00000000000..46a1fb05360 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5869.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S5869") +public class S5869 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5876.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5876.java new file mode 100644 index 00000000000..f1ce1212eaa --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5876.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S5876") +public class S5876 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5958.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5958.java new file mode 100644 index 00000000000..612b670363c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5958.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TestFileCheck; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S5958") +public class S5958 extends TestFileCheck { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5973.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5973.java new file mode 100644 index 00000000000..0242c077d10 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S5973.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TestFileCheck; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S5973") +public class S5973 extends TestFileCheck { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6019.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6019.java new file mode 100644 index 00000000000..aa97a71c416 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6019.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6019") +public class S6019 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6035.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6035.java new file mode 100644 index 00000000000..86661c45ea2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6035.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6035") +public class S6035 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6079.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6079.java new file mode 100644 index 00000000000..d81019fb364 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6079.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TestFileCheck; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6079") +public class S6079 extends TestFileCheck { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6080.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6080.java new file mode 100644 index 00000000000..4a425cc22df --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6080.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TestFileCheck; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6080") +public class S6080 extends TestFileCheck { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6092.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6092.java new file mode 100644 index 00000000000..57f00e578b5 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6092.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TestFileCheck; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6092") +public class S6092 extends TestFileCheck { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6245.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6245.java new file mode 100644 index 00000000000..ebbf6482de0 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6245.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6245") +public class S6245 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6249.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6249.java new file mode 100644 index 00000000000..e3e36367608 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6249.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6249") +public class S6249 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6252.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6252.java new file mode 100644 index 00000000000..2a90576fc0b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6252.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6252") +public class S6252 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6265.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6265.java new file mode 100644 index 00000000000..d859a98d715 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6265.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6265") +public class S6265 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6268.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6268.java new file mode 100644 index 00000000000..de40aac7832 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6268.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6268") +public class S6268 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6270.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6270.java new file mode 100644 index 00000000000..157b728e343 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6270.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6270") +public class S6270 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6275.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6275.java new file mode 100644 index 00000000000..fcdc47156ac --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6275.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6275") +public class S6275 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6281.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6281.java new file mode 100644 index 00000000000..ef2d80bde13 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6281.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6281") +public class S6281 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6299.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6299.java new file mode 100644 index 00000000000..e05d621612a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6299.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6299") +public class S6299 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6302.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6302.java new file mode 100644 index 00000000000..7d5067de6c8 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6302.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6302") +public class S6302 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6303.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6303.java new file mode 100644 index 00000000000..e05e42c5c22 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6303.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6303") +public class S6303 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6304.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6304.java new file mode 100644 index 00000000000..d457dd86dcd --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6304.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6304") +public class S6304 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6308.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6308.java new file mode 100644 index 00000000000..7a8e43b4584 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6308.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6308") +public class S6308 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6317.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6317.java new file mode 100644 index 00000000000..319e89b4881 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6317.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6317") +public class S6317 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6319.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6319.java new file mode 100644 index 00000000000..0866074a455 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6319.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6319") +public class S6319 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6321.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6321.java new file mode 100644 index 00000000000..c1326dfeb77 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6321.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6321") +public class S6321 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6323.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6323.java new file mode 100644 index 00000000000..996cafbe83a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6323.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6323") +public class S6323 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6324.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6324.java new file mode 100644 index 00000000000..df245a8f1e3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6324.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6324") +public class S6324 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6325.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6325.java new file mode 100644 index 00000000000..29871113480 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6325.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6325") +public class S6325 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6326.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6326.java new file mode 100644 index 00000000000..a7e404a4358 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6326.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6326") +public class S6326 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6327.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6327.java new file mode 100644 index 00000000000..cd32feaddf9 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6327.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6327") +public class S6327 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6328.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6328.java new file mode 100644 index 00000000000..a878f13813b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6328.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6328") +public class S6328 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6329.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6329.java new file mode 100644 index 00000000000..39f93315da7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6329.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6329") +public class S6329 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6330.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6330.java new file mode 100644 index 00000000000..a9e4527ce9a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6330.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6330") +public class S6330 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6331.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6331.java new file mode 100644 index 00000000000..0bfd06886ef --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6331.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6331") +public class S6331 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6332.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6332.java new file mode 100644 index 00000000000..112cd6028ca --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6332.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6332") +public class S6332 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6333.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6333.java new file mode 100644 index 00000000000..7c3ec86a187 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6333.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6333") +public class S6333 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6351.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6351.java new file mode 100644 index 00000000000..46e25bdce48 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6351.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6351") +public class S6351 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6353.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6353.java new file mode 100644 index 00000000000..e6f481944c5 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6353.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6353") +public class S6353 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6397.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6397.java new file mode 100644 index 00000000000..421c7ef0817 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6397.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6397") +public class S6397 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6418.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6418.java new file mode 100644 index 00000000000..1bc0d9ec570 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6418.java @@ -0,0 +1,65 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6418") +public class S6418 extends Check { + + private static final String DEFAULT_SECRET_WORDS = "api[_.-]?key,auth,credential,secret,token"; + private static final String DEFAULT_RANDOMNESS_SENSIBILITY = "5.0"; + + @RuleProperty( + key = "secretWords", + description = "Comma separated list of words identifying potential secrets", + defaultValue = DEFAULT_SECRET_WORDS + ) + public String secretWords = DEFAULT_SECRET_WORDS; + @RuleProperty( + key = "randomnessSensibility", + description = "Minimum shannon entropy threshold of the secret", + defaultValue = DEFAULT_RANDOMNESS_SENSIBILITY + ) + public String randomnessSensibility = DEFAULT_RANDOMNESS_SENSIBILITY; + + @Override + public List configurations() { + return Collections.singletonList( + new Config(secretWords, randomnessSensibility) + ); + } + + private static class Config { + + String secretWords; + String randomnessSensibility; + + Config(String secretWords, String randomnessSensibility) { + this.secretWords = secretWords; + this.randomnessSensibility = randomnessSensibility; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6426.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6426.java new file mode 100644 index 00000000000..08334c6e338 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6426.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TestFileCheck; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6426") +public class S6426 extends TestFileCheck { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6435.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6435.java new file mode 100644 index 00000000000..b217d30c2a8 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6435.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6435") +public class S6435 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6438.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6438.java new file mode 100644 index 00000000000..1242d5f37a3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6438.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6438") +public class S6438 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6439.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6439.java new file mode 100644 index 00000000000..1c19e38291c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6439.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6439") +public class S6439 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6440.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6440.java new file mode 100644 index 00000000000..284aba848f6 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6440.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6440") +public class S6440 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6441.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6441.java new file mode 100644 index 00000000000..69d3fc10636 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6441.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6441") +public class S6441 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6442.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6442.java new file mode 100644 index 00000000000..8eab2560712 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6442.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6442") +public class S6442 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6443.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6443.java new file mode 100644 index 00000000000..d2591da7b19 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6443.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6443") +public class S6443 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6477.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6477.java new file mode 100644 index 00000000000..83ddf68fba2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6477.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6477") +public class S6477 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6478.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6478.java new file mode 100644 index 00000000000..6a30cf6e677 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6478.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6478") +public class S6478 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6479.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6479.java new file mode 100644 index 00000000000..b3fbfe555d8 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6479.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6479") +public class S6479 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6480.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6480.java new file mode 100644 index 00000000000..273cefc7928 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6480.java @@ -0,0 +1,42 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6480") +public class S6480 extends Check { + + + + @Override + public List configurations() { + return List.of(new Config()); + } + + private static class Config { + + boolean ignoreRefs = true; + boolean ignoreDOMComponents = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6481.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6481.java new file mode 100644 index 00000000000..34993fa67ec --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6481.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6481") +public class S6481 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6486.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6486.java new file mode 100644 index 00000000000..b476a6c1899 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6486.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6486") +public class S6486 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6509.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6509.java new file mode 100644 index 00000000000..b99dbdb24c0 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6509.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6509") +public class S6509 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6522.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6522.java new file mode 100644 index 00000000000..841a239d160 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6522.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6522") +public class S6522 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6523.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6523.java new file mode 100644 index 00000000000..6b5e5be0f94 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6523.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6523") +public class S6523 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6534.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6534.java new file mode 100644 index 00000000000..5255b8625ae --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6534.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6534") +public class S6534 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6535.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6535.java new file mode 100644 index 00000000000..9255c6806ff --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6535.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6535") +public class S6535 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6544.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6544.java new file mode 100644 index 00000000000..702aed3a8b4 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6544.java @@ -0,0 +1,50 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6544") +public class S6544 extends Check { + + private static class Config { + + boolean ignoreIIFE = true; + ChecksVoidReturn checksVoidReturn = new ChecksVoidReturn(); + + private static class ChecksVoidReturn { + + boolean attributes = false; + + boolean arguments = false; + } + } + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6550.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6550.java new file mode 100644 index 00000000000..361e267cf30 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6550.java @@ -0,0 +1,43 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S6550") +public class S6550 extends Check { + + @Override + public List configurations() { + return List.of(new Config()); + } + + + + private static class Config { + + // Option to allow bitwise expressions in enum initializers (Default: false). + // We might consider changing this flag value if the rule is too noisy. + // For example, in the ruling, the rule reports +500 issues for the TypeScript project. + // Remark: Adding a rule property afterward might cause deployment issues with SonarCloud. + boolean allowBitwiseExpressions = false; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6551.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6551.java new file mode 100644 index 00000000000..83d3206f167 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6551.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6551") +public class S6551 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6557.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6557.java new file mode 100644 index 00000000000..8886454ab02 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6557.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6557") +public class S6557 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6564.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6564.java new file mode 100644 index 00000000000..f4f3d5d603b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6564.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S6564") +public class S6564 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6565.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6565.java new file mode 100644 index 00000000000..837c48dce5c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6565.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S6565") +public class S6565 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6568.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6568.java new file mode 100644 index 00000000000..3e4a0c0a44f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6568.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S6568") +public class S6568 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6569.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6569.java new file mode 100644 index 00000000000..b9dae9c2ca7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6569.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S6569") +public class S6569 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6571.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6571.java new file mode 100644 index 00000000000..0707f49faf7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6571.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S6571") +public class S6571 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6572.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6572.java new file mode 100644 index 00000000000..88ce23e5234 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6572.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S6572") +public class S6572 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6578.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6578.java new file mode 100644 index 00000000000..52202b19a72 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6578.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S6578") +public class S6578 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6582.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6582.java new file mode 100644 index 00000000000..b4949ceb298 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6582.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6582") +public class S6582 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6583.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6583.java new file mode 100644 index 00000000000..583f179a94d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6583.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S6583") +public class S6583 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6590.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6590.java new file mode 100644 index 00000000000..9495fd3cd94 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6590.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S6590") +public class S6590 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6594.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6594.java new file mode 100644 index 00000000000..434e8960f07 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6594.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6594") +public class S6594 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6598.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6598.java new file mode 100644 index 00000000000..e579309ade3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6598.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S6598") +public class S6598 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6606.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6606.java new file mode 100644 index 00000000000..07a51b2bdf2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6606.java @@ -0,0 +1,43 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S6606") +public class S6606 extends Check { + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + + + private static class Config { + + boolean ignoreConditionalTests = true; + boolean ignoreTernaryTests = false; + boolean ignoreMixedLogicalExpressions = true; + boolean allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6627.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6627.java new file mode 100644 index 00000000000..b341b301d6c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6627.java @@ -0,0 +1,29 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6627") +public class S6627 extends Check { + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6635.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6635.java new file mode 100644 index 00000000000..fc4d6391d9b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6635.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6635") +public class S6635 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6637.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6637.java new file mode 100644 index 00000000000..f0f698ca725 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6637.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6637") +public class S6637 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6638.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6638.java new file mode 100644 index 00000000000..f5cae42a762 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6638.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6638") +public class S6638 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6643.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6643.java new file mode 100644 index 00000000000..32bd4128421 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6643.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6643") +public class S6643 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6644.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6644.java new file mode 100644 index 00000000000..4d3e3b60ee4 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6644.java @@ -0,0 +1,42 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6644") +public class S6644 extends Check { + + + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + private static class Config { + + boolean defaultAssignment = false; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6645.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6645.java new file mode 100644 index 00000000000..922a12986d7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6645.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S6645") +public class S6645 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6647.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6647.java new file mode 100644 index 00000000000..1ecba6e769d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6647.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6647") +public class S6647 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6650.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6650.java new file mode 100644 index 00000000000..aeb505f062b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6650.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6650") +public class S6650 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6653.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6653.java new file mode 100644 index 00000000000..430a7b550bb --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6653.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6653") +public class S6653 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6654.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6654.java new file mode 100644 index 00000000000..0b7f9fdd795 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6654.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6654") +public class S6654 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6657.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6657.java new file mode 100644 index 00000000000..7c657142d53 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6657.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6657") +public class S6657 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6660.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6660.java new file mode 100644 index 00000000000..0c4c677d5d3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6660.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6660") +public class S6660 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6661.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6661.java new file mode 100644 index 00000000000..233ac89a9be --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6661.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6661") +public class S6661 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6666.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6666.java new file mode 100644 index 00000000000..990cbc01a83 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6666.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6666") +public class S6666 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6671.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6671.java new file mode 100644 index 00000000000..a43606dcd46 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6671.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6671") +public class S6671 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6676.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6676.java new file mode 100644 index 00000000000..bce65e48ee1 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6676.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6676") +public class S6676 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6679.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6679.java new file mode 100644 index 00000000000..27a18f30249 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6679.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6679") +public class S6679 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6746.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6746.java new file mode 100644 index 00000000000..b1f8ff8b11a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6746.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6746") +public class S6746 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6747.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6747.java new file mode 100644 index 00000000000..7865ce1b52f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6747.java @@ -0,0 +1,57 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6747") +public class S6747 extends Check { + + @RuleProperty( + key = "whitelist", + description = "Comma-separated list of property and attribute names to ignore", + defaultValue = "" + ) + public String whitelist = ""; + + @Override + public List configurations() { + return Collections.singletonList( + new Config(Arrays.asList(whitelist.split(",")).stream().map(String::trim).toList()) + ); + } + + + + private static class Config { + + List ignore; + + Config(List ignore) { + this.ignore = ignore; + } + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6748.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6748.java new file mode 100644 index 00000000000..ba4750c78a0 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6748.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6748") +public class S6748 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6749.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6749.java new file mode 100644 index 00000000000..7fc2a7cf19b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6749.java @@ -0,0 +1,41 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6749") +public class S6749 extends Check { + + + + @Override + public List configurations() { + return List.of(new Config()); + } + + private static class Config { + + boolean allowExpressions = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6750.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6750.java new file mode 100644 index 00000000000..617897ed004 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6750.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6750") +public class S6750 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6754.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6754.java new file mode 100644 index 00000000000..d2fb712ba26 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6754.java @@ -0,0 +1,42 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6754") +public class S6754 extends Check { + + + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + static class Config { + + boolean allowDestructuredState = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6756.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6756.java new file mode 100644 index 00000000000..888a247b10f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6756.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6756") +public class S6756 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6757.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6757.java new file mode 100644 index 00000000000..f9c830d5256 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6757.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6757") +public class S6757 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6759.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6759.java new file mode 100644 index 00000000000..9ecf82cc129 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6759.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@Rule(key = "S6759") +public class S6759 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6761.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6761.java new file mode 100644 index 00000000000..479dc704ba5 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6761.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6761") +public class S6761 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6763.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6763.java new file mode 100644 index 00000000000..3e8d1bb65a3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6763.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6763") +public class S6763 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6766.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6766.java new file mode 100644 index 00000000000..726436dcbc8 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6766.java @@ -0,0 +1,42 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6766") +public class S6766 extends Check { + + + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + private static class Config { + + List forbid = List.of(">", "}"); + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6767.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6767.java new file mode 100644 index 00000000000..855b15d5601 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6767.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6767") +public class S6767 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6770.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6770.java new file mode 100644 index 00000000000..1f9b843a0ac --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6770.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6770") +public class S6770 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6772.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6772.java new file mode 100644 index 00000000000..190b5e047fa --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6772.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6772") +public class S6772 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6774.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6774.java new file mode 100644 index 00000000000..e9bf67f748d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6774.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S6774") +public class S6774 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6775.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6775.java new file mode 100644 index 00000000000..77f3b9c76a1 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6775.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6775") +public class S6775 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6788.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6788.java new file mode 100644 index 00000000000..0e18538415d --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6788.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6788") +public class S6788 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6789.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6789.java new file mode 100644 index 00000000000..df06552f5b3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6789.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6789") +public class S6789 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6790.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6790.java new file mode 100644 index 00000000000..7ebcc5dd8da --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6790.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6790") +public class S6790 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6791.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6791.java new file mode 100644 index 00000000000..0b7cd38a6e9 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6791.java @@ -0,0 +1,42 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6791") +public class S6791 extends Check { + + + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + private static class Config { + + boolean checkAliases = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6793.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6793.java new file mode 100644 index 00000000000..b6982900825 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6793.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6793") +public class S6793 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6807.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6807.java new file mode 100644 index 00000000000..a2f0bb643c8 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6807.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6807") +public class S6807 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6811.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6811.java new file mode 100644 index 00000000000..82b4600c243 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6811.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6811") +public class S6811 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6819.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6819.java new file mode 100644 index 00000000000..4feabff96a3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6819.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6819") +public class S6819 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6821.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6821.java new file mode 100644 index 00000000000..4b371dd7d27 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6821.java @@ -0,0 +1,43 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6821") +public class S6821 extends Check { + + + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + private static class Config { + + boolean ignoreNonDOM = true; + String[] allowedInvalidRoles = { "text" }; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6822.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6822.java new file mode 100644 index 00000000000..5ee9191d71a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6822.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6822") +public class S6822 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6823.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6823.java new file mode 100644 index 00000000000..3bfd0710350 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6823.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6823") +public class S6823 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6824.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6824.java new file mode 100644 index 00000000000..4e3c3eacfc0 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6824.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6824") +public class S6824 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6825.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6825.java new file mode 100644 index 00000000000..b9206918ac1 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6825.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6825") +public class S6825 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6827.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6827.java new file mode 100644 index 00000000000..67e7435df79 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6827.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6827") +public class S6827 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6836.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6836.java new file mode 100644 index 00000000000..dbe4e87c73b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6836.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6836") +public class S6836 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6840.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6840.java new file mode 100644 index 00000000000..85292dc1217 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6840.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6840") +public class S6840 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6841.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6841.java new file mode 100644 index 00000000000..2c4e8df2471 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6841.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6841") +public class S6841 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6842.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6842.java new file mode 100644 index 00000000000..decd15979be --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6842.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6842") +public class S6842 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6843.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6843.java new file mode 100644 index 00000000000..8e55256e886 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6843.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6843") +public class S6843 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6844.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6844.java new file mode 100644 index 00000000000..00870604a1a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6844.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6844") +public class S6844 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6845.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6845.java new file mode 100644 index 00000000000..e5c6720902b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6845.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6845") +public class S6845 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6846.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6846.java new file mode 100644 index 00000000000..015d27c3efb --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6846.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6846") +public class S6846 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6847.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6847.java new file mode 100644 index 00000000000..783be2e0f95 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6847.java @@ -0,0 +1,40 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6847") +public class S6847 extends Check { + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + private static class Config { + String[] handlers = {"onClick", "onMouseDown", "onMouseUp", "onKeyPress", "onKeyDown", "onKeyUp"}; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6848.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6848.java new file mode 100644 index 00000000000..9a1b1c6a424 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6848.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6848") +public class S6848 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6850.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6850.java new file mode 100644 index 00000000000..592e12752fb --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6850.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6850") +public class S6850 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6851.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6851.java new file mode 100644 index 00000000000..54e4e5b06c6 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6851.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6851") +public class S6851 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6852.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6852.java new file mode 100644 index 00000000000..a5169683d85 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6852.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6852") +public class S6852 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6853.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6853.java new file mode 100644 index 00000000000..26188c2e326 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6853.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6853") +public class S6853 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6859.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6859.java new file mode 100644 index 00000000000..6c6344a1069 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6859.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6859") +public class S6859 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6861.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6861.java new file mode 100644 index 00000000000..4b4d9490692 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6861.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S6861") +public class S6861 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6957.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6957.java new file mode 100644 index 00000000000..c1729f7022b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6957.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6957") +public class S6957 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6958.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6958.java new file mode 100644 index 00000000000..ebf3cd3a8d1 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6958.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6958") +public class S6958 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6959.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6959.java new file mode 100644 index 00000000000..839c85252c8 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S6959.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S6959") +public class S6959 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S7059.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S7059.java new file mode 100644 index 00000000000..49b6d39fc73 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S7059.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S7059") +public class S7059 extends Check { +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S7060.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S7060.java new file mode 100644 index 00000000000..a74d52f5434 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S7060.java @@ -0,0 +1,29 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S7060") +public class S7060 extends Check { + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S878.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S878.java new file mode 100644 index 00000000000..cfd6c30eb81 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S878.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "S878") +public class S878 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S881.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S881.java new file mode 100644 index 00000000000..465d9097d4b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S881.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S881") +public class S881 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S888.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S888.java new file mode 100644 index 00000000000..b27f6651c28 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S888.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S888") +public class S888 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S905.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S905.java new file mode 100644 index 00000000000..34ef1332fd8 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S905.java @@ -0,0 +1,45 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S905") +public class S905 extends Check { + + @Override + public List configurations() { + return Collections.singletonList(new Config()); + } + + + + private static class Config { + + boolean allowShortCircuit = true; + boolean allowTaggedTemplates = true; + boolean allowTernary = true; + boolean enforceForJSX = true; + } +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S909.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S909.java new file mode 100644 index 00000000000..1dd0064b363 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S909.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "S909") +@DeprecatedRuleKey(ruleKey = "ContinueStatement") +public class S909 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S930.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S930.java new file mode 100644 index 00000000000..66d507412b7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/S930.java @@ -0,0 +1,28 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import org.sonar.check.Rule; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; + +@JavaScriptRule +@Rule(key = "S930") +public class S930 extends Check { + + +} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SameLineConditionalCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SameLineConditionalCheck.java deleted file mode 100644 index 4d160bb11d0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SameLineConditionalCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3972") -public class SameLineConditionalCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SelfAssignmentCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SelfAssignmentCheck.java deleted file mode 100644 index 18e10c6d8e0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SelfAssignmentCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1656") -public class SelfAssignmentCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SemicolonCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SemicolonCheck.java deleted file mode 100644 index 14b4db233df..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SemicolonCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1438") -@DeprecatedRuleKey(ruleKey = "Semicolon") -public class SemicolonCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SessionRegenerationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SessionRegenerationCheck.java deleted file mode 100644 index 2872680c0fa..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SessionRegenerationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5876") -public class SessionRegenerationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ShorthandPropertiesNotGroupedCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ShorthandPropertiesNotGroupedCheck.java deleted file mode 100644 index d2b7ef98520..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ShorthandPropertiesNotGroupedCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3499") -public class ShorthandPropertiesNotGroupedCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SingleCharInCharacterClassesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SingleCharInCharacterClassesCheck.java deleted file mode 100644 index bf860e5905e..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SingleCharInCharacterClassesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S6397") -public class SingleCharInCharacterClassesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SingleCharacterAlternativeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SingleCharacterAlternativeCheck.java deleted file mode 100644 index 85fae57e922..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SingleCharacterAlternativeCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6035") -public class SingleCharacterAlternativeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SlowRegexCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SlowRegexCheck.java deleted file mode 100644 index d284e1833f8..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SlowRegexCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S5852") -public class SlowRegexCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SocketsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SocketsCheck.java deleted file mode 100644 index dee1ec70e0b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SocketsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4818") -public class SocketsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SonarNoInvalidRegexCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SonarNoInvalidRegexCheck.java deleted file mode 100644 index 48fd9afa420..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SonarNoInvalidRegexCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5856") -public class SonarNoInvalidRegexCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SonarNoMisleadingCharacterClassCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SonarNoMisleadingCharacterClassCheck.java deleted file mode 100644 index fdcd6b63a55..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SonarNoMisleadingCharacterClassCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S5868") -public class SonarNoMisleadingCharacterClassCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SonarPreferOptionalChainCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SonarPreferOptionalChainCheck.java deleted file mode 100644 index 7148607d9fd..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SonarPreferOptionalChainCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6582") -public class SonarPreferOptionalChainCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SqlQueriesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SqlQueriesCheck.java deleted file mode 100644 index 609e463268f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SqlQueriesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2077") -public class SqlQueriesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StableTestsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StableTestsCheck.java deleted file mode 100644 index 753adaf1e14..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StableTestsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TestFileCheck; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S5973") -public class StableTestsCheck extends TestFileCheck { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StandardInputCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StandardInputCheck.java deleted file mode 100644 index 9535621c894..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StandardInputCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4829") -public class StandardInputCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StatefulRegexCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StatefulRegexCheck.java deleted file mode 100644 index c88d4793890..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StatefulRegexCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6351") -public class StatefulRegexCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StrictModeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StrictModeCheck.java deleted file mode 100644 index c1c2f4c6f78..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StrictModeCheck.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "StrictMode") -@Rule(key = "S1539") -public class StrictModeCheck extends Check { - - @Override - public List configurations() { - return Collections.singletonList("never"); - } - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StrictTransportSecurityCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StrictTransportSecurityCheck.java deleted file mode 100644 index 2b66fed2a42..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StrictTransportSecurityCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5739") -public class StrictTransportSecurityCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StringConcatenatedWithNonStringCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StringConcatenatedWithNonStringCheck.java deleted file mode 100644 index 9d707287ec6..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StringConcatenatedWithNonStringCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3402") -public class StringConcatenatedWithNonStringCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StringConcatenationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StringConcatenationCheck.java deleted file mode 100644 index bc1b81735f8..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StringConcatenationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3512") -public class StringConcatenationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StringLiteralsQuotesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StringLiteralsQuotesCheck.java deleted file mode 100644 index befe306ae62..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StringLiteralsQuotesCheck.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Arrays; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "SingleQuote") -@Rule(key = "S1441") -public class StringLiteralsQuotesCheck extends Check { - - private static final boolean DEFAULT = true; - - @RuleProperty( - key = "singleQuotes", - description = "Set to true to require single quotes, false for double quotes.", - defaultValue = "" + DEFAULT - ) - public boolean singleQuotes = DEFAULT; - - @Override - public List configurations() { - return Arrays.asList(singleQuotes ? "single" : "double", new Config()); - } - - - - private static class Config { - - boolean avoidEscape = true; - boolean allowTemplateLiterals = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StringsComparisonCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StringsComparisonCheck.java deleted file mode 100644 index dffb0f149a3..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/StringsComparisonCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3003") -public class StringsComparisonCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SuperInvocationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SuperInvocationCheck.java deleted file mode 100644 index fa0f3bc5a95..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SuperInvocationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3854") -public class SuperInvocationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SwitchWithNotEnoughCaseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SwitchWithNotEnoughCaseCheck.java deleted file mode 100644 index 335e412e8cc..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SwitchWithNotEnoughCaseCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1301") -public class SwitchWithNotEnoughCaseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SwitchWithoutDefaultCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SwitchWithoutDefaultCheck.java deleted file mode 100644 index 2502a5a6104..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/SwitchWithoutDefaultCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S131") -@DeprecatedRuleKey(ruleKey = "SwitchWithoutDefault") -public class SwitchWithoutDefaultCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TabCharacterCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TabCharacterCheck.java deleted file mode 100644 index 38096b88aca..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TabCharacterCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "TabCharacter") -@Rule(key = "S105") -public class TabCharacterCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TabindexNoPositiveCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TabindexNoPositiveCheck.java deleted file mode 100644 index 40e265427e7..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TabindexNoPositiveCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6841") -public class TabindexNoPositiveCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TableHeaderCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TableHeaderCheck.java deleted file mode 100644 index 09ef9781e06..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TableHeaderCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5256") -public class TableHeaderCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TableHeaderReferenceCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TableHeaderReferenceCheck.java deleted file mode 100644 index aa4c3018af6..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TableHeaderReferenceCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5260") -public class TableHeaderReferenceCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TemplateStringMisuseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TemplateStringMisuseCheck.java deleted file mode 100644 index c97060ecfc0..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TemplateStringMisuseCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3786") -public class TemplateStringMisuseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TestCheckExceptionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TestCheckExceptionCheck.java deleted file mode 100644 index b0fa7b723cd..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TestCheckExceptionCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TestFileCheck; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S5958") -public class TestCheckExceptionCheck extends TestFileCheck { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ThrowLiteralCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ThrowLiteralCheck.java deleted file mode 100644 index bb221e84c6b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ThrowLiteralCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "S3696") -public class ThrowLiteralCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TodoTagPresenceCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TodoTagPresenceCheck.java deleted file mode 100644 index 5d158a25a6d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TodoTagPresenceCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1135") -public class TodoTagPresenceCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TooManyArgumentsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TooManyArgumentsCheck.java deleted file mode 100644 index c370e322665..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TooManyArgumentsCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S930") -public class TooManyArgumentsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TooManyBreakOrContinueInLoopCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TooManyBreakOrContinueInLoopCheck.java deleted file mode 100644 index 3bcea7ac6bf..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TooManyBreakOrContinueInLoopCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S135") -@DeprecatedRuleKey(ruleKey = "TooManyBreakOrContinueInLoop") -public class TooManyBreakOrContinueInLoopCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TooManyLinesInFileCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TooManyLinesInFileCheck.java deleted file mode 100644 index 72d16c81206..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TooManyLinesInFileCheck.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S104") -public class TooManyLinesInFileCheck extends Check { - - private static final int DEFAULT = 1000; - - @RuleProperty( - key = "maximum", - description = "Maximum authorized lines in a file.", - defaultValue = "" + DEFAULT - ) - public int maximum = DEFAULT; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(maximum) - ); - } - - - - private static class Config { - - int maximum; - - Config(int maximum) { - this.maximum = maximum; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TooManyLinesInFunctionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TooManyLinesInFunctionCheck.java deleted file mode 100644 index ac03c722742..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TooManyLinesInFunctionCheck.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S138") -public class TooManyLinesInFunctionCheck extends Check { - - private static final int DEFAULT = 200; - - @RuleProperty( - key = "max", - description = "Maximum authorized lines in a function", - defaultValue = "" + DEFAULT - ) - public int max = DEFAULT; - - @Override - public List configurations() { - return Collections.singletonList( - new Config(max) - ); - } - - - - private static class Config { - - int maximum; - - Config(int maximum) { - this.maximum = maximum; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TrailingCommaCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TrailingCommaCheck.java deleted file mode 100644 index 0d4348e68e2..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TrailingCommaCheck.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -/** - * http://stackoverflow.com/questions/7246618/trailing-commas-in-javascript - */ -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1537") -@DeprecatedRuleKey(ruleKey = "TrailingComma") -public class TrailingCommaCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TrailingCommentCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TrailingCommentCheck.java deleted file mode 100644 index e7e3353ff13..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TrailingCommentCheck.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S139") -@DeprecatedRuleKey(ruleKey = "TrailingComment") -public class TrailingCommentCheck extends Check { - - private static final String DEFAULT_LEGAL_COMMENT_PATTERN = "^\\s*[^\\s]+$"; - - @RuleProperty( - key = "pattern", - description = "Pattern (JavaScript syntax) for text of trailing comments that are allowed.", - defaultValue = DEFAULT_LEGAL_COMMENT_PATTERN - ) - String legalCommentPattern = DEFAULT_LEGAL_COMMENT_PATTERN; - - - - @Override - public List configurations() { - return Collections.singletonList(new Config(legalCommentPattern)); - } - - private static class Config { - - String ignorePattern; - - Config(String ignorePattern) { - this.ignorePattern = ignorePattern; - } - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TrailingWhitespaceCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TrailingWhitespaceCheck.java deleted file mode 100644 index 18bc2d3cc47..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TrailingWhitespaceCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1131") -@DeprecatedRuleKey(ruleKey = "TrailingWhitespace") -public class TrailingWhitespaceCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TryPromiseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TryPromiseCheck.java deleted file mode 100644 index 20ce333b0d9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/TryPromiseCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4822") -public class TryPromiseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnchangedLetVariableCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnchangedLetVariableCheck.java deleted file mode 100644 index 05b8ea43ae1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnchangedLetVariableCheck.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3353") -public class UnchangedLetVariableCheck extends Check { - - - - @Override - public List configurations() { - return Collections.singletonList(new Configuration()); - } - - static class Configuration { - - String destructuring = "all"; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UndefinedArgumentCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UndefinedArgumentCheck.java deleted file mode 100644 index 881b65049c3..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UndefinedArgumentCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4623") -public class UndefinedArgumentCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UndefinedAssignmentCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UndefinedAssignmentCheck.java deleted file mode 100644 index 3e2e3278fa4..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UndefinedAssignmentCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2138") -public class UndefinedAssignmentCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnicodeAwareRegexCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnicodeAwareRegexCheck.java deleted file mode 100644 index 3efa10fd3f1..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnicodeAwareRegexCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5867") -public class UnicodeAwareRegexCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnnecessaryCharacterEscapesCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnnecessaryCharacterEscapesCheck.java deleted file mode 100644 index 36907cfca61..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnnecessaryCharacterEscapesCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S6535") -public class UnnecessaryCharacterEscapesCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnnecessaryTypeArgumentsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnnecessaryTypeArgumentsCheck.java deleted file mode 100644 index a9bcfe34b0b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnnecessaryTypeArgumentsCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4157") -public class UnnecessaryTypeArgumentsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnreachableCodeCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnreachableCodeCheck.java deleted file mode 100644 index 1e168239f6b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnreachableCodeCheck.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1763") -@DeprecatedRuleKey(ruleKey = "S1736") -@DeprecatedRuleKey(ruleKey = "UnreachableCode") -public class UnreachableCodeCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnsafeUnzipCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnsafeUnzipCheck.java deleted file mode 100644 index 4de3150e267..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnsafeUnzipCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5042") -public class UnsafeUnzipCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedCollectionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedCollectionCheck.java deleted file mode 100644 index a6f458ebecb..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedCollectionCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4030") -public class UnusedCollectionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedFunctionArgumentCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedFunctionArgumentCheck.java deleted file mode 100644 index 6d12fde2aaf..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedFunctionArgumentCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1172") -@DeprecatedRuleKey(ruleKey = "UnusedFunctionArgument") -public class UnusedFunctionArgumentCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedImportCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedImportCheck.java deleted file mode 100644 index b2cc9eeef8f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedImportCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1128") -public class UnusedImportCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedNamedGroupsCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedNamedGroupsCheck.java deleted file mode 100644 index 5e4cd8a578a..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedNamedGroupsCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5860") -public class UnusedNamedGroupsCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedVariableCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedVariableCheck.java deleted file mode 100644 index 58f9ba65ec3..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnusedVariableCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@Rule(key = "S1481") -@DeprecatedRuleKey(ruleKey = "UnusedVariable") -public class UnusedVariableCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnverifiedCertificateCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnverifiedCertificateCheck.java deleted file mode 100644 index 4b0a2727f51..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnverifiedCertificateCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4830") -public class UnverifiedCertificateCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnverifiedHostnameCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnverifiedHostnameCheck.java deleted file mode 100644 index affe44addf5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UnverifiedHostnameCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5527") -public class UnverifiedHostnameCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UpdatedConstVariableCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UpdatedConstVariableCheck.java deleted file mode 100644 index fbd5ebdd8ba..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UpdatedConstVariableCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3500") -public class UpdatedConstVariableCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UseOfEmptyReturnValueCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UseOfEmptyReturnValueCheck.java deleted file mode 100644 index e834cdfa001..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UseOfEmptyReturnValueCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3699") -public class UseOfEmptyReturnValueCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UseTypeAliasCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UseTypeAliasCheck.java deleted file mode 100644 index 76d4c936e46..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UseTypeAliasCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4323") -public class UseTypeAliasCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UselessExpressionStatementCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UselessExpressionStatementCheck.java deleted file mode 100644 index fe0b876d67c..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UselessExpressionStatementCheck.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S905") -public class UselessExpressionStatementCheck extends Check { - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - - - private static class Config { - - boolean allowShortCircuit = true; - boolean allowTaggedTemplates = true; - boolean allowTernary = true; - boolean enforceForJSX = true; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UselessIncrementCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UselessIncrementCheck.java deleted file mode 100644 index 136695ef44b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UselessIncrementCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2123") -public class UselessIncrementCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UselessIntersectionCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UselessIntersectionCheck.java deleted file mode 100644 index 599667a2b33..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UselessIntersectionCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@Rule(key = "S4335") -public class UselessIntersectionCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UselessStringOperationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UselessStringOperationCheck.java deleted file mode 100644 index 4a3391e2a27..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/UselessStringOperationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S1154") -public class UselessStringOperationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ValidTypeOfCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ValidTypeOfCheck.java deleted file mode 100644 index 300a25c6e45..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ValidTypeOfCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S4125") -public class ValidTypeOfCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ValuesNotConvertibleToNumbersCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ValuesNotConvertibleToNumbersCheck.java deleted file mode 100644 index b5c8707c47d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/ValuesNotConvertibleToNumbersCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S3758") -public class ValuesNotConvertibleToNumbersCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VarDeclarationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VarDeclarationCheck.java deleted file mode 100644 index c8c3b9cf329..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VarDeclarationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3504") -public class VarDeclarationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VariableDeclarationAfterUsageCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VariableDeclarationAfterUsageCheck.java deleted file mode 100644 index a6b4231d0ab..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VariableDeclarationAfterUsageCheck.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -@DeprecatedRuleKey(ruleKey = "VariableDeclarationAfterUsage") -@Rule(key = "S1526") -public class VariableDeclarationAfterUsageCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VariableDeclarationWithoutVarCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VariableDeclarationWithoutVarCheck.java deleted file mode 100644 index adb632b96a3..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VariableDeclarationWithoutVarCheck.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; - -@JavaScriptRule -@Rule(key = "S2703") -public class VariableDeclarationWithoutVarCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VariableNameCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VariableNameCheck.java deleted file mode 100644 index cbfd30b94e5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VariableNameCheck.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.check.RuleProperty; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S117") -public class VariableNameCheck extends Check { - - private static final String CAMEL_CASED = "^[_$A-Za-z][$A-Za-z0-9]*$"; - private static final String UPPER_CASED = "^[_$A-Z][_$A-Z0-9]+$"; - - private static final String DEFAULT_FORMAT = CAMEL_CASED + "|" + UPPER_CASED; - - @RuleProperty( - key = "format", - description = "Regular expression used to check the names against.", - defaultValue = "" + DEFAULT_FORMAT - ) - public String format = DEFAULT_FORMAT; - - @Override - public List configurations() { - return Collections.singletonList(new FormatRuleProperty(format)); - } - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VariableShadowingCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VariableShadowingCheck.java deleted file mode 100644 index 5ee49c64f0b..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VariableShadowingCheck.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import java.util.Collections; -import java.util.List; -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@TypeScriptRule -// deprecated key in TS -@DeprecatedRuleKey(ruleKey = "S1524") -@Rule(key = "S1117") -public class VariableShadowingCheck extends Check { - - - - @Override - public List configurations() { - return Collections.singletonList(new Config()); - } - - private static class Config { - - String hoist = "all"; - } -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VoidUseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VoidUseCheck.java deleted file mode 100644 index fec4b98739d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/VoidUseCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S3735") -public class VoidUseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WeakSslCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WeakSslCheck.java deleted file mode 100644 index 8b2fe81cd7f..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WeakSslCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4423") -public class WeakSslCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WebSQLDatabaseCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WebSQLDatabaseCheck.java deleted file mode 100644 index 9d96aab6695..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WebSQLDatabaseCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2817") -public class WebSQLDatabaseCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WildcardImportCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WildcardImportCheck.java deleted file mode 100644 index 751a51229f9..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WildcardImportCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2208") -public class WildcardImportCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WithStatementCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WithStatementCheck.java deleted file mode 100644 index 44abde88113..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WithStatementCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; - -@JavaScriptRule -@Rule(key = "S1321") -@DeprecatedRuleKey(ruleKey = "WithStatement") -public class WithStatementCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WrongScopeDeclarationCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WrongScopeDeclarationCheck.java deleted file mode 100644 index 144522a9e09..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/WrongScopeDeclarationCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2392") -public class WrongScopeDeclarationCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/XMLParserXXEVulnerableCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/XMLParserXXEVulnerableCheck.java deleted file mode 100644 index 2bdcc619b1d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/XMLParserXXEVulnerableCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S2755") -public class XMLParserXXEVulnerableCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/XPoweredByCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/XPoweredByCheck.java deleted file mode 100644 index c2f9d0bc49d..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/XPoweredByCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S5689") -public class XPoweredByCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/XpathCheck.java b/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/XpathCheck.java deleted file mode 100644 index 2a9a22917e5..00000000000 --- a/sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/XpathCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.Check; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@JavaScriptRule -@TypeScriptRule -@Rule(key = "S4817") -public class XpathCheck extends Check { - - -} diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/schemas/S2068-schema.json b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/schemas/S2068-schema.json index f0a231e8ec2..9670466bfde 100644 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/schemas/S2068-schema.json +++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/schemas/S2068-schema.json @@ -6,7 +6,7 @@ { "type": "object", "properties": { - "credentialWords": { + "passwordWords": { "type": "array", "items": { "type": "string" diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/AngleBracketTypeAssertionCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/AngleBracketTypeAssertionCheckTest.java deleted file mode 100644 index 033c0afe724..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/AngleBracketTypeAssertionCheckTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class AngleBracketTypeAssertionCheckTest { - - @Test - void configurations() { - String configAsString = new Gson() - .toJson(new AngleBracketTypeAssertionCheck().configurations()); - assertThat(configAsString) - .isEqualTo("[{\"assertionStyle\":\"as\",\"objectLiteralTypeAssertions\":\"allow\"}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/AriaRoleCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/AriaRoleCheckTest.java deleted file mode 100644 index f8548810712..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/AriaRoleCheckTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class AriaRoleCheckTest { - - @Test - void config() { - String configAsString = new Gson().toJson(new AriaRoleCheck().configurations()); - assertThat(configAsString) - .isEqualTo("[{\"ignoreNonDOM\":true,\"allowedInvalidRoles\":[\"text\"]}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ArrowFunctionConventionCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ArrowFunctionConventionCheckTest.java deleted file mode 100644 index c7658d16359..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ArrowFunctionConventionCheckTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class ArrowFunctionConventionCheckTest { - - @Test - void test_configuration() { - ArrowFunctionConventionCheck check = new ArrowFunctionConventionCheck(); - - String config = new Gson().toJson(check.configurations()); - assertThat(config) - .isEqualTo("[{\"requireParameterParentheses\":false,\"requireBodyBraces\":false}]"); - - check.parameterParens = true; - config = new Gson().toJson(check.configurations()); - assertThat(config) - .isEqualTo("[{\"requireParameterParentheses\":true,\"requireBodyBraces\":false}]"); - - check.bodyBraces = true; - config = new Gson().toJson(check.configurations()); - assertThat(config) - .isEqualTo("[{\"requireParameterParentheses\":true,\"requireBodyBraces\":true}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CheckListTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CheckListTest.java index cf6d5a5f425..3bc9b9b2202 100644 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CheckListTest.java +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CheckListTest.java @@ -40,7 +40,7 @@ class CheckListTest { void count() throws Exception { long count = Files .list(Paths.get("src/main/java/org/sonar/javascript/checks/")) - .filter(p -> p.toString().endsWith("Check.java") && !p.toString().startsWith("Abstract")) + .filter(p -> p.getFileName().toString().matches("S\\d+(Js|Ts)?\\.java")) .count(); assertThat(CheckList.getAllChecks()).hasSize((int) count); } @@ -53,7 +53,7 @@ void test() { List> checks = CheckList.getAllChecks(); for (Class cls : checks) { - if (!cls.getSimpleName().equals("ParsingErrorCheck") && !isEslintBasedCheck(cls)) { + if (!cls.getSimpleName().equals("S2260") && !isEslintBasedCheck(cls)) { String testName = '/' + cls.getName().replace('.', '/') + "Test.class"; assertThat(getClass().getResource(testName)) .overridingErrorMessage("No test for " + cls.getSimpleName()) @@ -90,7 +90,7 @@ void testTypeScriptChecks() { assertThat(typeScriptChecks) .isNotEmpty() .isNotEqualTo(CheckList.getAllChecks()) - .allMatch(c -> c == ParsingErrorCheck.class || EslintBasedCheck.class.isAssignableFrom(c)); + .allMatch(c -> c == S2260.class || EslintBasedCheck.class.isAssignableFrom(c)); } @Test diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ClassNameCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ClassNameCheckTest.java deleted file mode 100644 index 53023cdc431..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ClassNameCheckTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class ClassNameCheckTest { - - @Test - void configurations() { - ClassNameCheck check = new ClassNameCheck(); - - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"format\":\"^[A-Z][a-zA-Z0-9]*$\"}]"); - - // custom configuration - check.format = "^[_A-Z][a-zA-Z0-9]*$"; - String customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"format\":\"^[_A-Z][a-zA-Z0-9]*$\"}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CognitiveComplexityFunctionCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CognitiveComplexityFunctionCheckTest.java deleted file mode 100644 index d8047e15b29..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CognitiveComplexityFunctionCheckTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.jupiter.api.Test; - -class CognitiveComplexityFunctionCheckTest { - - @Test - void testConfig() { - CognitiveComplexityFunctionCheck check = new CognitiveComplexityFunctionCheck(); - assertThat(check.configurations()).containsExactly(15); - check.threshold = 42; - assertThat(check.configurations()).containsExactly(42); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CommentRegularExpressionCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CommentRegularExpressionCheckTest.java deleted file mode 100644 index 56bad848407..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CommentRegularExpressionCheckTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class CommentRegularExpressionCheckTest { - - @Test - void test_configuration() { - CommentRegularExpressionCheck check = new CommentRegularExpressionCheck(); - - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString) - .isEqualTo( - "[{\"regularExpression\":\"\",\"message\":\"The regular expression matches this comment.\",\"flags\":\"\"}]" - ); - - check.message = "This is a message"; - - String configAsString = new Gson().toJson(check.configurations()); - assertThat(configAsString) - .isEqualTo("[{\"regularExpression\":\"\",\"message\":\"This is a message\",\"flags\":\"\"}]"); - - check.regularExpression = "[a-z]"; - - String configAsString2 = new Gson().toJson(check.configurations()); - assertThat(configAsString2) - .isEqualTo( - "[{\"regularExpression\":\"[a-z]\",\"message\":\"This is a message\",\"flags\":\"\"}]" - ); - - check.flags = "iu"; - assertThat(new Gson().toJson(check.configurations())) - .isEqualTo( - "[{\"regularExpression\":\"[a-z]\",\"message\":\"This is a message\",\"flags\":\"iu\"}]" - ); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ConsoleLoggingCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ConsoleLoggingCheckTest.java deleted file mode 100644 index 260883054d3..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ConsoleLoggingCheckTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class ConsoleLoggingCheckTest { - - @Test - void configurations() { - String configAsString = new Gson().toJson(new ConsoleLoggingCheck().configurations()); - assertThat(configAsString) - .isEqualTo( - "[{\"allow\":[\"assert\",\"clear\",\"count\",\"group\",\"groupCollapsed\",\"groupEnd\",\"info\",\"table\",\"time\",\"timeEnd\",\"trace\"]}]" - ); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ContentLengthCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ContentLengthCheckTest.java deleted file mode 100644 index b8ffdc0d8fe..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ContentLengthCheckTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class ContentLengthCheckTest { - - @Test - void configurations() { - ContentLengthCheck check = new ContentLengthCheck(); - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"fileUploadSizeLimit\":8000000,\"standardSizeLimit\":2000000}]"); - check.fileUploadSizeLimit = 42; - check.standardSizeLimit = 24; - String customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"fileUploadSizeLimit\":42,\"standardSizeLimit\":24}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CyclomaticComplexityJavaScriptCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CyclomaticComplexityJavaScriptCheckTest.java deleted file mode 100644 index c153e9dc6aa..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CyclomaticComplexityJavaScriptCheckTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class CyclomaticComplexityJavaScriptCheckTest { - - @Test - void configurations() { - CyclomaticComplexityJavaScriptCheck check = new CyclomaticComplexityJavaScriptCheck(); - - // default configuration - var defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"threshold\":10}]"); - - // custom configuration - check.threshold = 15; - var customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"threshold\":15}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CyclomaticComplexityTypeScriptCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CyclomaticComplexityTypeScriptCheckTest.java deleted file mode 100644 index ce7aad0a989..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/CyclomaticComplexityTypeScriptCheckTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class CyclomaticComplexityTypeScriptCheckTest { - - @Test - void configurations() { - CyclomaticComplexityTypeScriptCheck check = new CyclomaticComplexityTypeScriptCheck(); - - // default configuration - var defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"threshold\":10}]"); - - // custom configuration - check.threshold = 15; - var customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"threshold\":15}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/EmptyBlockCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/EmptyBlockCheckTest.java deleted file mode 100644 index a1735a79318..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/EmptyBlockCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class EmptyBlockCheckTest { - - @Test - void configurations() { - String configAsString = new Gson().toJson(new EmptyBlockCheck().configurations()); - assertThat(configAsString).isEqualTo("[{\"allowEmptyCatch\":true}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/EmptyFunctionCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/EmptyFunctionCheckTest.java deleted file mode 100644 index 9cbecb911bf..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/EmptyFunctionCheckTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class EmptyFunctionCheckTest { - - @Test - void configurations() { - String configAsString = new Gson().toJson(new EmptyFunctionCheck().configurations()); - assertThat(configAsString) - .isEqualTo("[{\"allow\":[\"arrowFunctions\",\"constructors\",\"private-constructors\"]}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/EqEqEqCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/EqEqEqCheckTest.java deleted file mode 100644 index 0d2f84c5594..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/EqEqEqCheckTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class EqEqEqCheckTest { - - @Test - void test() { - assertThat(new Gson().toJson(new EqEqEqCheck().configurations())).isEqualTo("[\"smart\"]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ExpressionComplexityCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ExpressionComplexityCheckTest.java deleted file mode 100644 index 1277975c5ba..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ExpressionComplexityCheckTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class ExpressionComplexityCheckTest { - - @Test - void test() { - ExpressionComplexityCheck check = new ExpressionComplexityCheck(); - - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"max\":3}]"); - - check.max = 10; - String configAsString = new Gson().toJson(check.configurations()); - assertThat(configAsString).isEqualTo("[{\"max\":10}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/FileHeaderCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/FileHeaderCheckTest.java deleted file mode 100644 index 15a579343bc..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/FileHeaderCheckTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class FileHeaderCheckTest { - - @Test - void config() { - final FileHeaderCheck check = new FileHeaderCheck(); - String configAsString = new Gson().toJson(check.configurations()); - assertThat(configAsString).isEqualTo("[{\"headerFormat\":\"\",\"isRegularExpression\":false}]"); - - check.headerFormat = "// header format 20\\d\\d"; - check.isRegularExpression = true; - configAsString = new Gson().toJson(check.configurations()); - assertThat(configAsString) - .isEqualTo( - "[{\"headerFormat\":\"// header format 20\\\\d\\\\d\",\"isRegularExpression\":true}]" - ); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/FunctionNameCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/FunctionNameCheckTest.java deleted file mode 100644 index d83bd685009..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/FunctionNameCheckTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class FunctionNameCheckTest { - - @Test - void configurations() { - FunctionNameCheck check = new FunctionNameCheck(); - - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"format\":\"^[_a-z][a-zA-Z0-9]*$\"}]"); - - // custom configuration - check.format = "^[a-zA-Z0-9]*$"; - String customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"format\":\"^[a-zA-Z0-9]*$\"}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/GetterSetterCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/GetterSetterCheckTest.java deleted file mode 100644 index db127ea62e1..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/GetterSetterCheckTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class GetterSetterCheckTest { - - @Test - void configurations() { - GetterSetterCheck check = new GetterSetterCheck(); - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"getWithoutSet\":false}]"); - // custom configuration - check.getWithoutSet = true; - String customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"getWithoutSet\":true}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/HookUseStateCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/HookUseStateCheckTest.java deleted file mode 100644 index 6cc8af69075..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/HookUseStateCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class HookUseStateCheckTest { - - @Test - void configurations() { - String configAsString = new Gson().toJson(new HookUseStateCheck().configurations()); - assertThat(configAsString).isEqualTo("[{\"allowDestructuredState\":true}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/IdenticalFunctionsCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/IdenticalFunctionsCheckTest.java deleted file mode 100644 index ff3b723fabb..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/IdenticalFunctionsCheckTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.jupiter.api.Test; - -class IdenticalFunctionsCheckTest { - - @Test - void configurations() { - IdenticalFunctionsCheck identicalFunctionsCheck = new IdenticalFunctionsCheck(); - assertThat(identicalFunctionsCheck.configurations()).containsExactly(3); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ImplicitDependenciesCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ImplicitDependenciesCheckTest.java deleted file mode 100644 index 66661ddcafd..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/ImplicitDependenciesCheckTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class ImplicitDependenciesCheckTest { - - @Test - void configurations() { - ImplicitDependenciesCheck check = new ImplicitDependenciesCheck(); - - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"whitelist\":[\"\"]}]"); - - // custom configuration - check.whitelist = "foo, bar"; - String customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"whitelist\":[\"foo\",\"bar\"]}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/IntrusivePermissionsCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/IntrusivePermissionsCheckTest.java deleted file mode 100644 index f8b096ef972..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/IntrusivePermissionsCheckTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class IntrusivePermissionsCheckTest { - - @Test - void configurations() { - IntrusivePermissionsCheck check = new IntrusivePermissionsCheck(); - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"permissions\":[\"geolocation\"]}]"); - check.permissions = "camera, microphone"; - String customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"permissions\":[\"camera\",\"microphone\"]}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/JsxNoBindCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/JsxNoBindCheckTest.java deleted file mode 100644 index cf1ed4e403f..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/JsxNoBindCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class JsxNoBindCheckTest { - - @Test - void test() { - var configAsString = new Gson().toJson(new JsxNoBindCheck().configurations()); - assertThat(configAsString).isEqualTo("[{\"ignoreRefs\":true,\"ignoreDOMComponents\":true}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/JsxNoUselessFragmentCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/JsxNoUselessFragmentCheckTest.java deleted file mode 100644 index 891c095eea7..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/JsxNoUselessFragmentCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class JsxNoUselessFragmentCheckTest { - - @Test - void test() { - var configAsString = new Gson().toJson(new JsxNoUselessFragmentCheck().configurations()); - assertThat(configAsString).isEqualTo("[{\"allowExpressions\":true}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/LineLengthCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/LineLengthCheckTest.java deleted file mode 100644 index a828d5814c9..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/LineLengthCheckTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Test; - -class LineLengthCheckTest { - - private Map expectedConfigurationsMap = new HashMap<>(); - - @Test - void default_configuration() { - LineLengthCheck check = new LineLengthCheck(); - expectedConfigurationsMap.put("tabWidth", 1); - expectedConfigurationsMap.put("code", 180); - assertThat(check.configurations()).containsExactly(expectedConfigurationsMap); - } - - @Test - void custom_configuration() { - LineLengthCheck check = new LineLengthCheck(); - check.maximumLineLength = 120; - expectedConfigurationsMap.put("tabWidth", 1); - expectedConfigurationsMap.put("code", 120); - assertThat(check.configurations()).containsExactly(expectedConfigurationsMap); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MaxParameterCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MaxParameterCheckTest.java deleted file mode 100644 index 25ddde75310..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MaxParameterCheckTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class MaxParameterCheckTest { - - @Test - void configurations() { - MaxParameterCheck check = new MaxParameterCheck(); - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"max\":7}]"); - check.maximumFunctionParameters = 4; - String customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"max\":4}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MaxSwitchCasesCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MaxSwitchCasesCheckTest.java deleted file mode 100644 index dce7d497bda..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MaxSwitchCasesCheckTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.jupiter.api.Test; - -class MaxSwitchCasesCheckTest { - - @Test - void configurations() { - MaxSwitchCasesCheck maxSwitchCasesCheck = new MaxSwitchCasesCheck(); - // default configuration - assertThat(maxSwitchCasesCheck.configurations()).containsExactly(30); - maxSwitchCasesCheck.maximum = 4; - assertThat(maxSwitchCasesCheck.configurations()).containsExactly(4); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MaxUnionSizeCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MaxUnionSizeCheckTest.java deleted file mode 100644 index 54af08f1465..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MaxUnionSizeCheckTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class MaxUnionSizeCheckTest { - - @Test - void configurations() { - MaxUnionSizeCheck check = new MaxUnionSizeCheck(); - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"threshold\":3}]"); - check.threshold = 4; - String customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"threshold\":4}]"); } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MissingNewlineAtEndOfFileCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MissingNewlineAtEndOfFileCheckTest.java deleted file mode 100644 index 1fea5a3bb85..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MissingNewlineAtEndOfFileCheckTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.jupiter.api.Test; - -class MissingNewlineAtEndOfFileCheckTest { - - @Test - void configurations() { - MissingNewlineAtEndOfFileCheck check = new MissingNewlineAtEndOfFileCheck(); - assertThat(check.configurations()).containsExactly("always"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MissingTrailingCommaCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MissingTrailingCommaCheckTest.java deleted file mode 100644 index ff9aa123a69..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/MissingTrailingCommaCheckTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class MissingTrailingCommaCheckTest { - - @Test - void test_configuration() { - MissingTrailingCommaCheck check = new MissingTrailingCommaCheck(); - - String config = new Gson().toJson(check.configurations()); - assertThat(config).isEqualTo("[\"always-multiline\"]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NestedControlFlowDepthCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NestedControlFlowDepthCheckTest.java deleted file mode 100644 index 804e2644844..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NestedControlFlowDepthCheckTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NestedControlFlowDepthCheckTest { - - @Test - void testConfig() { - NestedControlFlowDepthCheck check = new NestedControlFlowDepthCheck(); - var defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"maximumNestingLevel\":3}]"); - - check.maximumNestingLevel = 42; - var customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"maximumNestingLevel\":42}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NewCapCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NewCapCheckTest.java deleted file mode 100644 index b8b0c2afd7b..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NewCapCheckTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NewCapCheckTest { - - @Test - void configurations() { - String configAsString = new Gson().toJson(new NewCapCheck().configurations()); - assertThat(configAsString) - .isEqualTo("[{\"newIsCap\":true,\"capIsNew\":false,\"properties\":false}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NewOperatorMisuseCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NewOperatorMisuseCheckTest.java deleted file mode 100644 index 3c1ff8134aa..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NewOperatorMisuseCheckTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NewOperatorMisuseCheckTest { - - @Test - void config() { - NewOperatorMisuseCheck check = new NewOperatorMisuseCheck(); - - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"considerJSDoc\":false}]"); - - // custom configuration - check.considerJSDoc = true; - String customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"considerJSDoc\":true}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoDuplicateStringCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoDuplicateStringCheckTest.java deleted file mode 100644 index 2e13a7b8a30..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoDuplicateStringCheckTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoDuplicateStringCheckTest { - - @Test - void configurations() { - // default configuration - String configAsString = new Gson().toJson(new NoDuplicateStringCheck().configurations()); - assertThat(configAsString) - .isEqualTo("[{\"threshold\":3,\"ignoreStrings\":\"application/json\"}]"); - // custom configuration - NoDuplicateStringCheck noDuplicateStringCheck = new NoDuplicateStringCheck(); - noDuplicateStringCheck.threshold = 10; - noDuplicateStringCheck.ignoreStrings = "foo,bar,baz"; - configAsString = new Gson().toJson(noDuplicateStringCheck.configurations()); - assertThat(configAsString).isEqualTo("[{\"threshold\":10,\"ignoreStrings\":\"foo,bar,baz\"}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoEmptyClassCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoEmptyClassCheckTest.java deleted file mode 100644 index dec29a549d7..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoEmptyClassCheckTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoEmptyClassCheckTest { - - @Test - void config() { - String configAsString = new Gson().toJson(new NoEmptyClassCheck().configurations()); - assertThat(configAsString) - .isEqualTo( - "[{\"allowConstructorOnly\":false,\"allowEmpty\":false,\"allowStaticOnly\":true,\"allowWithDecorator\":true}]" - ); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoEmptyInterfaceCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoEmptyInterfaceCheckTest.java deleted file mode 100644 index e98b1ce95bf..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoEmptyInterfaceCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoEmptyInterfaceCheckTest { - - @Test - void configurations() { - String configAsString = new Gson().toJson(new NoEmptyInterfaceCheck().configurations()); - assertThat(configAsString).isEqualTo("[{\"allowSingleExtends\":true}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoHardcodedPasswordsCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoHardcodedPasswordsCheckTest.java deleted file mode 100644 index 6b6a229209d..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoHardcodedPasswordsCheckTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoHardcodedPasswordsCheckTest { - - @Test - void configurations() { - NoHardcodedPasswordsCheck check = new NoHardcodedPasswordsCheck(); - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"passwordWords\":[\"password\",\"pwd\",\"passwd\"]}]"); - - check.passwordWords = "foo, bar"; - String customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"passwordWords\":[\"foo\",\"bar\"]}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoHardcodedSecretsCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoHardcodedSecretsCheckTest.java deleted file mode 100644 index bad394eb096..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoHardcodedSecretsCheckTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoHardcodedSecretsCheckTest { - - @Test - void configurations() { - NoHardcodedSecretsCheck check = new NoHardcodedSecretsCheck(); - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo( - "[{\"secretWords\":\"api[_.-]?key,auth,credential,secret,token\",\"randomnessSensibility\":\"5.0\"}]" - ); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoMagicNumbersCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoMagicNumbersCheckTest.java deleted file mode 100644 index ab0e2f6d3fa..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoMagicNumbersCheckTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoMagicNumbersCheckTest { - - @Test - void config() { - String configAsString = new Gson().toJson(new NoMagicNumbersCheck().configurations()); - assertThat(configAsString) - .isEqualTo( - "[{\"ignore\":[0,1,-1,24,60],\"ignoreEnums\":true,\"ignoreReadonlyClassProperties\":true,\"ignoreNumericLiteralTypes\":true,\"ignoreDefaultValues\":true,\"ignoreClassFieldInitialValues\":true}]" - ); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoMisusedPromisesCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoMisusedPromisesCheckTest.java deleted file mode 100644 index feb8fc56ec2..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoMisusedPromisesCheckTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoMisusedPromisesCheckTest { - - @Test - void config() { - NoMisusedPromisesCheck check = new NoMisusedPromisesCheck(); - - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString) - .isEqualTo( - "[{\"ignoreIIFE\":true,\"checksVoidReturn\":{\"attributes\":false,\"arguments\":false}}]" - ); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoNestedFunctionsCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoNestedFunctionsCheckTest.java deleted file mode 100644 index eb4d5216901..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoNestedFunctionsCheckTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoNestedFunctionsCheckTest { - - @Test - void testConfig() { - var check = new NoNestedFunctionsCheck(); - var defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"threshold\":4}]"); - - check.threshold = 42; - var customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"threshold\":42}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoNonInteractiveElementsWithHandlersCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoNonInteractiveElementsWithHandlersCheckTest.java deleted file mode 100644 index f23266925fb..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoNonInteractiveElementsWithHandlersCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoNonInteractiveElementsWithHandlersCheckTest { - - @Test - void configurations() { - var config = new Gson().toJson(new NoNonInteractiveElementsWithHandlersCheck().configurations()); - assertThat(config).isEqualTo("[{\"handlers\":[\"onClick\",\"onMouseDown\",\"onMouseUp\",\"onKeyPress\",\"onKeyDown\",\"onKeyUp\"]}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoThisAliasCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoThisAliasCheckTest.java deleted file mode 100644 index e1528b0348b..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoThisAliasCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoThisAliasCheckTest { - - @Test - void configurations() { - assertThat(new Gson().toJson(new NoThisAliasCheck().configurations())) - .isEqualTo("[{\"allowDestructuring\":true}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoUnescapedEntitiesCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoUnescapedEntitiesCheckTest.java deleted file mode 100644 index 25b99447ad6..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoUnescapedEntitiesCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoUnescapedEntitiesCheckTest { - - @Test - void configurations() { - String configAsString = new Gson().toJson(new NoUnescapedEntitiesCheck().configurations()); - assertThat(configAsString).isEqualTo("[{\"forbid\":[\"\\u003e\",\"}\"]}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoUnknownPropertyCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoUnknownPropertyCheckTest.java deleted file mode 100644 index e6d19a31d4b..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoUnknownPropertyCheckTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoUnknownPropertyCheckTest { - - @Test - void config() { - NoUnknownPropertyCheck check = new NoUnknownPropertyCheck(); - - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"ignore\":[\"\"]}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoUnneededTernaryCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoUnneededTernaryCheckTest.java deleted file mode 100644 index 1e0756d4746..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoUnneededTernaryCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoUnneededTernaryCheckTest { - - @Test - void config() { - String configAsString = new Gson().toJson(new NoUnneededTernaryCheck().configurations()); - assertThat(configAsString).isEqualTo("[{\"defaultAssignment\":false}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoUnsafeCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoUnsafeCheckTest.java deleted file mode 100644 index f6187f1e8ed..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/NoUnsafeCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class NoUnsafeCheckTest { - - @Test - void config() { - String configAsString = new Gson().toJson(new NoUnsafeCheck().configurations()); - assertThat(configAsString).isEqualTo("[{\"checkAliases\":true}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/OpenCurlyBracesAtEOLCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/OpenCurlyBracesAtEOLCheckTest.java deleted file mode 100644 index 3614effe156..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/OpenCurlyBracesAtEOLCheckTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class OpenCurlyBracesAtEOLCheckTest { - - @Test - void test_configuration() { - OpenCurlyBracesAtEOLCheck check = new OpenCurlyBracesAtEOLCheck(); - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[\"1tbs\",{\"allowSingleLine\":true}]"); - check.braceStyle = "stroustrup"; - String stroustrupConfigAsString = new Gson().toJson(check.configurations()); - assertThat(stroustrupConfigAsString).isEqualTo("[\"stroustrup\",{\"allowSingleLine\":true}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/PreferLiteralEnumMemberCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/PreferLiteralEnumMemberCheckTest.java deleted file mode 100644 index adedb39f0bf..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/PreferLiteralEnumMemberCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class PreferLiteralEnumMemberCheckTest { - - @Test - void configurations() { - String configAsString = new Gson().toJson(new PreferLiteralEnumMemberCheck().configurations()); - assertThat(configAsString).isEqualTo("[{\"allowBitwiseExpressions\":false}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/PreferNullishCoalescingCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/PreferNullishCoalescingCheckTest.java deleted file mode 100644 index b2872b661e5..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/PreferNullishCoalescingCheckTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class PreferNullishCoalescingCheckTest { - - @Test - void configurations() { - String configAsString = new Gson().toJson(new PreferNullishCoalescingCheck().configurations()); - assertThat(configAsString) - .isEqualTo( - "[{\"ignoreConditionalTests\":true,\"ignoreTernaryTests\":false,\"ignoreMixedLogicalExpressions\":true,\"allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing\":true}]" - ); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/RedeclaredSymbolCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/RedeclaredSymbolCheckTest.java deleted file mode 100644 index 0a8f3d996b5..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/RedeclaredSymbolCheckTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class RedeclaredSymbolCheckTest { - - @Test - void configurations() { - String configAsString = new Gson().toJson(new RedeclaredSymbolCheck().configurations()); - assertThat(configAsString) - .isEqualTo("[{\"builtinGlobals\":false,\"ignoreDeclarationMerge\":true}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/RegexComplexityCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/RegexComplexityCheckTest.java deleted file mode 100644 index d7e911115d1..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/RegexComplexityCheckTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class RegexComplexityCheckTest { - - @Test - void configurations() { - RegexComplexityCheck check = new RegexComplexityCheck(); - // default configuration - var defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"threshold\":20}]"); - // custom configuration - check.threshold = 15; - var customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"threshold\":15}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S100Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S100Test.java new file mode 100644 index 00000000000..cb6f61f5311 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S100Test.java @@ -0,0 +1,39 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S100Test { + + @Test + void configurations() { + S100 check = new S100(); + + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"format\":\"^[_a-z][a-zA-Z0-9]*$\"}]"); + + // custom configuration + check.format = "^[a-zA-Z0-9]*$"; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"format\":\"^[a-zA-Z0-9]*$\"}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S101Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S101Test.java new file mode 100644 index 00000000000..931c284677b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S101Test.java @@ -0,0 +1,39 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S101Test { + + @Test + void configurations() { + S101 check = new S101(); + + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"format\":\"^[A-Z][a-zA-Z0-9]*$\"}]"); + + // custom configuration + check.format = "^[_A-Z][a-zA-Z0-9]*$"; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"format\":\"^[_A-Z][a-zA-Z0-9]*$\"}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S103Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S103Test.java new file mode 100644 index 00000000000..ee8aa1d3f29 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S103Test.java @@ -0,0 +1,45 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class S103Test { + + private Map expectedConfigurationsMap = new HashMap<>(); + + @Test + void default_configuration() { + S103 check = new S103(); + expectedConfigurationsMap.put("tabWidth", 1); + expectedConfigurationsMap.put("code", 180); + assertThat(check.configurations()).containsExactly(expectedConfigurationsMap); + } + + @Test + void custom_configuration() { + S103 check = new S103(); + check.maximumLineLength = 120; + expectedConfigurationsMap.put("tabWidth", 1); + expectedConfigurationsMap.put("code", 120); + assertThat(check.configurations()).containsExactly(expectedConfigurationsMap); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S104Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S104Test.java new file mode 100644 index 00000000000..d0570ed1500 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S104Test.java @@ -0,0 +1,37 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S104Test { + + @Test + void test_configuration() { + S104 check = new S104(); + + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"maximum\":1000}]"); + + check.maximum = 42; + String configAsString = new Gson().toJson(check.configurations()); + assertThat(configAsString).isEqualTo("[{\"maximum\":42}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1067Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1067Test.java new file mode 100644 index 00000000000..982824d8083 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1067Test.java @@ -0,0 +1,37 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S1067Test { + + @Test + void test() { + S1067 check = new S1067(); + + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"max\":3}]"); + + check.max = 10; + String configAsString = new Gson().toJson(check.configurations()); + assertThat(configAsString).isEqualTo("[{\"max\":10}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S106Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S106Test.java new file mode 100644 index 00000000000..f34148145f4 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S106Test.java @@ -0,0 +1,34 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S106Test { + + @Test + void configurations() { + String configAsString = new Gson().toJson(new S106().configurations()); + assertThat(configAsString) + .isEqualTo( + "[{\"allow\":[\"assert\",\"clear\",\"count\",\"group\",\"groupCollapsed\",\"groupEnd\",\"info\",\"table\",\"time\",\"timeEnd\",\"trace\"]}]" + ); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S107Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S107Test.java new file mode 100644 index 00000000000..96667c2f862 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S107Test.java @@ -0,0 +1,36 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S107Test { + + @Test + void configurations() { + S107 check = new S107(); + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"max\":7}]"); + check.maximumFunctionParameters = 4; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"max\":4}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S108Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S108Test.java new file mode 100644 index 00000000000..a2e89be306e --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S108Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S108Test { + + @Test + void configurations() { + String configAsString = new Gson().toJson(new S108().configurations()); + assertThat(configAsString).isEqualTo("[{\"allowEmptyCatch\":true}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S109Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S109Test.java new file mode 100644 index 00000000000..f0a39a18d51 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S109Test.java @@ -0,0 +1,34 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S109Test { + + @Test + void config() { + String configAsString = new Gson().toJson(new S109().configurations()); + assertThat(configAsString) + .isEqualTo( + "[{\"ignore\":[0,1,-1,24,60],\"ignoreEnums\":true,\"ignoreReadonlyClassProperties\":true,\"ignoreNumericLiteralTypes\":true,\"ignoreDefaultValues\":true,\"ignoreClassFieldInitialValues\":true}]" + ); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1105Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1105Test.java new file mode 100644 index 00000000000..13a95d18f85 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1105Test.java @@ -0,0 +1,35 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S1105Test { + + @Test + void test_configuration() { + S1105 check = new S1105(); + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[\"1tbs\",{\"allowSingleLine\":true}]"); + check.braceStyle = "stroustrup"; + String stroustrupConfigAsString = new Gson().toJson(check.configurations()); + assertThat(stroustrupConfigAsString).isEqualTo("[\"stroustrup\",{\"allowSingleLine\":true}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1117Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1117Test.java new file mode 100644 index 00000000000..4c3777b8909 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1117Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S1117Test { + + @Test + void test() { + assertThat(new Gson().toJson(new S1117().configurations())) + .isEqualTo("[{\"hoist\":\"all\"}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S113Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S113Test.java new file mode 100644 index 00000000000..d7e5c234618 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S113Test.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.Test; + +class S113Test { + + @Test + void configurations() { + S113 check = new S113(); + assertThat(check.configurations()).containsExactly("always"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S117Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S117Test.java new file mode 100644 index 00000000000..1c6ade5eaf9 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S117Test.java @@ -0,0 +1,40 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S117Test { + + @Test + void configurations() { + S117 check = new S117(); + + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString) + .isEqualTo("[{\"format\":\"^[_$A-Za-z][$A-Za-z0-9]*$|^[_$A-Z][_$A-Z0-9]+$\"}]"); + + // custom configuration + check.format = "^[a-zA-Z0-9]*$"; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"format\":\"^[a-zA-Z0-9]*$\"}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1186Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1186Test.java new file mode 100644 index 00000000000..6b30a0d28ce --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1186Test.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S1186Test { + + @Test + void configurations() { + String configAsString = new Gson().toJson(new S1186().configurations()); + assertThat(configAsString) + .isEqualTo("[{\"allow\":[\"arrowFunctions\",\"constructors\",\"private-constructors\"]}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1192Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1192Test.java new file mode 100644 index 00000000000..58577ce59ee --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1192Test.java @@ -0,0 +1,39 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S1192Test { + + @Test + void configurations() { + // default configuration + String configAsString = new Gson().toJson(new S1192().configurations()); + assertThat(configAsString) + .isEqualTo("[{\"threshold\":3,\"ignoreStrings\":\"application/json\"}]"); + // custom configuration + S1192 noDuplicateStringCheck = new S1192(); + noDuplicateStringCheck.threshold = 10; + noDuplicateStringCheck.ignoreStrings = "foo,bar,baz"; + configAsString = new Gson().toJson(noDuplicateStringCheck.configurations()); + assertThat(configAsString).isEqualTo("[{\"threshold\":10,\"ignoreStrings\":\"foo,bar,baz\"}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S124Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S124Test.java new file mode 100644 index 00000000000..ba0b10a9bb3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S124Test.java @@ -0,0 +1,56 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S124Test { + + @Test + void test_configuration() { + S124 check = new S124(); + + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString) + .isEqualTo( + "[{\"regularExpression\":\"\",\"message\":\"The regular expression matches this comment.\",\"flags\":\"\"}]" + ); + + check.message = "This is a message"; + + String configAsString = new Gson().toJson(check.configurations()); + assertThat(configAsString) + .isEqualTo("[{\"regularExpression\":\"\",\"message\":\"This is a message\",\"flags\":\"\"}]"); + + check.regularExpression = "[a-z]"; + + String configAsString2 = new Gson().toJson(check.configurations()); + assertThat(configAsString2) + .isEqualTo( + "[{\"regularExpression\":\"[a-z]\",\"message\":\"This is a message\",\"flags\":\"\"}]" + ); + + check.flags = "iu"; + assertThat(new Gson().toJson(check.configurations())) + .isEqualTo( + "[{\"regularExpression\":\"[a-z]\",\"message\":\"This is a message\",\"flags\":\"iu\"}]" + ); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S134Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S134Test.java new file mode 100644 index 00000000000..5bd2b4edd5c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S134Test.java @@ -0,0 +1,36 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S134Test { + + @Test + void testConfig() { + S134 check = new S134(); + var defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"maximumNestingLevel\":3}]"); + + check.maximumNestingLevel = 42; + var customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"maximumNestingLevel\":42}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S138Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S138Test.java new file mode 100644 index 00000000000..5c78ca4a35c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S138Test.java @@ -0,0 +1,37 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S138Test { + + @Test + void test_configuration() { + var check = new S138(); + + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"maximum\":200}]"); + + check.max = 42; + String configAsString = new Gson().toJson(check.configurations()); + assertThat(configAsString).isEqualTo("[{\"maximum\":42}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S139Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S139Test.java new file mode 100644 index 00000000000..4f249f4dd3a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S139Test.java @@ -0,0 +1,39 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S139Test { + + @Test + void configurations() { + S139 check = new S139(); + + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"ignorePattern\":\"^\\\\s*[^\\\\s]+$\"}]"); + + // custom configuration + check.legalCommentPattern = "^[ignored]*$"; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"ignorePattern\":\"^[ignored]*$\"}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1440Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1440Test.java new file mode 100644 index 00000000000..4a82ecf200c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1440Test.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S1440Test { + + @Test + void test() { + assertThat(new Gson().toJson(new S1440().configurations())).isEqualTo("[\"smart\"]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1441Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1441Test.java new file mode 100644 index 00000000000..90232657a73 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1441Test.java @@ -0,0 +1,41 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S1441Test { + + @Test + void configurations() { + S1441 check = new S1441(); + + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString) + .isEqualTo("[\"single\",{\"avoidEscape\":true,\"allowTemplateLiterals\":true}]"); + + // custom configuration + check.singleQuotes = false; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString) + .isEqualTo("[\"double\",{\"avoidEscape\":true,\"allowTemplateLiterals\":true}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1451Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1451Test.java new file mode 100644 index 00000000000..da52cd5abc1 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1451Test.java @@ -0,0 +1,40 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S1451Test { + + @Test + void config() { + final S1451 check = new S1451(); + String configAsString = new Gson().toJson(check.configurations()); + assertThat(configAsString).isEqualTo("[{\"headerFormat\":\"\",\"isRegularExpression\":false}]"); + + check.headerFormat = "// header format 20\\d\\d"; + check.isRegularExpression = true; + configAsString = new Gson().toJson(check.configurations()); + assertThat(configAsString) + .isEqualTo( + "[{\"headerFormat\":\"// header format 20\\\\d\\\\d\",\"isRegularExpression\":true}]" + ); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1479Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1479Test.java new file mode 100644 index 00000000000..1ce0fb7854a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1479Test.java @@ -0,0 +1,33 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.Test; + +class S1479Test { + + @Test + void configurations() { + S1479 maxSwitchCasesCheck = new S1479(); + // default configuration + assertThat(maxSwitchCasesCheck.configurations()).containsExactly(30); + maxSwitchCasesCheck.maximum = 4; + assertThat(maxSwitchCasesCheck.configurations()).containsExactly(4); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1539Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1539Test.java new file mode 100644 index 00000000000..f96c7e6f395 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1539Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S1539Test { + + @Test + void configurations() { + String configAsString = new Gson().toJson(new S1539().configurations()); + assertThat(configAsString).isEqualTo("[\"never\"]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1541JsTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1541JsTest.java new file mode 100644 index 00000000000..7a8ce25ba30 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1541JsTest.java @@ -0,0 +1,39 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S1541JsTest { + + @Test + void configurations() { + S1541Js check = new S1541Js(); + + // default configuration + var defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"threshold\":10}]"); + + // custom configuration + check.threshold = 15; + var customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"threshold\":15}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1541TsTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1541TsTest.java new file mode 100644 index 00000000000..ca2d462cc50 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S1541TsTest.java @@ -0,0 +1,39 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S1541TsTest { + + @Test + void configurations() { + S1541Ts check = new S1541Ts(); + + // default configuration + var defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"threshold\":10}]"); + + // custom configuration + check.threshold = 15; + var customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"threshold\":15}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2004Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2004Test.java new file mode 100644 index 00000000000..7af7a9a8da7 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2004Test.java @@ -0,0 +1,36 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S2004Test { + + @Test + void testConfig() { + var check = new S2004(); + var defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"threshold\":4}]"); + + check.threshold = 42; + var customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"threshold\":42}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2068Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2068Test.java new file mode 100644 index 00000000000..9d831fda494 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2068Test.java @@ -0,0 +1,37 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S2068Test { + + @Test + void configurations() { + S2068 check = new S2068(); + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"passwordWords\":[\"password\",\"pwd\",\"passwd\"]}]"); + + check.passwordWords = "foo, bar"; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"passwordWords\":[\"foo\",\"bar\"]}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2094Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2094Test.java new file mode 100644 index 00000000000..b2d4bffe52a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2094Test.java @@ -0,0 +1,34 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S2094Test { + + @Test + void config() { + String configAsString = new Gson().toJson(new S2094().configurations()); + assertThat(configAsString) + .isEqualTo( + "[{\"allowConstructorOnly\":false,\"allowEmpty\":false,\"allowStaticOnly\":true,\"allowWithDecorator\":true}]" + ); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2376Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2376Test.java new file mode 100644 index 00000000000..b61a65d8d19 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2376Test.java @@ -0,0 +1,37 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S2376Test { + + @Test + void configurations() { + S2376 check = new S2376(); + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"getWithoutSet\":false}]"); + // custom configuration + check.getWithoutSet = true; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"getWithoutSet\":true}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2430Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2430Test.java new file mode 100644 index 00000000000..c436ac206ce --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2430Test.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S2430Test { + + @Test + void configurations() { + String configAsString = new Gson().toJson(new S2430().configurations()); + assertThat(configAsString) + .isEqualTo("[{\"newIsCap\":true,\"capIsNew\":false,\"properties\":false}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2814Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2814Test.java new file mode 100644 index 00000000000..981af8eb275 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2814Test.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S2814Test { + + @Test + void configurations() { + String configAsString = new Gson().toJson(new S2814().configurations()); + assertThat(configAsString) + .isEqualTo("[{\"builtinGlobals\":false,\"ignoreDeclarationMerge\":true}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2999Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2999Test.java new file mode 100644 index 00000000000..87eddaa1a96 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S2999Test.java @@ -0,0 +1,39 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S2999Test { + + @Test + void config() { + S2999 check = new S2999(); + + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"considerJSDoc\":false}]"); + + // custom configuration + check.considerJSDoc = true; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"considerJSDoc\":true}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S3353Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S3353Test.java new file mode 100644 index 00000000000..03ab953fb74 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S3353Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S3353Test { + + @Test + void test() { + String json = new Gson().toJson(new S3353().configurations()); + assertThat(json).isEqualTo("[{\"destructuring\":\"all\"}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S3524Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S3524Test.java new file mode 100644 index 00000000000..77f5b4be364 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S3524Test.java @@ -0,0 +1,44 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S3524Test { + + @Test + void test_configuration() { + S3524 check = new S3524(); + + String config = new Gson().toJson(check.configurations()); + assertThat(config) + .isEqualTo("[{\"requireParameterParentheses\":false,\"requireBodyBraces\":false}]"); + + check.parameterParens = true; + config = new Gson().toJson(check.configurations()); + assertThat(config) + .isEqualTo("[{\"requireParameterParentheses\":true,\"requireBodyBraces\":false}]"); + + check.bodyBraces = true; + config = new Gson().toJson(check.configurations()); + assertThat(config) + .isEqualTo("[{\"requireParameterParentheses\":true,\"requireBodyBraces\":true}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S3723Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S3723Test.java new file mode 100644 index 00000000000..ba4b6855e27 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S3723Test.java @@ -0,0 +1,33 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S3723Test { + + @Test + void test_configuration() { + S3723 check = new S3723(); + + String config = new Gson().toJson(check.configurations()); + assertThat(config).isEqualTo("[\"always-multiline\"]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S3776Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S3776Test.java new file mode 100644 index 00000000000..bb14a08f608 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S3776Test.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.Test; + +class S3776Test { + + @Test + void testConfig() { + S3776 check = new S3776(); + assertThat(check.configurations()).containsExactly(15); + check.threshold = 42; + assertThat(check.configurations()).containsExactly(42); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4023Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4023Test.java new file mode 100644 index 00000000000..b32a83b04e2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4023Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S4023Test { + + @Test + void configurations() { + String configAsString = new Gson().toJson(new S4023().configurations()); + assertThat(configAsString).isEqualTo("[{\"allowSingleExtends\":true}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4137Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4137Test.java new file mode 100644 index 00000000000..c1fdc5f67f6 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4137Test.java @@ -0,0 +1,33 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S4137Test { + + @Test + void configurations() { + String configAsString = new Gson() + .toJson(new S4137().configurations()); + assertThat(configAsString) + .isEqualTo("[{\"assertionStyle\":\"as\",\"objectLiteralTypeAssertions\":\"allow\"}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4144Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4144Test.java new file mode 100644 index 00000000000..66b03f033d9 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4144Test.java @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.Test; + +class S4144Test { + + @Test + void configurations() { + S4144 identicalFunctionsCheck = new S4144(); + assertThat(identicalFunctionsCheck.configurations()).containsExactly(3); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4327Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4327Test.java new file mode 100644 index 00000000000..26429272782 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4327Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S4327Test { + + @Test + void configurations() { + assertThat(new Gson().toJson(new S4327().configurations())) + .isEqualTo("[{\"allowDestructuring\":true}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4328Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4328Test.java new file mode 100644 index 00000000000..a2718b6620b --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4328Test.java @@ -0,0 +1,39 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S4328Test { + + @Test + void configurations() { + S4328 check = new S4328(); + + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"whitelist\":[\"\"]}]"); + + // custom configuration + check.whitelist = "foo, bar"; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"whitelist\":[\"foo\",\"bar\"]}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4622Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4622Test.java new file mode 100644 index 00000000000..deb149bbce2 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S4622Test.java @@ -0,0 +1,35 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S4622Test { + + @Test + void configurations() { + S4622 check = new S4622(); + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"threshold\":3}]"); + check.threshold = 4; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"threshold\":4}]"); } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S5604Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S5604Test.java new file mode 100644 index 00000000000..83860d7eb94 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S5604Test.java @@ -0,0 +1,36 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S5604Test { + + @Test + void configurations() { + S5604 check = new S5604(); + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"permissions\":[\"geolocation\"]}]"); + check.permissions = "camera, microphone"; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"permissions\":[\"camera\",\"microphone\"]}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S5693Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S5693Test.java new file mode 100644 index 00000000000..714843d2383 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S5693Test.java @@ -0,0 +1,37 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S5693Test { + + @Test + void configurations() { + S5693 check = new S5693(); + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"fileUploadSizeLimit\":8000000,\"standardSizeLimit\":2000000}]"); + check.fileUploadSizeLimit = 42; + check.standardSizeLimit = 24; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"fileUploadSizeLimit\":42,\"standardSizeLimit\":24}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S5843Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S5843Test.java new file mode 100644 index 00000000000..29eef37adc5 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S5843Test.java @@ -0,0 +1,37 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S5843Test { + + @Test + void configurations() { + S5843 check = new S5843(); + // default configuration + var defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"threshold\":20}]"); + // custom configuration + check.threshold = 15; + var customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"threshold\":15}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6418Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6418Test.java new file mode 100644 index 00000000000..f76c7adcc30 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6418Test.java @@ -0,0 +1,35 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S6418Test { + + @Test + void configurations() { + S6418 check = new S6418(); + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo( + "[{\"secretWords\":\"api[_.-]?key,auth,credential,secret,token\",\"randomnessSensibility\":\"5.0\"}]" + ); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6480Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6480Test.java new file mode 100644 index 00000000000..974795d568f --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6480Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S6480Test { + + @Test + void test() { + var configAsString = new Gson().toJson(new S6480().configurations()); + assertThat(configAsString).isEqualTo("[{\"ignoreRefs\":true,\"ignoreDOMComponents\":true}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6544Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6544Test.java new file mode 100644 index 00000000000..ccd00b45f4a --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6544Test.java @@ -0,0 +1,36 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S6544Test { + + @Test + void config() { + S6544 check = new S6544(); + + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString) + .isEqualTo( + "[{\"ignoreIIFE\":true,\"checksVoidReturn\":{\"attributes\":false,\"arguments\":false}}]" + ); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6550Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6550Test.java new file mode 100644 index 00000000000..8d8e5a04a76 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6550Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S6550Test { + + @Test + void configurations() { + String configAsString = new Gson().toJson(new S6550().configurations()); + assertThat(configAsString).isEqualTo("[{\"allowBitwiseExpressions\":false}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6606Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6606Test.java new file mode 100644 index 00000000000..cea443a04ac --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6606Test.java @@ -0,0 +1,34 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S6606Test { + + @Test + void configurations() { + String configAsString = new Gson().toJson(new S6606().configurations()); + assertThat(configAsString) + .isEqualTo( + "[{\"ignoreConditionalTests\":true,\"ignoreTernaryTests\":false,\"ignoreMixedLogicalExpressions\":true,\"allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing\":true}]" + ); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6644Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6644Test.java new file mode 100644 index 00000000000..c026022f58e --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6644Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S6644Test { + + @Test + void config() { + String configAsString = new Gson().toJson(new S6644().configurations()); + assertThat(configAsString).isEqualTo("[{\"defaultAssignment\":false}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6747Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6747Test.java new file mode 100644 index 00000000000..199de7223ae --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6747Test.java @@ -0,0 +1,33 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S6747Test { + + @Test + void config() { + S6747 check = new S6747(); + + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"ignore\":[\"\"]}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6749Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6749Test.java new file mode 100644 index 00000000000..fcff9ff8ffb --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6749Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S6749Test { + + @Test + void test() { + var configAsString = new Gson().toJson(new S6749().configurations()); + assertThat(configAsString).isEqualTo("[{\"allowExpressions\":true}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6754Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6754Test.java new file mode 100644 index 00000000000..f7b1a4d7f18 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6754Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S6754Test { + + @Test + void configurations() { + String configAsString = new Gson().toJson(new S6754().configurations()); + assertThat(configAsString).isEqualTo("[{\"allowDestructuredState\":true}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6766Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6766Test.java new file mode 100644 index 00000000000..2abfcf4c97c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6766Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S6766Test { + + @Test + void configurations() { + String configAsString = new Gson().toJson(new S6766().configurations()); + assertThat(configAsString).isEqualTo("[{\"forbid\":[\"\\u003e\",\"}\"]}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6791Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6791Test.java new file mode 100644 index 00000000000..07f484bfa6c --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6791Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S6791Test { + + @Test + void config() { + String configAsString = new Gson().toJson(new S6791().configurations()); + assertThat(configAsString).isEqualTo("[{\"checkAliases\":true}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6821Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6821Test.java new file mode 100644 index 00000000000..50a9ac957ab --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6821Test.java @@ -0,0 +1,32 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S6821Test { + + @Test + void config() { + String configAsString = new Gson().toJson(new S6821().configurations()); + assertThat(configAsString) + .isEqualTo("[{\"ignoreNonDOM\":true,\"allowedInvalidRoles\":[\"text\"]}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6847Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6847Test.java new file mode 100644 index 00000000000..98fc304def3 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S6847Test.java @@ -0,0 +1,31 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S6847Test { + + @Test + void configurations() { + var config = new Gson().toJson(new S6847().configurations()); + assertThat(config).isEqualTo("[{\"handlers\":[\"onClick\",\"onMouseDown\",\"onMouseUp\",\"onKeyPress\",\"onKeyDown\",\"onKeyUp\"]}]"); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S905Test.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S905Test.java new file mode 100644 index 00000000000..15a564a3f31 --- /dev/null +++ b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/S905Test.java @@ -0,0 +1,35 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +class S905Test { + + @Test + void test() { + String configAsString = new Gson() + .toJson(new S905().configurations()); + assertThat(configAsString) + .isEqualTo( + "[{\"allowShortCircuit\":true,\"allowTaggedTemplates\":true,\"allowTernary\":true,\"enforceForJSX\":true}]" + ); + } +} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/StrictModeCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/StrictModeCheckTest.java deleted file mode 100644 index 5fc5a9c8e8a..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/StrictModeCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class StrictModeCheckTest { - - @Test - void configurations() { - String configAsString = new Gson().toJson(new StrictModeCheck().configurations()); - assertThat(configAsString).isEqualTo("[\"never\"]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/StringLiteralsQuotesCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/StringLiteralsQuotesCheckTest.java deleted file mode 100644 index 617d97b54c0..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/StringLiteralsQuotesCheckTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class StringLiteralsQuotesCheckTest { - - @Test - void configurations() { - StringLiteralsQuotesCheck check = new StringLiteralsQuotesCheck(); - - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString) - .isEqualTo("[\"single\",{\"avoidEscape\":true,\"allowTemplateLiterals\":true}]"); - - // custom configuration - check.singleQuotes = false; - String customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString) - .isEqualTo("[\"double\",{\"avoidEscape\":true,\"allowTemplateLiterals\":true}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/TooManyLinesInFileCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/TooManyLinesInFileCheckTest.java deleted file mode 100644 index 7eb0ab0e093..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/TooManyLinesInFileCheckTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class TooManyLinesInFileCheckTest { - - @Test - void test_configuration() { - TooManyLinesInFileCheck check = new TooManyLinesInFileCheck(); - - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"maximum\":1000}]"); - - check.maximum = 42; - String configAsString = new Gson().toJson(check.configurations()); - assertThat(configAsString).isEqualTo("[{\"maximum\":42}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/TooManyLinesInFunctionCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/TooManyLinesInFunctionCheckTest.java deleted file mode 100644 index 714406b7dc8..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/TooManyLinesInFunctionCheckTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class TooManyLinesInFunctionCheckTest { - - @Test - void test_configuration() { - var check = new TooManyLinesInFunctionCheck(); - - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"maximum\":200}]"); - - check.max = 42; - String configAsString = new Gson().toJson(check.configurations()); - assertThat(configAsString).isEqualTo("[{\"maximum\":42}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/TrailingCommentCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/TrailingCommentCheckTest.java deleted file mode 100644 index 0b003912d90..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/TrailingCommentCheckTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class TrailingCommentCheckTest { - - @Test - void configurations() { - TrailingCommentCheck check = new TrailingCommentCheck(); - - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString).isEqualTo("[{\"ignorePattern\":\"^\\\\s*[^\\\\s]+$\"}]"); - - // custom configuration - check.legalCommentPattern = "^[ignored]*$"; - String customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"ignorePattern\":\"^[ignored]*$\"}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/UnchangedLetVariableCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/UnchangedLetVariableCheckTest.java deleted file mode 100644 index 6df3cb8a63d..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/UnchangedLetVariableCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class UnchangedLetVariableCheckTest { - - @Test - void test() { - String json = new Gson().toJson(new UnchangedLetVariableCheck().configurations()); - assertThat(json).isEqualTo("[{\"destructuring\":\"all\"}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/UselessExpressionStatementCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/UselessExpressionStatementCheckTest.java deleted file mode 100644 index 5d07a6584bd..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/UselessExpressionStatementCheckTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class UselessExpressionStatementCheckTest { - - @Test - void test() { - String configAsString = new Gson() - .toJson(new UselessExpressionStatementCheck().configurations()); - assertThat(configAsString) - .isEqualTo( - "[{\"allowShortCircuit\":true,\"allowTaggedTemplates\":true,\"allowTernary\":true,\"enforceForJSX\":true}]" - ); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/VariableNameCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/VariableNameCheckTest.java deleted file mode 100644 index 80d7d9d61d3..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/VariableNameCheckTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class VariableNameCheckTest { - - @Test - void configurations() { - VariableNameCheck check = new VariableNameCheck(); - - // default configuration - String defaultConfigAsString = new Gson().toJson(check.configurations()); - assertThat(defaultConfigAsString) - .isEqualTo("[{\"format\":\"^[_$A-Za-z][$A-Za-z0-9]*$|^[_$A-Z][_$A-Z0-9]+$\"}]"); - - // custom configuration - check.format = "^[a-zA-Z0-9]*$"; - String customConfigAsString = new Gson().toJson(check.configurations()); - assertThat(customConfigAsString).isEqualTo("[{\"format\":\"^[a-zA-Z0-9]*$\"}]"); - } -} diff --git a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/VariableShadowingCheckTest.java b/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/VariableShadowingCheckTest.java deleted file mode 100644 index 192f84062c8..00000000000 --- a/sonar-plugin/javascript-checks/src/test/java/org/sonar/javascript/checks/VariableShadowingCheckTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -package org.sonar.javascript.checks; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -class VariableShadowingCheckTest { - - @Test - void test() { - assertThat(new Gson().toJson(new VariableShadowingCheck().configurations())) - .isEqualTo("[{\"hoist\":\"all\"}]"); - } -} diff --git a/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/analysis/JsTsChecks.java b/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/analysis/JsTsChecks.java index 6303dc2e454..0e968124714 100644 --- a/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/analysis/JsTsChecks.java +++ b/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/analysis/JsTsChecks.java @@ -30,7 +30,7 @@ import org.sonar.api.rule.RuleKey; import org.sonar.api.scanner.ScannerSide; import org.sonar.javascript.checks.CheckList; -import org.sonar.javascript.checks.ParsingErrorCheck; +import org.sonar.javascript.checks.S2260; import org.sonar.plugins.javascript.JavaScriptLanguage; import org.sonar.plugins.javascript.TypeScriptLanguage; import org.sonar.plugins.javascript.api.CustomRuleRepository; @@ -140,7 +140,7 @@ RuleKey parsingErrorRuleKey() { protected void initParsingErrorRuleKey() { this.parseErrorRuleKey = all() - .filter(ParsingErrorCheck.class::isInstance) + .filter(S2260.class::isInstance) .findFirst() .map(this::ruleKeyFor) .orElse(null); diff --git a/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/utils/RulesMetadataForSonarLintTest.java b/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/utils/RulesMetadataForSonarLintTest.java index 9cd78bc7d64..c09d5f6b97a 100644 --- a/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/utils/RulesMetadataForSonarLintTest.java +++ b/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/utils/RulesMetadataForSonarLintTest.java @@ -31,7 +31,7 @@ import org.sonar.css.CssProfileDefinition; import org.sonar.css.CssRulesDefinition; import org.sonar.css.rules.AtRuleNoUnknown; -import org.sonar.javascript.checks.StringLiteralsQuotesCheck; +import org.sonar.javascript.checks.S1441; import org.sonar.plugins.javascript.JavaScriptProfilesDefinition; import org.sonar.plugins.javascript.rules.JavaScriptRulesDefinition; @@ -46,7 +46,7 @@ void test() throws Exception { var metadata = new RulesMetadataForSonarLint(); metadata.addRules( "repo", - List.of(StringLiteralsQuotesCheck.class), + List.of(S1441.class), JavaScriptRulesDefinition.METADATA_LOCATION, JavaScriptProfilesDefinition.SONAR_WAY_JSON ); diff --git a/tools/count-rules.js b/tools/count-rules.js index 616270c7a56..cc406c2f5ab 100644 --- a/tools/count-rules.js +++ b/tools/count-rules.js @@ -16,6 +16,12 @@ */ import path from 'node:path'; import fs from 'node:fs/promises'; +import { pathToFileURL } from 'node:url'; + +/** + * Script to count the rules in SonarJS for CSS, JS and TS so that we can update the README.md + * manually. We should automatize this as we do with the eslint-plugin-sonarjs README.md + */ const pathToJsTsRules = path.join( import.meta.dirname, @@ -65,6 +71,9 @@ async function getJsonFiles(pathToRules) { return Promise.all( filenames .filter(filename => filename.endsWith('.json') && filename.length <= 'S1234.json'.length) - .map(async file => await import(path.join(pathToRules, file), { assert: { type: 'json' } })), + .map( + async file => + await import(pathToFileURL(path.join(pathToRules, file)), { with: { type: 'json' } }), + ), ); } diff --git a/tools/generate-external-rules-docs.ts b/tools/generate-external-rules-docs.ts new file mode 100644 index 00000000000..d69ad6d418b --- /dev/null +++ b/tools/generate-external-rules-docs.ts @@ -0,0 +1,96 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { readFile } from 'node:fs/promises'; +import { join } from 'node:path'; +import { getAllRulesMetadata, RULES_FOLDER, writePrettyFile } from './helpers.js'; + +/** + * Script to be called to update the eslint-plugin-sonarjs README.md + * eslint-doc-generator will create a table in the README with all the rules contained in + * plugin. However, we only package the 'original' implementation rules. + * + * We want the README to mention what other rules are contained in SonarJS but NOT + * shipped in the ESlint plugin, so that the users can install those 3rd party plugins + * and enable those rules to get an experience as close as SonarJS but using ESLint + * + * This script will fill the README with those rules for which their meta.ts file + * exports implementation = ['external'|'decorated'] + */ + +const allRules = await getAllRulesMetadata(); + +const externalContents = `| SonarJS rule ID | Rule implemented by |\n|:---|:---|\n${allRules + .filter(rule => rule.implementation === 'external') + .map( + rule => + `| ${sonarCell(rule.sonarKey)} | ${externalRuleCell(rule.externalPlugin, rule.eslintId)} |\n`, + ) + .join('')}`; + +const decoratedContents = `| SonarJS rule ID | Rules used in the SonarJS implementation |\n|:---|:---|\n${allRules + .filter(rule => rule.implementation === 'decorated') + .map( + rule => + `| ${sonarCell(rule.sonarKey)} | ${rule.externalRules.map(r => externalRuleCell(r.externalPlugin, r.externalRule)).join('
')} |\n`, + ) + .join('')}`; + +const README = join(RULES_FOLDER, 'README.md'); + +await writePrettyFile( + README, + (await readFile(README, 'utf8')) + .replace( + /.*/gs, + `\n${externalContents}\n`, + ) + .replace( + /.*/gs, + `\n${decoratedContents}\n`, + ), +); + +function sonarURL(key: string) { + return `https://sonarsource.github.io/rspec/#/rspec/${key}/javascript`; +} + +function sonarCell(key: string) { + return `[${key}](${sonarURL(key)})`; +} + +function externalURL(plugin: string, key: string) { + switch (plugin) { + case 'import': + return `https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/${key}.md`; + case 'react': + return `https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/${key}.md`; + case 'eslint': + return `https://eslint.org/docs/latest/rules/${key}`; + case 'jsx-a11y': + return `https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/${key}.md`; + case 'typescript-eslint': + return `https://github.com/typescript-eslint/typescript-eslint/blob/v7.18.0/packages/eslint-plugin/docs/rules/${key}.mdx`; + case 'react-hooks': + return 'https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/README.md'; + default: + throw new Error(`Error generating URL for unknown ESLint plugin ${plugin}`); + } +} + +function externalRuleCell(plugin: string, key: string) { + return `[${plugin}/${key}](${externalURL(plugin, key)})`; +} diff --git a/tools/generate-meta.ts b/tools/generate-meta.ts index 0c5b3a16673..76612af6131 100644 --- a/tools/generate-meta.ts +++ b/tools/generate-meta.ts @@ -14,119 +14,16 @@ * You should have received a copy of the Sonar Source-Available License * along with this program; if not, see https://sonarsource.com/license/ssal/ */ -import { RuleMetaData } from '@typescript-eslint/utils/ts-eslint'; -import { readdirSync, readFileSync, writeFileSync } from 'fs'; -import { join } from 'node:path/posix'; +import { generateMetaForRule, listRulesDir } from './helpers.js'; -const ruleRegex = /^S\d+$/; - -function toUnixPath(path: string) { - return path.replace(/[\\/]+/g, '/'); -} - -const typeMatrix = { - CODE_SMELL: 'suggestion', - BUG: 'problem', - SECURITY_HOTSPOT: 'problem', - VULNERABILITY: 'problem', -} as const; - -type rspecMeta = { - type: keyof typeof typeMatrix; - status: 'ready' | 'beta' | 'closed' | 'deprecated' | 'superseded'; - title: string; - quickfix: 'covered' | undefined; - tags: string[]; -}; -const RULES_FOLDER = join(toUnixPath(import.meta.dirname), '../packages/jsts/src/rules/'); -const METADATA_FOLDER = join( - toUnixPath(import.meta.dirname), - '../sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/', -); -const sonarWayProfileFile = join(METADATA_FOLDER, `Sonar_way_profile.json`); -const sonarWayProfile = JSON.parse(readFileSync(sonarWayProfileFile, 'utf-8')); - -// Check rule rspec metadata docs in https://github.com/SonarSource/rspec/blob/master/docs/metadata.adoc -function generateMetaForRule(ruleDir: string, ruleId: string) { - const ruleRspecMeta = JSON.parse( - readFileSync(join(METADATA_FOLDER, `${ruleId}.json`), 'utf-8'), - ) as rspecMeta; - if (!typeMatrix[ruleRspecMeta.type]) { - console.log(`Type not found for rule ${ruleId}`); - } - const metadata: Omit, 'schema' | 'messages'> = { - type: typeMatrix[ruleRspecMeta.type], - docs: { - description: ruleRspecMeta.title, - recommended: sonarWayProfile.ruleKeys.includes(ruleId), - //url: `https://github.com/SonarSource/rspec/blob/master/rules/${ruleId}/javascript/rule.adoc`, - url: `https://sonarsource.github.io/rspec/#/rspec/${ruleId}/javascript`, - requiresTypeChecking: ruleRspecMeta.tags.includes('type-dependent'), - }, - }; - if (ruleRspecMeta.quickfix === 'covered') { - metadata.fixable = 'code'; - } - if (ruleRspecMeta.status === 'deprecated') { - metadata.deprecated = true; - } - - let schema = false; - try { - schema = JSON.parse( - readFileSync(join(METADATA_FOLDER, 'schemas', `${ruleId}-schema.json`), 'utf-8'), - ); - } catch {} - - writeFileSync( - join(ruleDir, ruleId, 'meta.ts'), - `/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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. +/** + * Generate packages/jsts/src/rules/SXXXX/generated-meta.ts on each rule + * with data coming from the RSPEC json files. This data fills in the Rule ESLint metadata + * as well as the JSON schema files available in + * "sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/schemas" */ - - -// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" - -export const meta = ${JSON.stringify(metadata, null, 2)}; - -export const sonarKey = '${ruleId}'; -${ - schema - ? `import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -export const schema = ${JSON.stringify(schema, null, 2)} as const satisfies JSONSchema4;` - : '' -} -`, - ); -} - -function generateMetaForRules(ruleDir: string) { - const files = readdirSync(ruleDir, { withFileTypes: true }); - for (const file of files) { - if (!ruleRegex.test(file.name)) { - continue; - } - if (file.isDirectory()) { - const filename = join(ruleDir, file.name); - generateMetaForRule(ruleDir, file.name); - } - } +for (const file of await listRulesDir()) { + await generateMetaForRule(file); } -generateMetaForRules(RULES_FOLDER); +await import('./generate-rule-indexes.js'); diff --git a/tools/generate-rule-indexes.ts b/tools/generate-rule-indexes.ts new file mode 100644 index 00000000000..6d13c3b93aa --- /dev/null +++ b/tools/generate-rule-indexes.ts @@ -0,0 +1,89 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ + +import { + getAllJavaChecks, + getAllRulesMetadata, + javaChecksPath, + RULES_FOLDER, + header, + inflateTemplateToFile, + JAVA_TEMPLATES_FOLDER, + TS_TEMPLATES_FOLDER, +} from './helpers.js'; +import { join } from 'node:path'; + +await updateIndexes(); + +/** + * Updates the following rules indexes, which are autogenerated and + * should NOT be edited manually + * + * Java index: + * sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/AllChecks.java + * + * SonarJS rule index: + * packages/jsts/src/rules/plugin-rules.ts + * + * ESLint plugin rule index: + * packages/jsts/src/rules/rules.ts + */ +export async function updateIndexes() { + const allRules: string[] = []; + const pluginRules: string[] = []; + const eslintIds: Record = {}; + + (await getAllRulesMetadata()).forEach(metadata => { + eslintIds[metadata.sonarKey] = metadata.eslintId; + allRules.push(metadata.sonarKey); + if (metadata.implementation === 'original') { + pluginRules.push(metadata.sonarKey); + } + }); + + await inflateTemplateToFile( + join(TS_TEMPLATES_FOLDER, 'rules.template'), + join(RULES_FOLDER, './rules.ts'), + { + ___EXPORTS___: allRules + .map(id => `export { rule as ${id} } from './${id}/index.js'; // ${eslintIds[id]}\n`) + .join(''), + ___HEADER___: header, + }, + ); + + await inflateTemplateToFile( + join(TS_TEMPLATES_FOLDER, 'plugin-rules.template'), + join(RULES_FOLDER, './plugin-rules.ts'), + { + ___IMPORTS___: pluginRules + .map(id => `import { rule as ${id} } from './${id}/index.js';\n`) + .join(''), + ___EXPORTS___: pluginRules.map(id => `'${eslintIds[id]}': ${id},\n`).join(''), + ___HEADER___: header, + }, + ); + + await inflateTemplateToFile( + join(JAVA_TEMPLATES_FOLDER, 'allchecks.template'), + join(javaChecksPath('main'), 'AllChecks.java'), + { + ___JAVACHECKS_CLASSES___: (await getAllJavaChecks()).map(rule => `${rule}.class`).join(','), + ___HEADER___: header, + }, + ); +} diff --git a/tools/header.ts b/tools/header.ts new file mode 100644 index 00000000000..498c85d46ba --- /dev/null +++ b/tools/header.ts @@ -0,0 +1,16 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ diff --git a/tools/helpers.ts b/tools/helpers.ts new file mode 100644 index 00000000000..a0eb419f5fe --- /dev/null +++ b/tools/helpers.ts @@ -0,0 +1,239 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ + +import prettier from 'prettier'; +import { readdir, writeFile, readFile, stat } from 'fs/promises'; +import { join, dirname } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; +import { prettier as prettierOpts } from '../package.json'; + +const ruleRegex = /^S\d+/; +export const DIRNAME = dirname(fileURLToPath(import.meta.url)); +export const TS_TEMPLATES_FOLDER = join(DIRNAME, 'templates', 'ts'); +export const JAVA_TEMPLATES_FOLDER = join(DIRNAME, 'templates', 'java'); +export const RULES_FOLDER = join(DIRNAME, '..', 'packages', 'jsts', 'src', 'rules'); +export const METADATA_FOLDER = join( + DIRNAME, + '..', + 'sonar-plugin', + 'javascript-checks', + 'src', + 'main', + 'resources', + 'org', + 'sonar', + 'l10n', + 'javascript', + 'rules', + 'javascript', +); +export const header = await readFile(join(DIRNAME, 'header.ts'), 'utf8'); + +const typeMatrix = { + CODE_SMELL: 'suggestion', + BUG: 'problem', + SECURITY_HOTSPOT: 'problem', + VULNERABILITY: 'problem', +} as const; + +type rspecMeta = { + type: keyof typeof typeMatrix; + status: 'ready' | 'beta' | 'closed' | 'deprecated' | 'superseded'; + title: string; + quickfix: 'covered' | undefined; + tags: string[]; +}; + +const sonarWayProfile = JSON.parse( + await readFile(join(METADATA_FOLDER, `Sonar_way_profile.json`), 'utf-8'), +); + +// Array sorter for Sonar rule IDs +const getInt = (sonarKey: string) => parseInt(/^S(\d+)/.exec(sonarKey)[1]); +const sonarKeySorter = (a: string, b: string) => getInt(a) - getInt(b); + +export function verifyRuleName(eslintId: string) { + const re = /^[a-z]+(-[a-z0-9]+)*$/; + if (!re.exec(eslintId)) { + throw new Error(`Invalid class name: it should match ${re}, but got "${eslintId}"`); + } +} + +export function verifyRspecId(sonarKey: string) { + const re = /^S\d+$/; + if (!re.exec(sonarKey)) { + throw new Error(`Invalid rspec key: it should match ${re}, but got "${sonarKey}"`); + } +} + +export function escapeRegExp(str: string) { + return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1'); +} + +/** + * Inflate string template with given dictionary + * @param text template string + * @param dictionary object with the keys to replace + */ +export function inflateTemplate(text: string, dictionary: { [x: string]: string }): string { + for (const tok in dictionary) { + text = text.replace(new RegExp(escapeRegExp(tok), 'g'), dictionary[tok]); + } + return text; +} + +/** + * Reads a template file, inflates it with the provided dictionary, and writes the prettified + * result to destination file + * + * @param templatePath path to template file + * @param dest destination file + * @param dict dictionary to inflate the template + */ +export async function inflateTemplateToFile( + templatePath: string, + dest: string, + dict: { [x: string]: string }, +) { + const template = await readFile(templatePath, 'utf8'); + await writePrettyFile(dest, inflateTemplate(template, dict)); +} + +/** + * From the RSPEC json file, creates a generated-meta.ts file with ESLint formatted metadata + * + * @param sonarKey rule ID for which we need to create the generated-meta.ts file + */ +export async function generateMetaForRule(sonarKey: string) { + const rspecFile = join(METADATA_FOLDER, `${sonarKey}.json`); + const rspecFileExists = await exists(rspecFile); + const ruleRspecMeta: rspecMeta = rspecFileExists + ? JSON.parse(await readFile(rspecFile, 'utf-8')) + : { + // Dummy data to create compilable new rule metadata + title: 'Description', + tags: [], + type: 'BUG', + status: 'ready', + quickfix: 'covered', + }; + + if (!rspecFileExists) { + console.log( + `RSPEC metadata not found for rule ${sonarKey}. Creating dummy "generated-meta.ts"`, + ); + } + + if (!typeMatrix[ruleRspecMeta.type]) { + console.log(`Type not found for rule ${sonarKey}`); + } + + const schemaFile = join(METADATA_FOLDER, 'schemas', `${sonarKey}-schema.json`); + let schema = ''; + if (await exists(schemaFile)) { + try { + schema = `\nimport type { JSONSchema4 } from '@typescript-eslint/utils/json-schema';\nexport const schema = ( ${await readFile(schemaFile, 'utf-8')} ) as const satisfies JSONSchema4;`; + } catch {} + } + + await inflateTemplateToFile( + join(TS_TEMPLATES_FOLDER, 'generated-meta.template'), + join(RULES_FOLDER, sonarKey, `generated-meta.ts`), + { + ___HEADER___: header, + ___RULE_TYPE___: typeMatrix[ruleRspecMeta.type], + ___RULE_KEY___: sonarKey, + ___DESCRIPTION___: ruleRspecMeta.title.replace(/'/g, "\\'"), + ___RECOMMENDED___: sonarWayProfile.ruleKeys.includes(sonarKey), + ___TYPE_CHECKING___: `${ruleRspecMeta.tags.includes('type-dependent')}`, + ___FIXABLE___: ruleRspecMeta.quickfix === 'covered' ? "'code'" : undefined, + ___DEPRECATED___: `${ruleRspecMeta.status === 'deprecated'}`, + ___RULE_SCHEMA___: schema, + }, + ); +} + +/** + * Get path to Java source + * + * @param target whether get source path to "main" or "test" files + */ +export function javaChecksPath(target: 'main' | 'test') { + return join( + DIRNAME, + '../', + 'sonar-plugin', + 'javascript-checks', + 'src', + target, + 'java', + 'org', + 'sonar', + 'javascript', + 'checks', + ); +} + +/** + * List all Java checks classes + */ +export async function getAllJavaChecks() { + const files = await readdir(javaChecksPath('main'), { withFileTypes: true }); + return files + .filter(file => ruleRegex.test(file.name) && !file.isDirectory()) + .map(file => file.name.slice(0, -5)) // remove .java extension + .sort(sonarKeySorter); +} + +/** + * Get the metadata for all rules in SonarJS + */ +export async function getAllRulesMetadata() { + const rulesMetadata = []; + for (const file of await listRulesDir()) { + rulesMetadata.push(await import(pathToFileURL(join(RULES_FOLDER, file, 'meta.js')).toString())); + } + return rulesMetadata; +} + +/** + * List all rules in SonarJS + */ +export async function listRulesDir() { + const files = await readdir(RULES_FOLDER, { withFileTypes: true }); + return files + .filter(file => ruleRegex.test(file.name) && file.isDirectory()) + .map(file => file.name) + .sort(sonarKeySorter); +} + +async function exists(file: string) { + return stat(file) + .then(() => true) + .catch(() => false); +} + +export async function writePrettyFile(filepath: string, contents: string) { + await writeFile( + filepath, + await prettier.format(contents, { + ...(prettierOpts as prettier.Options), + filepath, + plugins: ['prettier-plugin-java'], + }), + ); +} diff --git a/tools/new-rule.mts b/tools/new-rule.mts new file mode 100644 index 00000000000..13afa7419cb --- /dev/null +++ b/tools/new-rule.mts @@ -0,0 +1,164 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * 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 Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +import { writeFile, readFile, mkdir } from 'node:fs/promises'; +import { join } from 'node:path'; +import { input, select } from '@inquirer/prompts'; +import { + DIRNAME, + generateMetaForRule, + inflateTemplateToFile, + JAVA_TEMPLATES_FOLDER, + javaChecksPath, + RULES_FOLDER, + TS_TEMPLATES_FOLDER, + verifyRspecId, + verifyRuleName, +} from './helpers.js'; + +const header = await readFile(join(DIRNAME, 'header.ts'), 'utf8'); + +const sonarKey = await input({ message: 'Enter the Sonar key for the new rule (SXXXX)' }); +const eslintId = await input({ message: 'Enter the ESLint ID for the rule' }); +const ruleTarget = await select({ + message: 'What code does the rule target?', + choices: [ + { + value: 'MAIN', + }, + { + value: 'TEST', + }, + ], +}); +const implementation = await select({ + message: 'Origin of the rule', + choices: [ + { + name: 'Sonar pure implementation', + value: 'original', + }, + { + name: 'External rule to be used directly', + value: 'external', + }, + { + name: 'Rule will decorate an external rule', + value: 'decorated', + }, + ], +}); + +verifyRspecId(sonarKey); +verifyRuleName(eslintId); + +const ruleFolder = join(RULES_FOLDER, sonarKey); + +await mkdir(ruleFolder, { recursive: true }); + +if (implementation !== 'external') { + // index.ts + await writeFile(join(ruleFolder, `index.ts`), `${header}export { rule } from './rule';\n`); + // rule.ts + await inflateTemplateToFile( + join( + TS_TEMPLATES_FOLDER, + implementation === 'original' ? 'rule.template' : 'rule.decorated.template', + ), + join(ruleFolder, `rule.ts`), + { + ___HEADER___: header, + ___RULE_KEY___: sonarKey, + }, + ); + + // cb.test.ts + await inflateTemplateToFile( + join(TS_TEMPLATES_FOLDER, 'rule.cbtest.template'), + join(ruleFolder, `cb.test.ts`), + { + ___HEADER___: header, + ___RULE_KEY___: sonarKey, + }, + ); + + // empty cb.fixture.ts + await writeFile(join(ruleFolder, `cb.fixture.ts`), ''); +} else { + // index.ts + await writeFile( + join(ruleFolder, `index.ts`), + `${header}\nimport { rules } from 'external-plugin';\nexport const rule = rules('rule-name');\n`, + ); +} + +// meta.ts +let extra = ''; +if (implementation === 'decorated') { + extra = `export const externalRules = [\n { externalPlugin: 'plugin-name', externalRule: '${eslintId}' },\n];`; +} else if (implementation === 'external') { + extra = `export const externalPlugin = 'plugin-name';`; +} +await inflateTemplateToFile( + join(TS_TEMPLATES_FOLDER, 'meta.template'), + join(ruleFolder, `meta.ts`), + { + ___HEADER___: header, + ___IMPLEMENTATION___: implementation, + ___ESLINT_ID___: eslintId, + ___EXTRA___: extra, + ___RULE_KEY___: sonarKey, + }, +); + +// preliminary generated-meta.ts +await generateMetaForRule(sonarKey); + +// Create rule java source from template +await inflateTemplateToFile( + join(JAVA_TEMPLATES_FOLDER, ruleTarget === 'MAIN' ? 'rule.main.template' : 'rule.test.template'), + join(javaChecksPath('main'), `${sonarKey}.java`), + { + ___JAVA_RULE_CLASS_NAME___: sonarKey, + ___RULE_KEY___: sonarKey, + ___PROPERTIES___: await readFile(join(JAVA_TEMPLATES_FOLDER, 'properties'), 'utf8'), + ___HEADER___: header, + }, +); + +// Create rule java test from template +await inflateTemplateToFile( + join(JAVA_TEMPLATES_FOLDER, 'ruletest.template'), + join(javaChecksPath('test'), `${sonarKey}Test.java`), + { + ___JAVA_RULE_CLASS_NAME___: sonarKey, + ___HEADER___: header, + }, +); + +console.log(` +STEPS +1. If your rule accepts parameters, please add the JSON Schema to "sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/schemas" +2. After RSPEC for the new rule has been generated, run 'npm run generate-meta' +`); + +if (implementation === 'decorated') { + console.log( + 'Please add all rules used in this decorated rule to the "externalRules" array in "meta.ts"', + ); +} + +await import('./generate-rule-indexes.js'); diff --git a/tools/newRule.ts b/tools/newRule.ts deleted file mode 100644 index aaeb20f8171..00000000000 --- a/tools/newRule.ts +++ /dev/null @@ -1,319 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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 Sonar Source-Available License Version 1, as published by SonarSource SA. - * - * 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 Sonar Source-Available License for more details. - * - * You should have received a copy of the Sonar Source-Available License - * along with this program; if not, see https://sonarsource.com/license/ssal/ - */ -import * as fs from 'fs'; -import * as path from 'path'; - -const rootFolder = path.join(__dirname, '../'); -const templatesFolder = path.join(rootFolder, 'tools/resources/'); -const ruleIndexPath = path.join(templatesFolder, 'rule.index_ts'); -const ruleTemplatePath = path.join(templatesFolder, 'rule.template_ts'); -const ruleCBTestPath = path.join(templatesFolder, 'rule.cbtest_ts'); -const javaRuleTemplatePath = path.join(templatesFolder, 'rule.template_java'); -const checkListPath = path.join( - rootFolder, - 'sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/CheckList.java', -); - -const mainPath = path.join(rootFolder, 'packages/jsts/src/rules/index.ts'); - -run(); - -// example: npm run new-rule S1234 no-something-somewhere -function run() { - if (process.argv.length < 4) { - throw new Error( - `Insufficient number of arguments: expected at least 2, but got ${process.argv.length - 2}`, - ); - } - - const rspecId = process.argv[2]; - const ruleNameDash = process.argv[3]; - const isEslint = process.argv[4] === 'eslint'; - - verifyRspecId(); - verifyRuleName(); - - const javaRuleClassName = getJavaClassName(); - - //- Create file for rule implementation in src/rules. - //- Create test folder in test/rules with the name of the rule file - //- In this folder create files .test.ts - createTsFiles(isEslint); - - updateMain(isEslint); - - //- Create file for rule in java part - createJavaFile(); - - // Add java rule class to CheckList.java - updateCheckList(); - - /** Creates rule typescript source and test files from templates */ - function createTsFiles(isEslint: boolean) { - if (isEslint) { - return; - } - - const ruleFolder = path.join(rootFolder, `packages/jsts/src/rules`, rspecId); - try { - fs.mkdirSync(ruleFolder); - } catch { - // already exists - } - - fs.copyFileSync(ruleIndexPath, path.join(ruleFolder, `index.ts`)); - - const ruleMetadata: { [x: string]: string } = {}; - ruleMetadata['___RULE_NAME_DASH___'] = ruleNameDash; - ruleMetadata['___RULE_CLASS_NAME___'] = javaRuleClassName; - ruleMetadata['___RULE_KEY___'] = rspecId; - - inflateTemplate(ruleTemplatePath, path.join(ruleFolder, `rule.ts`), ruleMetadata); - - fs.writeFileSync( - path.join(ruleFolder, `cb.test.ts`), - fs.readFileSync(ruleCBTestPath, 'utf8').replace('${sonarId}', rspecId), - ); - fs.writeFileSync(path.join(ruleFolder, `cb.fixture.ts`), ''); - } - - /** Creates rule java source from template */ - function createJavaFile() { - const ruleMetadata: { [x: string]: string } = {}; - ruleMetadata['___RULE_NAME_DASH___'] = ruleNameDash; - ruleMetadata['___JAVA_RULE_CLASS_NAME___'] = javaRuleClassName; - ruleMetadata['___RULE_KEY___'] = rspecId; - inflateTemplate( - javaRuleTemplatePath, - path.join( - rootFolder, - `sonar-plugin/javascript-checks/src/main/java/org/sonar/javascript/checks/${javaRuleClassName}.java`, - ), - ruleMetadata, - ); - } - - function updateCheckList() { - const { head1, imports, head2, rules, tail } = parseCheckList(); - let lastRule = rules[rules.length - 1]; - rules[rules.length - 1] = lastRule + ','; - rules.push(` ${javaRuleClassName}.class,`); - - rules.sort(); - lastRule = rules[rules.length - 1]; - // remove comma - rules[rules.length - 1] = lastRule.slice(0, lastRule.length - 1); - - fs.writeFileSync(checkListPath, [...head1, ...imports, ...head2, ...rules, ...tail].join('\n')); - } - - function parseCheckList() { - const readme = fs.readFileSync(checkListPath, 'utf8'); - - const lines = readme.split('\n'); - - const head1: string[] = []; - const imports: string[] = []; - const head2: string[] = []; - const rules: string[] = []; - const tail: string[] = []; - - let state = 0; - - for (const line of lines) { - switch (state) { - case 0: - processHead1(line); - break; - case 1: - processImports(line); - break; - case 2: - processHead2(line); - break; - case 3: - processRule(line); - break; - case 4: - tail.push(line); - break; - } - } - - return { head1, head2, imports, rules, tail }; - - function processHead1(line: string) { - if (line.trim().startsWith('import')) { - state++; - imports.push(line); - } else { - head1.push(line); - } - } - - function processHead2(line: string) { - if (line.trim() === 'return Arrays.asList(') { - state++; - } - head2.push(line); - } - - function processImports(line: string) { - if (!line.trim().startsWith('import')) { - state++; - head2.push(line); - } else { - imports.push(line); - } - } - - function processRule(line: string) { - if (line.trim() === ');') { - state++; - tail.push(line); - } else { - rules.push(line); - } - } - } - - function updateMain(isEslint: boolean) { - if (isEslint) { - return; - } - - const { head1, imports, head2, rules, tail } = parseMain(); - const comment = (s: String) => s.replace(/^.*;/, ''); - - imports.push(`import { rule as ${rspecId} } from './${rspecId}'; // ${ruleNameDash}`); - imports.sort((a, b) => comment(a).localeCompare(comment(b))); - - rules.push(`rules['${ruleNameDash}'] = ${rspecId};`); - rules.sort(); - - fs.writeFileSync(mainPath, [...head1, ...imports, ...head2, ...rules, ...tail].join('\n')); - } - - function parseMain() { - const readme = fs.readFileSync(mainPath, 'utf8'); - - const lines = readme.split('\n'); - - const head1: string[] = []; - const imports: string[] = []; - const head2: string[] = []; - const rules: string[] = []; - const tail: string[] = []; - - let state = 0; - - for (const line of lines) { - switch (state) { - case 0: - processHead1(line); - break; - case 1: - processImports(line); - break; - case 2: - processHead2(line); - break; - case 3: - processRule(line); - break; - case 4: - tail.push(line); - break; - } - } - - return { head1, head2, imports, rules, tail }; - - function processHead1(line: string) { - if (line.trim().startsWith('import { rule as')) { - state++; - imports.push(line); - } else { - head1.push(line); - } - } - - function processHead2(line: string) { - if (line.trim().startsWith('rules[')) { - state++; - rules.push(line); - } else { - head2.push(line); - } - } - - function processImports(line: string) { - if (!line.trim().startsWith('import')) { - state++; - head2.push(line); - } else { - imports.push(line); - } - } - - function processRule(line: string) { - if (!line.trim().startsWith('rules[')) { - state++; - tail.push(line); - } else { - rules.push(line); - } - } - } - - function verifyRuleName() { - const re = /^[a-z]+(-[a-z0-9]+)*$/; - if (!ruleNameDash.match(re)) { - throw new Error(`Invalid class name: it should match ${re}, but got "${ruleNameDash}"`); - } - } - - function verifyRspecId() { - const re = /^S[0-9]+$/; - if (!rspecId.match(re)) { - throw new Error(`Invalid rspec key: it should match ${re}, but got "${rspecId}"`); - } - } - - function getJavaClassName() { - let name = ruleNameDash.replace(/(-[a-z])/g, match => match[1].toUpperCase()); - name = name[0].toUpperCase() + name.slice(1) + 'Check'; - return name; - } -} - -function escapeRegExp(str: string) { - return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1'); -} - -function replace(text: string, dictionary: { [x: string]: string }): string { - for (const tok in dictionary) { - text = text.replace(new RegExp(escapeRegExp(tok), 'g'), dictionary[tok]); - } - return text; -} - -function inflateTemplate(templatePath: string, dest: string, dict: { [x: string]: string }) { - const template = fs.readFileSync(templatePath, 'utf8'); - const inflatedTemplate = replace(template, dict); - fs.writeFileSync(dest, inflatedTemplate); -} diff --git a/tools/resources/rule.cbtest_ts b/tools/resources/rule.cbtest_ts deleted file mode 100644 index 3b6386d8cf1..00000000000 --- a/tools/resources/rule.cbtest_ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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. - */ -import { check } from '../tools'; -import { rule } from './'; -import path from 'path'; - -const sonarId = path.basename(__dirname); - -describe('Rule ${sonarId}', () => { - check(sonarId, rule, __dirname); -}); diff --git a/tools/resources/rule.index_ts b/tools/resources/rule.index_ts deleted file mode 100644 index da2121d0940..00000000000 --- a/tools/resources/rule.index_ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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. - */ -export { rule } from './rule'; diff --git a/tools/resources/rule.template_java b/tools/resources/rule.template_java deleted file mode 100644 index 08c36c90eab..00000000000 --- a/tools/resources/rule.template_java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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. - */ -package org.sonar.javascript.checks; - -import org.sonar.check.Rule; -import org.sonar.plugins.javascript.api.EslintBasedCheck; -import org.sonar.plugins.javascript.api.JavaScriptRule; -import org.sonar.plugins.javascript.api.TypeScriptRule; - -@TypeScriptRule -@JavaScriptRule -@Rule(key = "___RULE_KEY___") -public class ___JAVA_RULE_CLASS_NAME___ implements EslintBasedCheck { - - @Override - public String eslintKey() { - return "___RULE_NAME_DASH___"; - } -} diff --git a/tools/resources/rule.template_ts b/tools/resources/rule.template_ts deleted file mode 100644 index 4193c9187c1..00000000000 --- a/tools/resources/rule.template_ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-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. - */ -// https://sonarsource.github.io/rspec/#/rspec/___RULE_KEY___/javascript - -import { Rule } from 'eslint'; -import { - isRequiredParserServices, - generateMeta, - report, - toSecondaryLocation, -} from '../helpers'; -import * as estree from 'estree'; -import { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; -import { FromSchema } from 'json-schema-to-ts'; -import rspecMeta from './meta.json'; // run "npx tsx tools/generate-meta.ts" to generate meta.json files - -const messages = { - //TODO: add needed messages - messageId: 'message body', -}; - -const DEFAULT_PARAM = 10; - -const schema = { - type: 'array', - minItems: 0, - maxItems: 1, - items: [ - { - // example of parameter, remove if rule has no parameters - type: 'object', - properties: { - param: { - type: 'integer', - }, - }, - additionalProperties: false, - } - ] -} as const satisfies JSONSchema4; - -export const rule: Rule.RuleModule = { - meta: generateMeta(rspecMeta as Rule.RuleMetaData, { schema, messages }, true | false /* true if secondary locations */ ), - create(context: Rule.RuleContext) { - // get typed rule options with FromSchema helper - const param = (context.options as FromSchema)[0]?.param ?? DEFAULT_PARAM; - const services = context.parserServices; - - // remove this condition if the rule does not depend on TS type-checker - if (!isRequiredParserServices(services)) { - return {}; - } - - return { - //example - Identifier(node: estree.Identifier) { - const secondaries: estree.Node[] = []; - const message = 'message body'; - const messageId = 'messageId'; // must exist in messages object of rule metadata - if (param) { - report( - context, - { - node, - message, - messageId, - }, - secondaries.map(n => toSecondaryLocation(n, 'Optional secondary location message')) - ); - } - }, - }; - }, -}; diff --git a/tools/templates/java/allchecks.template b/tools/templates/java/allchecks.template new file mode 100644 index 00000000000..9a56ae11295 --- /dev/null +++ b/tools/templates/java/allchecks.template @@ -0,0 +1,18 @@ +___HEADER___ +package org.sonar.javascript.checks; + +import java.util.Arrays; +import java.util.List; +import org.sonar.plugins.javascript.api.JavaScriptCheck; + +// DO NOT EDIT! This file was generated by generate-rule-indexes.ts + +public class AllChecks { + private AllChecks() { + throw new IllegalStateException("Utility class"); + } + + protected static final List> rules = Arrays.asList( + ___JAVACHECKS_CLASSES___ + ); +} diff --git a/tools/templates/java/properties b/tools/templates/java/properties new file mode 100644 index 00000000000..9b8a786891c --- /dev/null +++ b/tools/templates/java/properties @@ -0,0 +1,22 @@ + // TODO adapt to your rule properties or remove if rule has none + private static final String DEFAULT_PROPERTY_VALUE = ""; + + @RuleProperty( + key = "property", + description = "Property description", + defaultValue = DEFAULT_PROPERTY_VALUE, + type = "TEXT" + ) + public String property = DEFAULT_PROPERTY_VALUE; + + @Override + public List configurations() { + return Collections.singletonList(new Config(property)); + } + + private static class Config { + String property; + Config(String property) { + this.property = property; + } + } diff --git a/tools/templates/java/rule.main.template b/tools/templates/java/rule.main.template new file mode 100644 index 00000000000..7b1c70ca4c2 --- /dev/null +++ b/tools/templates/java/rule.main.template @@ -0,0 +1,18 @@ +___HEADER___ +// https://sonarsource.github.io/rspec/#/rspec/___RULE_KEY___/javascript +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.Check; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@TypeScriptRule +@JavaScriptRule +@Rule(key = "___RULE_KEY___") +public class ___JAVA_RULE_CLASS_NAME___ extends Check { +___PROPERTIES___ +} diff --git a/tools/templates/java/rule.test.template b/tools/templates/java/rule.test.template new file mode 100644 index 00000000000..9ea3f7d618d --- /dev/null +++ b/tools/templates/java/rule.test.template @@ -0,0 +1,18 @@ +___HEADER___ +// https://sonarsource.github.io/rspec/#/rspec/___RULE_KEY___/javascript +package org.sonar.javascript.checks; + +import java.util.Collections; +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.check.RuleProperty; +import org.sonar.plugins.javascript.api.JavaScriptRule; +import org.sonar.plugins.javascript.api.TestFileCheck; +import org.sonar.plugins.javascript.api.TypeScriptRule; + +@JavaScriptRule +@TypeScriptRule +@Rule(key = "___RULE_KEY___") +public class ___JAVA_RULE_CLASS_NAME___ extends TestFileCheck { +___PROPERTIES___ +} diff --git a/tools/templates/java/ruletest.template b/tools/templates/java/ruletest.template new file mode 100644 index 00000000000..139b4f0c934 --- /dev/null +++ b/tools/templates/java/ruletest.template @@ -0,0 +1,23 @@ +___HEADER___ +// https://sonarsource.github.io/rspec/#/rspec/___RULE_KEY___/javascript +package org.sonar.javascript.checks; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.google.gson.Gson; +import org.junit.jupiter.api.Test; + +// TODO: delete this file if the rule is not configurable +class ___JAVA_RULE_CLASS_NAME___Test { + @Test + void configurations() { + ___JAVA_RULE_CLASS_NAME___ check = new ___JAVA_RULE_CLASS_NAME___(); + // default configuration + String defaultConfigAsString = new Gson().toJson(check.configurations()); + assertThat(defaultConfigAsString).isEqualTo("[{\"property\":\"\"}]"); + + check.property = "42"; + String customConfigAsString = new Gson().toJson(check.configurations()); + assertThat(customConfigAsString).isEqualTo("[{\"property\":\"42\"}]"); + } +} diff --git a/tools/templates/ts/generated-meta.template b/tools/templates/ts/generated-meta.template new file mode 100644 index 00000000000..69f50209c32 --- /dev/null +++ b/tools/templates/ts/generated-meta.template @@ -0,0 +1,19 @@ +___HEADER___// https://sonarsource.github.io/rspec/#/rspec/___RULE_KEY___/javascript + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: '___RULE_TYPE___', + docs: { + description: '___DESCRIPTION___', + recommended: ___RECOMMENDED___, + url: 'https://sonarsource.github.io/rspec/#/rspec/___RULE_KEY___/javascript', + requiresTypeChecking: ___TYPE_CHECKING___, + }, + fixable: ___FIXABLE___, + deprecated: ___DEPRECATED___, +}; + +export const sonarKey = '___RULE_KEY___'; + +___RULE_SCHEMA___ diff --git a/tools/templates/ts/meta.template b/tools/templates/ts/meta.template new file mode 100644 index 00000000000..f63e6f5f6c8 --- /dev/null +++ b/tools/templates/ts/meta.template @@ -0,0 +1,5 @@ +___HEADER___// https://sonarsource.github.io/rspec/#/rspec/___RULE_KEY___/javascript +export * from './generated-meta.js'; +export const implementation = '___IMPLEMENTATION___'; +export const eslintId = '___ESLINT_ID___'; +___EXTRA___ diff --git a/tools/templates/ts/plugin-rules.template b/tools/templates/ts/plugin-rules.template new file mode 100644 index 00000000000..56f081f1dcd --- /dev/null +++ b/tools/templates/ts/plugin-rules.template @@ -0,0 +1,9 @@ +___HEADER___ + +// DO NOT EDIT! This file was generated by generate-rule-indexes.ts + +___IMPORTS___ + +export const rules = { +___EXPORTS___ +}; diff --git a/tools/templates/ts/rule.cbtest.template b/tools/templates/ts/rule.cbtest.template new file mode 100644 index 00000000000..97a39b3789f --- /dev/null +++ b/tools/templates/ts/rule.cbtest.template @@ -0,0 +1,11 @@ +___HEADER___// https://sonarsource.github.io/rspec/#/rspec/___RULE_KEY___/javascript +import { check } from '../../../tests/tools/index.js'; +import { rule } from './index.js'; +import path from 'path'; +import { describe } from 'node:test'; + +const sonarId = path.basename(import.meta.dirname); + +describe(`Rule ${sonarId}`, () => { + check(sonarId, rule, import.meta.dirname); +}); diff --git a/tools/templates/ts/rule.decorated.template b/tools/templates/ts/rule.decorated.template new file mode 100644 index 00000000000..e4daa73d760 --- /dev/null +++ b/tools/templates/ts/rule.decorated.template @@ -0,0 +1,40 @@ +___HEADER___// https://sonarsource.github.io/rspec/#/rspec/___RULE_KEY___/javascript + +import { Rule } from 'eslint'; +import { rules } from 'external-plugin'; +import { + generateMeta, + interceptReport, + mergeRules, +} from '../helpers/index.js'; +import { meta } from './meta.js'; + +// you can return the decoratedRule +export const rule: Rule.RuleModule = interceptReport( + rules['external-rule'], + function (context: Rule.RuleContext, descriptor: Rule.ReportDescriptor) { + const node = 'node' in descriptor && descriptor.node; + if (node) { + // ... + context.report({ ...descriptor }); + } + }, +); + +// or return the merger of two or more rules together +export const rule: Rule.RuleModule = { + meta: generateMeta(meta as Rule.RuleMetaData, { + hasSuggestions: true, + messages: { + ...rule1.meta?.messages, + ...rule2.meta?.messages, + }, + schema: rule1.schema, + }), + create(context: Rule.RuleContext) { + return mergeRules( + rule1.create(context), + rule1.create(context), + ); + }, +}; diff --git a/tools/templates/ts/rule.template b/tools/templates/ts/rule.template new file mode 100644 index 00000000000..99c09c8c55e --- /dev/null +++ b/tools/templates/ts/rule.template @@ -0,0 +1,57 @@ +___HEADER___// https://sonarsource.github.io/rspec/#/rspec/___RULE_KEY___/javascript + +import { Rule } from 'eslint'; +import { + isRequiredParserServices, + generateMeta, + report, + toSecondaryLocation, +} from '../helpers/index.js'; +import estree from 'estree'; +import { FromSchema } from 'json-schema-to-ts'; +// if rule has schema, provide it in +// sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/schemas/ +// and re-run npm run generate-meta, otherwise remove the schema import +import { meta, schema } from './meta.js'; + +const messages = { + //TODO: add needed messages + messageId: 'message body', +}; + +const DEFAULT_PARAM = 10; + +export const rule: Rule.RuleModule = { + meta: generateMeta(meta as Rule.RuleMetaData, { schema, messages }, true /* false if no secondary locations */ ), + create(context: Rule.RuleContext) { + // remove this condition if the rule does not depend on TS type-checker + if (!isRequiredParserServices(services)) { + return {}; + } + + // get typed rule options with FromSchema helper + const param = (context.options as FromSchema)[0]?.param ?? DEFAULT_PARAM; + const services = context.parserServices; + + return { + //example + Identifier(node: estree.Identifier) { + const secondaries: estree.Node[] = []; + const message = 'message body'; + const messageId = 'messageId'; // must exist in messages object of rule metadata + if (param) { + // Use context.report if rule does not use secondary locations + report( + context, + { + node, + message, + messageId, + }, + secondaries.map(n => toSecondaryLocation(n, 'Optional secondary location message')) + ); + } + }, + }; + }, +}; diff --git a/tools/templates/ts/rules.template b/tools/templates/ts/rules.template new file mode 100644 index 00000000000..a6b4b479856 --- /dev/null +++ b/tools/templates/ts/rules.template @@ -0,0 +1,5 @@ +___HEADER___ + +// DO NOT EDIT! This file was generated by generate-rule-indexes.ts + +___EXPORTS___ diff --git a/tools/tsconfig.json b/tools/tsconfig.json index e66e8d31a37..02c7b3fc55b 100644 --- a/tools/tsconfig.json +++ b/tools/tsconfig.json @@ -1,9 +1,10 @@ { "compilerOptions": { - "module": "NodeNext", - "target": "es6", + "module": "nodenext", + "target": "ES2023", "allowJs": true, - "moduleResolution": "NodeNext" - }, - "files": ["generate-meta.ts"] + "moduleResolution": "NodeNext", + "resolveJsonModule": true, + "typeRoots": ["../node_modules/@types", "../typings"] + } } diff --git a/typings/eslint-plugin-jsx-a11y/index.d.ts b/typings/eslint-plugin-jsx-a11y/index.d.ts index 06ee447f1c3..7474b6c660b 100644 --- a/typings/eslint-plugin-jsx-a11y/index.d.ts +++ b/typings/eslint-plugin-jsx-a11y/index.d.ts @@ -2,32 +2,3 @@ declare module 'eslint-plugin-jsx-a11y' { import type { Rule } from 'eslint'; export const rules: { [name: string]: Rule.RuleModule }; } -declare module 'eslint-plugin-jsx-a11y/lib/util/getElementType.js' { - import { TSESTree } from '@typescript-eslint/utils'; - type ESLintSettings = { - [key: string]: mixed; - 'jsx-a11y'?: { - polymorphicPropName?: string; - components?: { [key: string]: string }; - }; - }; - - type ESLintContext = { - options: Array; - report: (ESLintReport) => void; - settings: ESLintSettings; - }; - - const getElementType = (context: ESLintContext): ((node: TSESTree.JSXOpeningElement) => string) => - boolean; - - export default getElementType; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader.js' { - const isHiddenFromScreenReader = ( - type: string, - attributes: (TSESTree.JSXAttribute | TSESTree.JSXSpreadAttribute)[], - ) => boolean; - export default isHiddenFromScreenReader; -} diff --git a/typings/jsx-ast-utils/index.d.ts b/typings/jsx-ast-utils/index.d.ts index 1be911488e0..3ffe7502ceb 100644 --- a/typings/jsx-ast-utils/index.d.ts +++ b/typings/jsx-ast-utils/index.d.ts @@ -1,10 +1,12 @@ declare module 'jsx-ast-utils' { - import { TSESTree } from '@typescript-eslint/utils'; + import type { TSESTree } from '@typescript-eslint/utils'; export const hasAnyProp: (any, any) => boolean; export const getProp: ( attributes: (JSXAttribute | JSXSpreadAttribute)[], prop: string, options?: any, ) => JSXAttribute | undefined; - export const getLiteralPropValue: (attributes: JSXAttribute) => unknown; + export const getPropValue: (attribute: JSXAttribute) => string | boolean | undefined; + export const getLiteralPropValue: (attributes: JSXAttribute) => string | boolean | undefined; + export const elementType: (node) => string; }