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/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 ab8d396b982..ab14413baa3 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", @@ -3410,21 +3410,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", @@ -6623,21 +6608,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", @@ -8183,15 +8153,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" @@ -9744,6 +9713,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", @@ -11415,22 +11399,6 @@ "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x" } }, - "node_modules/typedoc/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/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.7.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", diff --git a/package.json b/package.json index 94d4c982159..1b88afbef86 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "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", + "prepare": "husky && npm run create-rule-indexes", "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", @@ -121,7 +122,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 217d53d83c3..e122646dab6 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..1cc0005a283 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,472 @@ 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-credentials](https://sonarsource.github.io/rspec/#/rspec/S2068/javascript) | Hard-coded passwords are security-sensitive | βœ… | | | | | +| [no-hardcoded-ip](https://sonarsource.github.io/rspec/#/rspec/S1313/javascript) | Using hardcoded IP addresses is 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/generated-meta.ts b/packages/jsts/src/rules/S100/generated-meta.ts new file mode 100644 index 00000000000..928aa77ef9d --- /dev/null +++ b/packages/jsts/src/rules/S100/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S101/generated-meta.ts new file mode 100644 index 00000000000..1b38138931e --- /dev/null +++ b/packages/jsts/src/rules/S101/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S103/generated-meta.ts new file mode 100644 index 00000000000..794a85e431b --- /dev/null +++ b/packages/jsts/src/rules/S103/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Lines should not be too long', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S103/javascript', + requiresTypeChecking: false, + }, + deprecated: true, +}; + +export const sonarKey = 'S103'; 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/generated-meta.ts b/packages/jsts/src/rules/S104/generated-meta.ts new file mode 100644 index 00000000000..4061308594b --- /dev/null +++ b/packages/jsts/src/rules/S104/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S105/generated-meta.ts new file mode 100644 index 00000000000..823c011a1e8 --- /dev/null +++ b/packages/jsts/src/rules/S105/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S106/generated-meta.ts new file mode 100644 index 00000000000..a2744ebb908 --- /dev/null +++ b/packages/jsts/src/rules/S106/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Standard outputs should not be used directly to log anything', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S106/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S106'; 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/generated-meta.ts b/packages/jsts/src/rules/S1066/generated-meta.ts new file mode 100644 index 00000000000..19a52ef2df5 --- /dev/null +++ b/packages/jsts/src/rules/S1066/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1067/generated-meta.ts new file mode 100644 index 00000000000..65794e847ca --- /dev/null +++ b/packages/jsts/src/rules/S1067/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S1068/generated-meta.ts new file mode 100644 index 00000000000..b36a51c01f1 --- /dev/null +++ b/packages/jsts/src/rules/S1068/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S107/generated-meta.ts new file mode 100644 index 00000000000..c7bfff7d314 --- /dev/null +++ b/packages/jsts/src/rules/S107/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S1077/generated-meta.ts new file mode 100644 index 00000000000..590a381f079 --- /dev/null +++ b/packages/jsts/src/rules/S1077/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S108/generated-meta.ts new file mode 100644 index 00000000000..9f552ff6bd3 --- /dev/null +++ b/packages/jsts/src/rules/S108/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Nested blocks of code should not be left empty', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S108/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S108'; 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/generated-meta.ts b/packages/jsts/src/rules/S1082/generated-meta.ts new file mode 100644 index 00000000000..7a2b274ce2e --- /dev/null +++ b/packages/jsts/src/rules/S1082/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S109/generated-meta.ts new file mode 100644 index 00000000000..0712485144a --- /dev/null +++ b/packages/jsts/src/rules/S109/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1090/generated-meta.ts new file mode 100644 index 00000000000..7af8ba731f1 --- /dev/null +++ b/packages/jsts/src/rules/S1090/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'iFrames must have a title', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1090/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S1090'; 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/generated-meta.ts b/packages/jsts/src/rules/S1105/generated-meta.ts new file mode 100644 index 00000000000..d2061cde285 --- /dev/null +++ b/packages/jsts/src/rules/S1105/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1110/generated-meta.ts new file mode 100644 index 00000000000..f03bc8edcd8 --- /dev/null +++ b/packages/jsts/src/rules/S1110/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1116/generated-meta.ts new file mode 100644 index 00000000000..a97f368ee89 --- /dev/null +++ b/packages/jsts/src/rules/S1116/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1117/generated-meta.ts new file mode 100644 index 00000000000..83029f082c3 --- /dev/null +++ b/packages/jsts/src/rules/S1117/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 not be shadowed', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1117/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S1117'; 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/generated-meta.ts b/packages/jsts/src/rules/S1119/generated-meta.ts new file mode 100644 index 00000000000..650d3d72ba2 --- /dev/null +++ b/packages/jsts/src/rules/S1119/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1121/generated-meta.ts new file mode 100644 index 00000000000..8b30a5ed50f --- /dev/null +++ b/packages/jsts/src/rules/S1121/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1125/generated-meta.ts new file mode 100644 index 00000000000..0fada34cdd6 --- /dev/null +++ b/packages/jsts/src/rules/S1125/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1126/generated-meta.ts new file mode 100644 index 00000000000..a13a2c97242 --- /dev/null +++ b/packages/jsts/src/rules/S1126/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1128/generated-meta.ts new file mode 100644 index 00000000000..7ec29ce1b5a --- /dev/null +++ b/packages/jsts/src/rules/S1128/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S113/generated-meta.ts new file mode 100644 index 00000000000..0cd72f0213b --- /dev/null +++ b/packages/jsts/src/rules/S113/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Files should end with a newline', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S113/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', + deprecated: true, +}; + +export const sonarKey = 'S113'; 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/generated-meta.ts b/packages/jsts/src/rules/S1131/generated-meta.ts new file mode 100644 index 00000000000..4f20f7d892d --- /dev/null +++ b/packages/jsts/src/rules/S1131/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Lines should not end with trailing whitespaces', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1131/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', + deprecated: true, +}; + +export const sonarKey = 'S1131'; 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/generated-meta.ts b/packages/jsts/src/rules/S1134/generated-meta.ts new file mode 100644 index 00000000000..fbea18d7879 --- /dev/null +++ b/packages/jsts/src/rules/S1134/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1135/generated-meta.ts new file mode 100644 index 00000000000..1e38355868d --- /dev/null +++ b/packages/jsts/src/rules/S1135/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1143/generated-meta.ts new file mode 100644 index 00000000000..725a7cfb129 --- /dev/null +++ b/packages/jsts/src/rules/S1143/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Jump statements should not occur in "finally" blocks', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1143/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S1143'; 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/generated-meta.ts b/packages/jsts/src/rules/S1154/generated-meta.ts new file mode 100644 index 00000000000..ec9e5061a1b --- /dev/null +++ b/packages/jsts/src/rules/S1154/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S117/generated-meta.ts new file mode 100644 index 00000000000..aeee7aed542 --- /dev/null +++ b/packages/jsts/src/rules/S117/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S1172/generated-meta.ts new file mode 100644 index 00000000000..71e8477122c --- /dev/null +++ b/packages/jsts/src/rules/S1172/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1186/generated-meta.ts new file mode 100644 index 00000000000..35c7a764ecc --- /dev/null +++ b/packages/jsts/src/rules/S1186/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1192/generated-meta.ts new file mode 100644 index 00000000000..8a79bc04b7f --- /dev/null +++ b/packages/jsts/src/rules/S1192/generated-meta.ts @@ -0,0 +1,51 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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; 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/generated-meta.ts b/packages/jsts/src/rules/S1199/generated-meta.ts new file mode 100644 index 00000000000..05af34adb71 --- /dev/null +++ b/packages/jsts/src/rules/S1199/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Nested code blocks should not be used', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1199/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S1199'; 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/generated-meta.ts b/packages/jsts/src/rules/S121/generated-meta.ts new file mode 100644 index 00000000000..4beb56ada52 --- /dev/null +++ b/packages/jsts/src/rules/S121/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 structures should use curly braces', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S121/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S121'; 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/generated-meta.ts b/packages/jsts/src/rules/S1219/generated-meta.ts new file mode 100644 index 00000000000..790cccee42e --- /dev/null +++ b/packages/jsts/src/rules/S1219/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S122/generated-meta.ts new file mode 100644 index 00000000000..833ba33a801 --- /dev/null +++ b/packages/jsts/src/rules/S122/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Statements should be on separate lines', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S122/javascript', + requiresTypeChecking: false, + }, + deprecated: true, +}; + +export const sonarKey = 'S122'; 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/generated-meta.ts b/packages/jsts/src/rules/S1226/generated-meta.ts new file mode 100644 index 00000000000..e9cb521fa51 --- /dev/null +++ b/packages/jsts/src/rules/S1226/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S124/generated-meta.ts new file mode 100644 index 00000000000..909d543dce5 --- /dev/null +++ b/packages/jsts/src/rules/S124/generated-meta.ts @@ -0,0 +1,53 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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; 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/generated-meta.ts b/packages/jsts/src/rules/S125/generated-meta.ts new file mode 100644 index 00000000000..8f68d44514f --- /dev/null +++ b/packages/jsts/src/rules/S125/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S126/generated-meta.ts new file mode 100644 index 00000000000..e7bcde83b79 --- /dev/null +++ b/packages/jsts/src/rules/S126/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1264/generated-meta.ts new file mode 100644 index 00000000000..9bb1ec14687 --- /dev/null +++ b/packages/jsts/src/rules/S1264/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S128/generated-meta.ts new file mode 100644 index 00000000000..c5da4f7724f --- /dev/null +++ b/packages/jsts/src/rules/S128/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1291/generated-meta.ts new file mode 100644 index 00000000000..1a9b534c321 --- /dev/null +++ b/packages/jsts/src/rules/S1291/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1301/generated-meta.ts new file mode 100644 index 00000000000..c355a8874ca --- /dev/null +++ b/packages/jsts/src/rules/S1301/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S131/generated-meta.ts new file mode 100644 index 00000000000..34b237bf0ec --- /dev/null +++ b/packages/jsts/src/rules/S131/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1313/generated-meta.ts new file mode 100644 index 00000000000..aceb060ad43 --- /dev/null +++ b/packages/jsts/src/rules/S1313/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1314/generated-meta.ts new file mode 100644 index 00000000000..8212f966648 --- /dev/null +++ b/packages/jsts/src/rules/S1314/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Octal values should not be used', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1314/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S1314'; 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/generated-meta.ts b/packages/jsts/src/rules/S1321/generated-meta.ts new file mode 100644 index 00000000000..cdd4ae894df --- /dev/null +++ b/packages/jsts/src/rules/S1321/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: '"with" statements should not be used', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1321/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S1321'; 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/generated-meta.ts b/packages/jsts/src/rules/S134/generated-meta.ts new file mode 100644 index 00000000000..0a9c96a28bc --- /dev/null +++ b/packages/jsts/src/rules/S134/generated-meta.ts @@ -0,0 +1,48 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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; 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/generated-meta.ts b/packages/jsts/src/rules/S135/generated-meta.ts new file mode 100644 index 00000000000..b718efadeb0 --- /dev/null +++ b/packages/jsts/src/rules/S135/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S138/generated-meta.ts new file mode 100644 index 00000000000..7665a419e7a --- /dev/null +++ b/packages/jsts/src/rules/S138/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S139/generated-meta.ts new file mode 100644 index 00000000000..d497f273edb --- /dev/null +++ b/packages/jsts/src/rules/S139/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Comments should not be located at the end of lines of code', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S139/javascript', + requiresTypeChecking: false, + }, + deprecated: true, +}; + +export const sonarKey = 'S139'; 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/generated-meta.ts b/packages/jsts/src/rules/S1438/generated-meta.ts new file mode 100644 index 00000000000..6116be2814e --- /dev/null +++ b/packages/jsts/src/rules/S1438/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1439/generated-meta.ts new file mode 100644 index 00000000000..784311f820e --- /dev/null +++ b/packages/jsts/src/rules/S1439/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1440/generated-meta.ts new file mode 100644 index 00000000000..cfa2d1c7847 --- /dev/null +++ b/packages/jsts/src/rules/S1440/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: '"===" and "!==" should be used instead of "==" and "!="', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1440/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S1440'; 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/generated-meta.ts b/packages/jsts/src/rules/S1441/generated-meta.ts new file mode 100644 index 00000000000..5977c413f17 --- /dev/null +++ b/packages/jsts/src/rules/S1441/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Quotes for string literals should be used consistently', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1441/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', + deprecated: true, +}; + +export const sonarKey = 'S1441'; 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/generated-meta.ts b/packages/jsts/src/rules/S1442/generated-meta.ts new file mode 100644 index 00000000000..9d2e74e0a9a --- /dev/null +++ b/packages/jsts/src/rules/S1442/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'problem', + docs: { + description: '"alert(...)" should not be used', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1442/javascript', + requiresTypeChecking: false, + }, + deprecated: true, +}; + +export const sonarKey = 'S1442'; 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/generated-meta.ts b/packages/jsts/src/rules/S1444/generated-meta.ts new file mode 100644 index 00000000000..cc0990b5207 --- /dev/null +++ b/packages/jsts/src/rules/S1444/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1451/generated-meta.ts new file mode 100644 index 00000000000..b2f58e1b310 --- /dev/null +++ b/packages/jsts/src/rules/S1451/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S1472/generated-meta.ts new file mode 100644 index 00000000000..d0dacb8e91f --- /dev/null +++ b/packages/jsts/src/rules/S1472/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1479/generated-meta.ts new file mode 100644 index 00000000000..35643ad5de9 --- /dev/null +++ b/packages/jsts/src/rules/S1479/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S1481/generated-meta.ts new file mode 100644 index 00000000000..88325bf6f53 --- /dev/null +++ b/packages/jsts/src/rules/S1481/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1488/generated-meta.ts new file mode 100644 index 00000000000..950a055fb28 --- /dev/null +++ b/packages/jsts/src/rules/S1488/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1515/generated-meta.ts new file mode 100644 index 00000000000..5fd99af4c84 --- /dev/null +++ b/packages/jsts/src/rules/S1515/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1516/generated-meta.ts new file mode 100644 index 00000000000..3a59a59860c --- /dev/null +++ b/packages/jsts/src/rules/S1516/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 string literals should not be used', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1516/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S1516'; 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/generated-meta.ts b/packages/jsts/src/rules/S1523/generated-meta.ts new file mode 100644 index 00000000000..dffc5543f3e --- /dev/null +++ b/packages/jsts/src/rules/S1523/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1525/generated-meta.ts new file mode 100644 index 00000000000..69d4a9cd160 --- /dev/null +++ b/packages/jsts/src/rules/S1525/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'problem', + docs: { + description: 'Debugger statements should not be used', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1525/javascript', + requiresTypeChecking: false, + }, + deprecated: true, +}; + +export const sonarKey = 'S1525'; 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/generated-meta.ts b/packages/jsts/src/rules/S1526/generated-meta.ts new file mode 100644 index 00000000000..532b960cb9e --- /dev/null +++ b/packages/jsts/src/rules/S1526/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1527/generated-meta.ts new file mode 100644 index 00000000000..ed9bfef31f8 --- /dev/null +++ b/packages/jsts/src/rules/S1527/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1528/generated-meta.ts new file mode 100644 index 00000000000..853e7750de6 --- /dev/null +++ b/packages/jsts/src/rules/S1528/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1529/generated-meta.ts new file mode 100644 index 00000000000..7883cc2d893 --- /dev/null +++ b/packages/jsts/src/rules/S1529/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1530/generated-meta.ts new file mode 100644 index 00000000000..bf229724d30 --- /dev/null +++ b/packages/jsts/src/rules/S1530/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1533/generated-meta.ts new file mode 100644 index 00000000000..ea563501102 --- /dev/null +++ b/packages/jsts/src/rules/S1533/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1534/generated-meta.ts new file mode 100644 index 00000000000..2a307094d83 --- /dev/null +++ b/packages/jsts/src/rules/S1534/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1535/generated-meta.ts new file mode 100644 index 00000000000..bd7d85abb54 --- /dev/null +++ b/packages/jsts/src/rules/S1535/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1536/generated-meta.ts new file mode 100644 index 00000000000..69fc9fcf3c4 --- /dev/null +++ b/packages/jsts/src/rules/S1536/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 argument names should be unique', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1536/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S1536'; 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/generated-meta.ts b/packages/jsts/src/rules/S1537/generated-meta.ts new file mode 100644 index 00000000000..b130cd7b59e --- /dev/null +++ b/packages/jsts/src/rules/S1537/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Trailing commas should not be used', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1537/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', + deprecated: true, +}; + +export const sonarKey = 'S1537'; 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/generated-meta.ts b/packages/jsts/src/rules/S1539/generated-meta.ts new file mode 100644 index 00000000000..8750f8e50a5 --- /dev/null +++ b/packages/jsts/src/rules/S1539/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: '"strict" mode should be used with caution', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1539/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S1539'; 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/generated-meta.ts b/packages/jsts/src/rules/S1541/generated-meta.ts new file mode 100644 index 00000000000..cf0ea8f57b7 --- /dev/null +++ b/packages/jsts/src/rules/S1541/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S1607/generated-meta.ts new file mode 100644 index 00000000000..c50553a8cdf --- /dev/null +++ b/packages/jsts/src/rules/S1607/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1656/generated-meta.ts new file mode 100644 index 00000000000..98bb27de597 --- /dev/null +++ b/packages/jsts/src/rules/S1656/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 not be self-assigned', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1656/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S1656'; 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/generated-meta.ts b/packages/jsts/src/rules/S1751/generated-meta.ts new file mode 100644 index 00000000000..034335e9b0a --- /dev/null +++ b/packages/jsts/src/rules/S1751/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1763/generated-meta.ts new file mode 100644 index 00000000000..da8f8c37594 --- /dev/null +++ b/packages/jsts/src/rules/S1763/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1764/generated-meta.ts new file mode 100644 index 00000000000..1d3b11408d7 --- /dev/null +++ b/packages/jsts/src/rules/S1764/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1774/generated-meta.ts new file mode 100644 index 00000000000..38ffd65fd3b --- /dev/null +++ b/packages/jsts/src/rules/S1774/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 ternary operator should not be used', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S1774/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S1774'; 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/generated-meta.ts b/packages/jsts/src/rules/S1788/generated-meta.ts new file mode 100644 index 00000000000..8e44e338e79 --- /dev/null +++ b/packages/jsts/src/rules/S1788/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1821/generated-meta.ts new file mode 100644 index 00000000000..1af695bfd4a --- /dev/null +++ b/packages/jsts/src/rules/S1821/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1848/generated-meta.ts new file mode 100644 index 00000000000..89c12b931d0 --- /dev/null +++ b/packages/jsts/src/rules/S1848/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1854/generated-meta.ts new file mode 100644 index 00000000000..6c0039d56f6 --- /dev/null +++ b/packages/jsts/src/rules/S1854/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1862/generated-meta.ts new file mode 100644 index 00000000000..f7523e43025 --- /dev/null +++ b/packages/jsts/src/rules/S1862/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1871/generated-meta.ts new file mode 100644 index 00000000000..907cca1cd99 --- /dev/null +++ b/packages/jsts/src/rules/S1871/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1874/generated-meta.ts new file mode 100644 index 00000000000..d7fadd45ec2 --- /dev/null +++ b/packages/jsts/src/rules/S1874/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1940/generated-meta.ts new file mode 100644 index 00000000000..b2fd8b5f56d --- /dev/null +++ b/packages/jsts/src/rules/S1940/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S1994/generated-meta.ts new file mode 100644 index 00000000000..6ddbb838059 --- /dev/null +++ b/packages/jsts/src/rules/S1994/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2004/generated-meta.ts new file mode 100644 index 00000000000..758f2df3df4 --- /dev/null +++ b/packages/jsts/src/rules/S2004/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S2068/generated-meta.ts new file mode 100644 index 00000000000..cba4367003f --- /dev/null +++ b/packages/jsts/src/rules/S2068/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S2077/generated-meta.ts new file mode 100644 index 00000000000..b8eb9db5679 --- /dev/null +++ b/packages/jsts/src/rules/S2077/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2092/generated-meta.ts new file mode 100644 index 00000000000..8e6559fe6ea --- /dev/null +++ b/packages/jsts/src/rules/S2092/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2094/generated-meta.ts new file mode 100644 index 00000000000..4edce2dc04e --- /dev/null +++ b/packages/jsts/src/rules/S2094/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Classes should not be empty', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S2094/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S2094'; 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/generated-meta.ts b/packages/jsts/src/rules/S2123/generated-meta.ts new file mode 100644 index 00000000000..5ac45b8bb23 --- /dev/null +++ b/packages/jsts/src/rules/S2123/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2137/generated-meta.ts new file mode 100644 index 00000000000..b416f216884 --- /dev/null +++ b/packages/jsts/src/rules/S2137/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2138/generated-meta.ts new file mode 100644 index 00000000000..a7314cfdb9f --- /dev/null +++ b/packages/jsts/src/rules/S2138/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2187/generated-meta.ts new file mode 100644 index 00000000000..0412684bfc5 --- /dev/null +++ b/packages/jsts/src/rules/S2187/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2189/generated-meta.ts new file mode 100644 index 00000000000..1dbc8bbebde --- /dev/null +++ b/packages/jsts/src/rules/S2189/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2201/generated-meta.ts new file mode 100644 index 00000000000..3d41f9bd113 --- /dev/null +++ b/packages/jsts/src/rules/S2201/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2208/generated-meta.ts new file mode 100644 index 00000000000..c75cf9954fe --- /dev/null +++ b/packages/jsts/src/rules/S2208/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2234/generated-meta.ts new file mode 100644 index 00000000000..bbed013d53c --- /dev/null +++ b/packages/jsts/src/rules/S2234/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2245/generated-meta.ts new file mode 100644 index 00000000000..e585104de0c --- /dev/null +++ b/packages/jsts/src/rules/S2245/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2251/generated-meta.ts new file mode 100644 index 00000000000..e3b42d89fdd --- /dev/null +++ b/packages/jsts/src/rules/S2251/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2255/generated-meta.ts new file mode 100644 index 00000000000..6e97af9b597 --- /dev/null +++ b/packages/jsts/src/rules/S2255/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2259/generated-meta.ts new file mode 100644 index 00000000000..a5856296a2d --- /dev/null +++ b/packages/jsts/src/rules/S2259/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2301/generated-meta.ts new file mode 100644 index 00000000000..57999846ad3 --- /dev/null +++ b/packages/jsts/src/rules/S2301/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2310/generated-meta.ts new file mode 100644 index 00000000000..8fd3bdf459c --- /dev/null +++ b/packages/jsts/src/rules/S2310/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2376/generated-meta.ts new file mode 100644 index 00000000000..9faf1395b21 --- /dev/null +++ b/packages/jsts/src/rules/S2376/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2392/generated-meta.ts new file mode 100644 index 00000000000..1e12700fd49 --- /dev/null +++ b/packages/jsts/src/rules/S2392/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2424/generated-meta.ts new file mode 100644 index 00000000000..fcfa79699dd --- /dev/null +++ b/packages/jsts/src/rules/S2424/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2427/generated-meta.ts new file mode 100644 index 00000000000..431257cbb0d --- /dev/null +++ b/packages/jsts/src/rules/S2427/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'problem', + docs: { + description: 'The base should be provided to "parseInt"', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S2427/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S2427'; 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/generated-meta.ts b/packages/jsts/src/rules/S2428/generated-meta.ts new file mode 100644 index 00000000000..f92f9145c42 --- /dev/null +++ b/packages/jsts/src/rules/S2428/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2430/generated-meta.ts new file mode 100644 index 00000000000..15f4808ffc4 --- /dev/null +++ b/packages/jsts/src/rules/S2430/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2432/generated-meta.ts new file mode 100644 index 00000000000..c076f7ba877 --- /dev/null +++ b/packages/jsts/src/rules/S2432/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Setters should not return values', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S2432/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S2432'; 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/generated-meta.ts b/packages/jsts/src/rules/S2486/generated-meta.ts new file mode 100644 index 00000000000..94f69814331 --- /dev/null +++ b/packages/jsts/src/rules/S2486/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2589/generated-meta.ts new file mode 100644 index 00000000000..331a2ee83e5 --- /dev/null +++ b/packages/jsts/src/rules/S2589/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2598/generated-meta.ts new file mode 100644 index 00000000000..8a1231b0540 --- /dev/null +++ b/packages/jsts/src/rules/S2598/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2612/generated-meta.ts new file mode 100644 index 00000000000..cbc7c47ccfc --- /dev/null +++ b/packages/jsts/src/rules/S2612/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2639/generated-meta.ts new file mode 100644 index 00000000000..7ba15f1f870 --- /dev/null +++ b/packages/jsts/src/rules/S2639/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2681/generated-meta.ts new file mode 100644 index 00000000000..f4a98fac679 --- /dev/null +++ b/packages/jsts/src/rules/S2681/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2685/generated-meta.ts new file mode 100644 index 00000000000..7cfebe74d64 --- /dev/null +++ b/packages/jsts/src/rules/S2685/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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.caller" and "arguments.callee" should not be used', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S2685/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S2685'; 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/generated-meta.ts b/packages/jsts/src/rules/S2688/generated-meta.ts new file mode 100644 index 00000000000..352f4d28d75 --- /dev/null +++ b/packages/jsts/src/rules/S2688/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2692/generated-meta.ts new file mode 100644 index 00000000000..3cc015e6a26 --- /dev/null +++ b/packages/jsts/src/rules/S2692/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2699/generated-meta.ts new file mode 100644 index 00000000000..b47833cbc41 --- /dev/null +++ b/packages/jsts/src/rules/S2699/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2703/generated-meta.ts new file mode 100644 index 00000000000..8061779a8ba --- /dev/null +++ b/packages/jsts/src/rules/S2703/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2737/generated-meta.ts new file mode 100644 index 00000000000..2342524859b --- /dev/null +++ b/packages/jsts/src/rules/S2737/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2755/generated-meta.ts new file mode 100644 index 00000000000..75310068dc1 --- /dev/null +++ b/packages/jsts/src/rules/S2755/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2757/generated-meta.ts new file mode 100644 index 00000000000..7ff83590837 --- /dev/null +++ b/packages/jsts/src/rules/S2757/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2814/generated-meta.ts new file mode 100644 index 00000000000..491cf1f083a --- /dev/null +++ b/packages/jsts/src/rules/S2814/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2817/generated-meta.ts new file mode 100644 index 00000000000..798b6806176 --- /dev/null +++ b/packages/jsts/src/rules/S2817/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2819/generated-meta.ts new file mode 100644 index 00000000000..f40afaacaa8 --- /dev/null +++ b/packages/jsts/src/rules/S2819/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2870/generated-meta.ts new file mode 100644 index 00000000000..8ceffd3acab --- /dev/null +++ b/packages/jsts/src/rules/S2870/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2871/generated-meta.ts new file mode 100644 index 00000000000..7770368d903 --- /dev/null +++ b/packages/jsts/src/rules/S2871/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2933/generated-meta.ts new file mode 100644 index 00000000000..b481e8136fd --- /dev/null +++ b/packages/jsts/src/rules/S2933/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Fields that are only assigned in the constructor should be "readonly"', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S2933/javascript', + requiresTypeChecking: true, + }, + fixable: 'code', +}; + +export const sonarKey = 'S2933'; 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/generated-meta.ts b/packages/jsts/src/rules/S2966/generated-meta.ts new file mode 100644 index 00000000000..e29331f9820 --- /dev/null +++ b/packages/jsts/src/rules/S2966/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Non-null assertions should not be used', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S2966/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S2966'; 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/generated-meta.ts b/packages/jsts/src/rules/S2970/generated-meta.ts new file mode 100644 index 00000000000..93d9219f508 --- /dev/null +++ b/packages/jsts/src/rules/S2970/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2990/generated-meta.ts new file mode 100644 index 00000000000..9cde9474d1a --- /dev/null +++ b/packages/jsts/src/rules/S2990/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S2999/generated-meta.ts new file mode 100644 index 00000000000..985e7ccc9ab --- /dev/null +++ b/packages/jsts/src/rules/S2999/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S3001/generated-meta.ts new file mode 100644 index 00000000000..eff0763b332 --- /dev/null +++ b/packages/jsts/src/rules/S3001/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3003/generated-meta.ts new file mode 100644 index 00000000000..283e90fed85 --- /dev/null +++ b/packages/jsts/src/rules/S3003/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3257/generated-meta.ts new file mode 100644 index 00000000000..3e4299f7ad6 --- /dev/null +++ b/packages/jsts/src/rules/S3257/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Primitive types should be omitted from initialized or defaulted declarations', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S3257/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S3257'; 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/generated-meta.ts b/packages/jsts/src/rules/S3317/generated-meta.ts new file mode 100644 index 00000000000..e0ba9e01914 --- /dev/null +++ b/packages/jsts/src/rules/S3317/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3330/generated-meta.ts new file mode 100644 index 00000000000..3818cc0225f --- /dev/null +++ b/packages/jsts/src/rules/S3330/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3353/generated-meta.ts new file mode 100644 index 00000000000..1ba3f58532c --- /dev/null +++ b/packages/jsts/src/rules/S3353/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Unchanged variables should be marked as "const"', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S3353/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S3353'; 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/generated-meta.ts b/packages/jsts/src/rules/S3358/generated-meta.ts new file mode 100644 index 00000000000..d85b6cfdeb3 --- /dev/null +++ b/packages/jsts/src/rules/S3358/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3402/generated-meta.ts new file mode 100644 index 00000000000..d63ef620eef --- /dev/null +++ b/packages/jsts/src/rules/S3402/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3403/generated-meta.ts new file mode 100644 index 00000000000..939b1dbbbc7 --- /dev/null +++ b/packages/jsts/src/rules/S3403/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3415/generated-meta.ts new file mode 100644 index 00000000000..f17807495a9 --- /dev/null +++ b/packages/jsts/src/rules/S3415/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3498/generated-meta.ts new file mode 100644 index 00000000000..29a1776f4c2 --- /dev/null +++ b/packages/jsts/src/rules/S3498/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3499/generated-meta.ts new file mode 100644 index 00000000000..e51ac4abc6f --- /dev/null +++ b/packages/jsts/src/rules/S3499/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3500/generated-meta.ts new file mode 100644 index 00000000000..21729d5aee3 --- /dev/null +++ b/packages/jsts/src/rules/S3500/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3504/generated-meta.ts new file mode 100644 index 00000000000..9c31278a7d9 --- /dev/null +++ b/packages/jsts/src/rules/S3504/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3512/generated-meta.ts new file mode 100644 index 00000000000..db342a72e25 --- /dev/null +++ b/packages/jsts/src/rules/S3512/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3513/generated-meta.ts new file mode 100644 index 00000000000..ea1f0c5c3df --- /dev/null +++ b/packages/jsts/src/rules/S3513/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3514/generated-meta.ts new file mode 100644 index 00000000000..c81a0c149ff --- /dev/null +++ b/packages/jsts/src/rules/S3514/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3516/generated-meta.ts new file mode 100644 index 00000000000..fb384ca22a9 --- /dev/null +++ b/packages/jsts/src/rules/S3516/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3523/generated-meta.ts new file mode 100644 index 00000000000..70a4c385175 --- /dev/null +++ b/packages/jsts/src/rules/S3523/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Function constructors should not be used', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S3523/javascript', + requiresTypeChecking: false, + }, + deprecated: true, +}; + +export const sonarKey = 'S3523'; 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/generated-meta.ts b/packages/jsts/src/rules/S3524/generated-meta.ts new file mode 100644 index 00000000000..1edff9d89a3 --- /dev/null +++ b/packages/jsts/src/rules/S3524/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S3525/generated-meta.ts new file mode 100644 index 00000000000..eea2ed61851 --- /dev/null +++ b/packages/jsts/src/rules/S3525/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3531/generated-meta.ts new file mode 100644 index 00000000000..18ae4ec0c94 --- /dev/null +++ b/packages/jsts/src/rules/S3531/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3533/generated-meta.ts new file mode 100644 index 00000000000..1ce438976d4 --- /dev/null +++ b/packages/jsts/src/rules/S3533/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3579/generated-meta.ts new file mode 100644 index 00000000000..05cde952dc1 --- /dev/null +++ b/packages/jsts/src/rules/S3579/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3616/generated-meta.ts new file mode 100644 index 00000000000..6dabe8c9902 --- /dev/null +++ b/packages/jsts/src/rules/S3616/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3626/generated-meta.ts new file mode 100644 index 00000000000..bb7ca26fb6e --- /dev/null +++ b/packages/jsts/src/rules/S3626/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3686/generated-meta.ts new file mode 100644 index 00000000000..9426592986a --- /dev/null +++ b/packages/jsts/src/rules/S3686/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3696/generated-meta.ts new file mode 100644 index 00000000000..a91b4ed4f71 --- /dev/null +++ b/packages/jsts/src/rules/S3696/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3699/generated-meta.ts new file mode 100644 index 00000000000..c267cc73f46 --- /dev/null +++ b/packages/jsts/src/rules/S3699/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3723/generated-meta.ts new file mode 100644 index 00000000000..feacfeb77fa --- /dev/null +++ b/packages/jsts/src/rules/S3723/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3735/generated-meta.ts new file mode 100644 index 00000000000..c8e56ffbc79 --- /dev/null +++ b/packages/jsts/src/rules/S3735/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3757/generated-meta.ts new file mode 100644 index 00000000000..dd772b1010f --- /dev/null +++ b/packages/jsts/src/rules/S3757/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3758/generated-meta.ts new file mode 100644 index 00000000000..2d3bb33b7ea --- /dev/null +++ b/packages/jsts/src/rules/S3758/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3760/generated-meta.ts new file mode 100644 index 00000000000..1bfcc3c4c6b --- /dev/null +++ b/packages/jsts/src/rules/S3760/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3776/generated-meta.ts new file mode 100644 index 00000000000..d5a42976897 --- /dev/null +++ b/packages/jsts/src/rules/S3776/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S3782/generated-meta.ts new file mode 100644 index 00000000000..b012d5a6ada --- /dev/null +++ b/packages/jsts/src/rules/S3782/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3785/generated-meta.ts new file mode 100644 index 00000000000..3ceec598124 --- /dev/null +++ b/packages/jsts/src/rules/S3785/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3786/generated-meta.ts new file mode 100644 index 00000000000..287a093824d --- /dev/null +++ b/packages/jsts/src/rules/S3786/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Template literal placeholder syntax should not be used in regular strings', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S3786/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S3786'; 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/generated-meta.ts b/packages/jsts/src/rules/S3796/generated-meta.ts new file mode 100644 index 00000000000..7ce40c2c72e --- /dev/null +++ b/packages/jsts/src/rules/S3796/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3798/generated-meta.ts new file mode 100644 index 00000000000..d81dd7335c7 --- /dev/null +++ b/packages/jsts/src/rules/S3798/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3799/generated-meta.ts new file mode 100644 index 00000000000..7ba2ee3a8ed --- /dev/null +++ b/packages/jsts/src/rules/S3799/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Destructuring patterns should not be empty', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S3799/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S3799'; 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/generated-meta.ts b/packages/jsts/src/rules/S3800/generated-meta.ts new file mode 100644 index 00000000000..0cbca15c4fe --- /dev/null +++ b/packages/jsts/src/rules/S3800/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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 623e9fcecbf..2e6f35cc881 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/generated-meta.ts b/packages/jsts/src/rules/S3801/generated-meta.ts new file mode 100644 index 00000000000..73aaf2374a1 --- /dev/null +++ b/packages/jsts/src/rules/S3801/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3812/generated-meta.ts new file mode 100644 index 00000000000..2834fd73ab2 --- /dev/null +++ b/packages/jsts/src/rules/S3812/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'problem', + docs: { + description: 'Parentheses should be used when negating "in" and "instanceof" operations', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S3812/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S3812'; 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/generated-meta.ts b/packages/jsts/src/rules/S3827/generated-meta.ts new file mode 100644 index 00000000000..1349d493ccd --- /dev/null +++ b/packages/jsts/src/rules/S3827/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3834/generated-meta.ts new file mode 100644 index 00000000000..349dbedfe7c --- /dev/null +++ b/packages/jsts/src/rules/S3834/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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" operator should not be used with Symbol and BigInt', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S3834/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S3834'; 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/generated-meta.ts b/packages/jsts/src/rules/S3854/generated-meta.ts new file mode 100644 index 00000000000..e1abd8fe152 --- /dev/null +++ b/packages/jsts/src/rules/S3854/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3863/generated-meta.ts new file mode 100644 index 00000000000..8e4793ff9f6 --- /dev/null +++ b/packages/jsts/src/rules/S3863/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Imports from the same module should be merged', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S3863/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S3863'; 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/generated-meta.ts b/packages/jsts/src/rules/S3923/generated-meta.ts new file mode 100644 index 00000000000..d68e8efee84 --- /dev/null +++ b/packages/jsts/src/rules/S3923/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3972/generated-meta.ts new file mode 100644 index 00000000000..1c60ff13210 --- /dev/null +++ b/packages/jsts/src/rules/S3972/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3973/generated-meta.ts new file mode 100644 index 00000000000..4f9b76afa12 --- /dev/null +++ b/packages/jsts/src/rules/S3973/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3981/generated-meta.ts new file mode 100644 index 00000000000..a9a7acb46b2 --- /dev/null +++ b/packages/jsts/src/rules/S3981/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S3984/generated-meta.ts new file mode 100644 index 00000000000..ef802930444 --- /dev/null +++ b/packages/jsts/src/rules/S3984/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4023/generated-meta.ts new file mode 100644 index 00000000000..d501959b1a2 --- /dev/null +++ b/packages/jsts/src/rules/S4023/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4030/generated-meta.ts new file mode 100644 index 00000000000..1016632550d --- /dev/null +++ b/packages/jsts/src/rules/S4030/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4036/generated-meta.ts new file mode 100644 index 00000000000..1d75435280b --- /dev/null +++ b/packages/jsts/src/rules/S4036/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4043/generated-meta.ts new file mode 100644 index 00000000000..ddc92b0c3c9 --- /dev/null +++ b/packages/jsts/src/rules/S4043/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4084/generated-meta.ts new file mode 100644 index 00000000000..5888111b061 --- /dev/null +++ b/packages/jsts/src/rules/S4084/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4123/generated-meta.ts new file mode 100644 index 00000000000..a4c8a6ff4cc --- /dev/null +++ b/packages/jsts/src/rules/S4123/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4124/generated-meta.ts new file mode 100644 index 00000000000..3f4917e20b9 --- /dev/null +++ b/packages/jsts/src/rules/S4124/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Constructors should not be declared inside interfaces', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S4124/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S4124'; 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/generated-meta.ts b/packages/jsts/src/rules/S4125/generated-meta.ts new file mode 100644 index 00000000000..27a9eb8156d --- /dev/null +++ b/packages/jsts/src/rules/S4125/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: '"typeof" expressions should only be compared to valid values', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S4125/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S4125'; 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/generated-meta.ts b/packages/jsts/src/rules/S4136/generated-meta.ts new file mode 100644 index 00000000000..3e4cae01e81 --- /dev/null +++ b/packages/jsts/src/rules/S4136/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Method overloads should be grouped together', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S4136/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S4136'; 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/generated-meta.ts b/packages/jsts/src/rules/S4137/generated-meta.ts new file mode 100644 index 00000000000..3d1f36770ef --- /dev/null +++ b/packages/jsts/src/rules/S4137/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 assertions should use "as"', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S4137/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S4137'; 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/generated-meta.ts b/packages/jsts/src/rules/S4138/generated-meta.ts new file mode 100644 index 00000000000..87fa246bb1a --- /dev/null +++ b/packages/jsts/src/rules/S4138/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4139/generated-meta.ts new file mode 100644 index 00000000000..dc34a78467d --- /dev/null +++ b/packages/jsts/src/rules/S4139/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4140/generated-meta.ts new file mode 100644 index 00000000000..ba28892c731 --- /dev/null +++ b/packages/jsts/src/rules/S4140/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Sparse arrays should not be created with extra commas', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S4140/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S4140'; 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/generated-meta.ts b/packages/jsts/src/rules/S4143/generated-meta.ts new file mode 100644 index 00000000000..770fe49f14c --- /dev/null +++ b/packages/jsts/src/rules/S4143/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4144/generated-meta.ts new file mode 100644 index 00000000000..52c67098e7a --- /dev/null +++ b/packages/jsts/src/rules/S4144/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S4156/generated-meta.ts new file mode 100644 index 00000000000..250e3fb3d82 --- /dev/null +++ b/packages/jsts/src/rules/S4156/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4157/generated-meta.ts new file mode 100644 index 00000000000..ba87ccecfcf --- /dev/null +++ b/packages/jsts/src/rules/S4157/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Default type parameters should be omitted', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S4157/javascript', + requiresTypeChecking: true, + }, + fixable: 'code', +}; + +export const sonarKey = 'S4157'; 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/generated-meta.ts b/packages/jsts/src/rules/S4158/generated-meta.ts new file mode 100644 index 00000000000..241adb83e06 --- /dev/null +++ b/packages/jsts/src/rules/S4158/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4165/generated-meta.ts new file mode 100644 index 00000000000..10c3953d0a4 --- /dev/null +++ b/packages/jsts/src/rules/S4165/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4204/generated-meta.ts new file mode 100644 index 00000000000..cc890363494 --- /dev/null +++ b/packages/jsts/src/rules/S4204/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'The "any" type should not be used', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S4204/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S4204'; 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/generated-meta.ts b/packages/jsts/src/rules/S4275/generated-meta.ts new file mode 100644 index 00000000000..b0afbc64db9 --- /dev/null +++ b/packages/jsts/src/rules/S4275/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4322/generated-meta.ts new file mode 100644 index 00000000000..7506edf8765 --- /dev/null +++ b/packages/jsts/src/rules/S4322/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4323/generated-meta.ts new file mode 100644 index 00000000000..90487183f42 --- /dev/null +++ b/packages/jsts/src/rules/S4323/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4324/generated-meta.ts new file mode 100644 index 00000000000..4acf2a71e6f --- /dev/null +++ b/packages/jsts/src/rules/S4324/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4325/generated-meta.ts new file mode 100644 index 00000000000..5c369c10448 --- /dev/null +++ b/packages/jsts/src/rules/S4325/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Redundant casts and non-null assertions should be avoided', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S4325/javascript', + requiresTypeChecking: true, + }, + fixable: 'code', +}; + +export const sonarKey = 'S4325'; 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/generated-meta.ts b/packages/jsts/src/rules/S4326/generated-meta.ts new file mode 100644 index 00000000000..9ce80dbcbbe --- /dev/null +++ b/packages/jsts/src/rules/S4326/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: '"await" should not be used redundantly', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S4326/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S4326'; 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/generated-meta.ts b/packages/jsts/src/rules/S4327/generated-meta.ts new file mode 100644 index 00000000000..f591edb43cf --- /dev/null +++ b/packages/jsts/src/rules/S4327/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4328/generated-meta.ts new file mode 100644 index 00000000000..9741425d9aa --- /dev/null +++ b/packages/jsts/src/rules/S4328/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S4335/generated-meta.ts new file mode 100644 index 00000000000..5adba9c4025 --- /dev/null +++ b/packages/jsts/src/rules/S4335/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4423/generated-meta.ts new file mode 100644 index 00000000000..cf367a9f020 --- /dev/null +++ b/packages/jsts/src/rules/S4423/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4426/generated-meta.ts new file mode 100644 index 00000000000..020c0575f61 --- /dev/null +++ b/packages/jsts/src/rules/S4426/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4502/generated-meta.ts new file mode 100644 index 00000000000..f273cdac8e6 --- /dev/null +++ b/packages/jsts/src/rules/S4502/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4507/generated-meta.ts new file mode 100644 index 00000000000..0b45c921473 --- /dev/null +++ b/packages/jsts/src/rules/S4507/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4524/generated-meta.ts new file mode 100644 index 00000000000..5e0d7c7ca2d --- /dev/null +++ b/packages/jsts/src/rules/S4524/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4619/generated-meta.ts new file mode 100644 index 00000000000..80537d0c6d8 --- /dev/null +++ b/packages/jsts/src/rules/S4619/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4621/generated-meta.ts new file mode 100644 index 00000000000..093b9e632e5 --- /dev/null +++ b/packages/jsts/src/rules/S4621/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4622/generated-meta.ts new file mode 100644 index 00000000000..04fdd4f5d3f --- /dev/null +++ b/packages/jsts/src/rules/S4622/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S4623/generated-meta.ts new file mode 100644 index 00000000000..d0a3181ca6d --- /dev/null +++ b/packages/jsts/src/rules/S4623/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4624/generated-meta.ts new file mode 100644 index 00000000000..c6ef3e4dc28 --- /dev/null +++ b/packages/jsts/src/rules/S4624/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4634/generated-meta.ts new file mode 100644 index 00000000000..daf48c10bc9 --- /dev/null +++ b/packages/jsts/src/rules/S4634/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4721/generated-meta.ts new file mode 100644 index 00000000000..c451d35c951 --- /dev/null +++ b/packages/jsts/src/rules/S4721/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4782/generated-meta.ts new file mode 100644 index 00000000000..cd34f0156a0 --- /dev/null +++ b/packages/jsts/src/rules/S4782/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4784/generated-meta.ts new file mode 100644 index 00000000000..25246e4a42a --- /dev/null +++ b/packages/jsts/src/rules/S4784/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4787/generated-meta.ts new file mode 100644 index 00000000000..28d3258fa24 --- /dev/null +++ b/packages/jsts/src/rules/S4787/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4790/generated-meta.ts new file mode 100644 index 00000000000..80ea7303bd9 --- /dev/null +++ b/packages/jsts/src/rules/S4790/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4798/generated-meta.ts new file mode 100644 index 00000000000..1c74291e158 --- /dev/null +++ b/packages/jsts/src/rules/S4798/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4817/generated-meta.ts new file mode 100644 index 00000000000..3515942d315 --- /dev/null +++ b/packages/jsts/src/rules/S4817/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4818/generated-meta.ts new file mode 100644 index 00000000000..16ed68a8971 --- /dev/null +++ b/packages/jsts/src/rules/S4818/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4822/generated-meta.ts new file mode 100644 index 00000000000..84c449caa27 --- /dev/null +++ b/packages/jsts/src/rules/S4822/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4823/generated-meta.ts new file mode 100644 index 00000000000..4e741efae5e --- /dev/null +++ b/packages/jsts/src/rules/S4823/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4829/generated-meta.ts new file mode 100644 index 00000000000..18299f3e793 --- /dev/null +++ b/packages/jsts/src/rules/S4829/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S4830/generated-meta.ts new file mode 100644 index 00000000000..8bdcf2f7689 --- /dev/null +++ b/packages/jsts/src/rules/S4830/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5042/generated-meta.ts new file mode 100644 index 00000000000..03e3bad46b2 --- /dev/null +++ b/packages/jsts/src/rules/S5042/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5122/generated-meta.ts new file mode 100644 index 00000000000..8ec7e3c3ec8 --- /dev/null +++ b/packages/jsts/src/rules/S5122/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5148/generated-meta.ts new file mode 100644 index 00000000000..27bc5a23ced --- /dev/null +++ b/packages/jsts/src/rules/S5148/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5247/generated-meta.ts new file mode 100644 index 00000000000..a758be2aa8c --- /dev/null +++ b/packages/jsts/src/rules/S5247/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5254/generated-meta.ts new file mode 100644 index 00000000000..2e5b6af1775 --- /dev/null +++ b/packages/jsts/src/rules/S5254/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5256/generated-meta.ts new file mode 100644 index 00000000000..1afdd7e3cce --- /dev/null +++ b/packages/jsts/src/rules/S5256/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5257/generated-meta.ts new file mode 100644 index 00000000000..1032f9c1008 --- /dev/null +++ b/packages/jsts/src/rules/S5257/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5260/generated-meta.ts new file mode 100644 index 00000000000..60b1a8c94c7 --- /dev/null +++ b/packages/jsts/src/rules/S5260/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5264/generated-meta.ts new file mode 100644 index 00000000000..6e67b2d060f --- /dev/null +++ b/packages/jsts/src/rules/S5264/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5332/generated-meta.ts new file mode 100644 index 00000000000..f8f74eda448 --- /dev/null +++ b/packages/jsts/src/rules/S5332/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5443/generated-meta.ts new file mode 100644 index 00000000000..6c1e483b169 --- /dev/null +++ b/packages/jsts/src/rules/S5443/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5527/generated-meta.ts new file mode 100644 index 00000000000..06da9bcdd36 --- /dev/null +++ b/packages/jsts/src/rules/S5527/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5542/generated-meta.ts new file mode 100644 index 00000000000..b77d3893e50 --- /dev/null +++ b/packages/jsts/src/rules/S5542/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5547/generated-meta.ts new file mode 100644 index 00000000000..d979361de9a --- /dev/null +++ b/packages/jsts/src/rules/S5547/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5604/generated-meta.ts new file mode 100644 index 00000000000..204f5539ecd --- /dev/null +++ b/packages/jsts/src/rules/S5604/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S5659/generated-meta.ts new file mode 100644 index 00000000000..3d222cff816 --- /dev/null +++ b/packages/jsts/src/rules/S5659/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5689/generated-meta.ts new file mode 100644 index 00000000000..907d3f57911 --- /dev/null +++ b/packages/jsts/src/rules/S5689/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5691/generated-meta.ts new file mode 100644 index 00000000000..1e93a104738 --- /dev/null +++ b/packages/jsts/src/rules/S5691/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5693/generated-meta.ts new file mode 100644 index 00000000000..0867c3c4d7c --- /dev/null +++ b/packages/jsts/src/rules/S5693/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S5725/generated-meta.ts new file mode 100644 index 00000000000..5a65a923a93 --- /dev/null +++ b/packages/jsts/src/rules/S5725/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5728/generated-meta.ts new file mode 100644 index 00000000000..efd66ba2ab6 --- /dev/null +++ b/packages/jsts/src/rules/S5728/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5730/generated-meta.ts new file mode 100644 index 00000000000..56974619bed --- /dev/null +++ b/packages/jsts/src/rules/S5730/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5732/generated-meta.ts new file mode 100644 index 00000000000..755804ace0f --- /dev/null +++ b/packages/jsts/src/rules/S5732/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5734/generated-meta.ts new file mode 100644 index 00000000000..17d4a38a8b0 --- /dev/null +++ b/packages/jsts/src/rules/S5734/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5736/generated-meta.ts new file mode 100644 index 00000000000..c31b946a256 --- /dev/null +++ b/packages/jsts/src/rules/S5736/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5739/generated-meta.ts new file mode 100644 index 00000000000..978104b8448 --- /dev/null +++ b/packages/jsts/src/rules/S5739/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5742/generated-meta.ts new file mode 100644 index 00000000000..ebc3920d346 --- /dev/null +++ b/packages/jsts/src/rules/S5742/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5743/generated-meta.ts new file mode 100644 index 00000000000..77d543c7525 --- /dev/null +++ b/packages/jsts/src/rules/S5743/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5757/generated-meta.ts new file mode 100644 index 00000000000..9549b89e0d4 --- /dev/null +++ b/packages/jsts/src/rules/S5757/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5759/generated-meta.ts new file mode 100644 index 00000000000..14431b77d9e --- /dev/null +++ b/packages/jsts/src/rules/S5759/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5842/generated-meta.ts new file mode 100644 index 00000000000..d4963559b34 --- /dev/null +++ b/packages/jsts/src/rules/S5842/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5843/generated-meta.ts new file mode 100644 index 00000000000..15197ab20a1 --- /dev/null +++ b/packages/jsts/src/rules/S5843/generated-meta.ts @@ -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/ + */ + +// 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; 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/generated-meta.ts b/packages/jsts/src/rules/S5850/generated-meta.ts new file mode 100644 index 00000000000..1342f57fa3b --- /dev/null +++ b/packages/jsts/src/rules/S5850/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5852/generated-meta.ts new file mode 100644 index 00000000000..3860796743b --- /dev/null +++ b/packages/jsts/src/rules/S5852/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5856/generated-meta.ts new file mode 100644 index 00000000000..da5b2d347ab --- /dev/null +++ b/packages/jsts/src/rules/S5856/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5860/generated-meta.ts new file mode 100644 index 00000000000..43c3bd17932 --- /dev/null +++ b/packages/jsts/src/rules/S5860/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5863/generated-meta.ts new file mode 100644 index 00000000000..a1e67462065 --- /dev/null +++ b/packages/jsts/src/rules/S5863/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5867/generated-meta.ts new file mode 100644 index 00000000000..536b836f2db --- /dev/null +++ b/packages/jsts/src/rules/S5867/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5868/generated-meta.ts new file mode 100644 index 00000000000..0657aaba200 --- /dev/null +++ b/packages/jsts/src/rules/S5868/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5869/generated-meta.ts new file mode 100644 index 00000000000..2e54cf71745 --- /dev/null +++ b/packages/jsts/src/rules/S5869/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5876/generated-meta.ts new file mode 100644 index 00000000000..9c790982b0d --- /dev/null +++ b/packages/jsts/src/rules/S5876/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5958/generated-meta.ts new file mode 100644 index 00000000000..9810e833691 --- /dev/null +++ b/packages/jsts/src/rules/S5958/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S5973/generated-meta.ts new file mode 100644 index 00000000000..d5de03e678c --- /dev/null +++ b/packages/jsts/src/rules/S5973/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6019/generated-meta.ts new file mode 100644 index 00000000000..9d7d0cd40b5 --- /dev/null +++ b/packages/jsts/src/rules/S6019/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6035/generated-meta.ts new file mode 100644 index 00000000000..d2a5b0dbe2d --- /dev/null +++ b/packages/jsts/src/rules/S6035/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6079/generated-meta.ts new file mode 100644 index 00000000000..9e0df716d88 --- /dev/null +++ b/packages/jsts/src/rules/S6079/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6080/generated-meta.ts new file mode 100644 index 00000000000..a458b490d25 --- /dev/null +++ b/packages/jsts/src/rules/S6080/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6092/generated-meta.ts new file mode 100644 index 00000000000..d718773a932 --- /dev/null +++ b/packages/jsts/src/rules/S6092/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6245/generated-meta.ts new file mode 100644 index 00000000000..1103ee0dd67 --- /dev/null +++ b/packages/jsts/src/rules/S6245/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6249/generated-meta.ts new file mode 100644 index 00000000000..f17d45d28dd --- /dev/null +++ b/packages/jsts/src/rules/S6249/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6252/generated-meta.ts new file mode 100644 index 00000000000..688a711dd98 --- /dev/null +++ b/packages/jsts/src/rules/S6252/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6265/generated-meta.ts new file mode 100644 index 00000000000..1a1076b53a4 --- /dev/null +++ b/packages/jsts/src/rules/S6265/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6268/generated-meta.ts new file mode 100644 index 00000000000..c8a313f0029 --- /dev/null +++ b/packages/jsts/src/rules/S6268/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6270/generated-meta.ts new file mode 100644 index 00000000000..0f74d58ed1a --- /dev/null +++ b/packages/jsts/src/rules/S6270/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6275/generated-meta.ts new file mode 100644 index 00000000000..7fe1ee11a91 --- /dev/null +++ b/packages/jsts/src/rules/S6275/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6281/generated-meta.ts new file mode 100644 index 00000000000..56b13a0a32f --- /dev/null +++ b/packages/jsts/src/rules/S6281/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6299/generated-meta.ts new file mode 100644 index 00000000000..a8e7c60d503 --- /dev/null +++ b/packages/jsts/src/rules/S6299/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6302/generated-meta.ts new file mode 100644 index 00000000000..9a889477071 --- /dev/null +++ b/packages/jsts/src/rules/S6302/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6303/generated-meta.ts new file mode 100644 index 00000000000..00eddcfbd6d --- /dev/null +++ b/packages/jsts/src/rules/S6303/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6304/generated-meta.ts new file mode 100644 index 00000000000..b966c028afc --- /dev/null +++ b/packages/jsts/src/rules/S6304/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6308/generated-meta.ts new file mode 100644 index 00000000000..5e7f4a2fbbf --- /dev/null +++ b/packages/jsts/src/rules/S6308/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6317/generated-meta.ts new file mode 100644 index 00000000000..31fd74449c8 --- /dev/null +++ b/packages/jsts/src/rules/S6317/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6319/generated-meta.ts new file mode 100644 index 00000000000..13997b6978a --- /dev/null +++ b/packages/jsts/src/rules/S6319/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6321/generated-meta.ts new file mode 100644 index 00000000000..0915b13662f --- /dev/null +++ b/packages/jsts/src/rules/S6321/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6323/generated-meta.ts new file mode 100644 index 00000000000..8edb83bd6e3 --- /dev/null +++ b/packages/jsts/src/rules/S6323/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6324/generated-meta.ts new file mode 100644 index 00000000000..fb93374c872 --- /dev/null +++ b/packages/jsts/src/rules/S6324/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6325/generated-meta.ts new file mode 100644 index 00000000000..b1381e8dde6 --- /dev/null +++ b/packages/jsts/src/rules/S6325/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Regular expression literals should be used when possible', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6325/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S6325'; 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/generated-meta.ts b/packages/jsts/src/rules/S6326/generated-meta.ts new file mode 100644 index 00000000000..a125071c19c --- /dev/null +++ b/packages/jsts/src/rules/S6326/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6327/generated-meta.ts new file mode 100644 index 00000000000..410c5a10682 --- /dev/null +++ b/packages/jsts/src/rules/S6327/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6328/generated-meta.ts new file mode 100644 index 00000000000..63836335712 --- /dev/null +++ b/packages/jsts/src/rules/S6328/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6329/generated-meta.ts new file mode 100644 index 00000000000..bde50dd246b --- /dev/null +++ b/packages/jsts/src/rules/S6329/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6330/generated-meta.ts new file mode 100644 index 00000000000..de30956c576 --- /dev/null +++ b/packages/jsts/src/rules/S6330/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6331/generated-meta.ts new file mode 100644 index 00000000000..1ad87e23720 --- /dev/null +++ b/packages/jsts/src/rules/S6331/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6332/generated-meta.ts new file mode 100644 index 00000000000..b8864eaa2c7 --- /dev/null +++ b/packages/jsts/src/rules/S6332/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6333/generated-meta.ts new file mode 100644 index 00000000000..da2b94532fc --- /dev/null +++ b/packages/jsts/src/rules/S6333/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6351/generated-meta.ts new file mode 100644 index 00000000000..6dcdce5994d --- /dev/null +++ b/packages/jsts/src/rules/S6351/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6353/generated-meta.ts new file mode 100644 index 00000000000..4b6def7f611 --- /dev/null +++ b/packages/jsts/src/rules/S6353/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6397/generated-meta.ts new file mode 100644 index 00000000000..eb67e896bb0 --- /dev/null +++ b/packages/jsts/src/rules/S6397/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6418/generated-meta.ts new file mode 100644 index 00000000000..b0061bec0c7 --- /dev/null +++ b/packages/jsts/src/rules/S6418/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6426/generated-meta.ts new file mode 100644 index 00000000000..b720a82c736 --- /dev/null +++ b/packages/jsts/src/rules/S6426/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6435/generated-meta.ts new file mode 100644 index 00000000000..cc06f4c5798 --- /dev/null +++ b/packages/jsts/src/rules/S6435/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 "render" functions should return a value', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6435/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6435'; 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/generated-meta.ts b/packages/jsts/src/rules/S6438/generated-meta.ts new file mode 100644 index 00000000000..3e1e763b04d --- /dev/null +++ b/packages/jsts/src/rules/S6438/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Comments inside JSX expressions should be enclosed in curly braces', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6438/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6438'; 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/generated-meta.ts b/packages/jsts/src/rules/S6439/generated-meta.ts new file mode 100644 index 00000000000..a88056e9d2b --- /dev/null +++ b/packages/jsts/src/rules/S6439/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6440/generated-meta.ts new file mode 100644 index 00000000000..241e5925144 --- /dev/null +++ b/packages/jsts/src/rules/S6440/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6441/generated-meta.ts new file mode 100644 index 00000000000..f558285cc2a --- /dev/null +++ b/packages/jsts/src/rules/S6441/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6442/generated-meta.ts new file mode 100644 index 00000000000..7e6b55f614f --- /dev/null +++ b/packages/jsts/src/rules/S6442/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6443/generated-meta.ts new file mode 100644 index 00000000000..b9f1fb559c3 --- /dev/null +++ b/packages/jsts/src/rules/S6443/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6477/generated-meta.ts new file mode 100644 index 00000000000..5d2951028ff --- /dev/null +++ b/packages/jsts/src/rules/S6477/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6478/generated-meta.ts new file mode 100644 index 00000000000..5898e06b6f4 --- /dev/null +++ b/packages/jsts/src/rules/S6478/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6479/generated-meta.ts new file mode 100644 index 00000000000..98dc39d8de7 --- /dev/null +++ b/packages/jsts/src/rules/S6479/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6480/generated-meta.ts new file mode 100644 index 00000000000..1f21fd1c13f --- /dev/null +++ b/packages/jsts/src/rules/S6480/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Disallow `.bind()` and arrow functions in JSX props', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6480/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6480'; 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/generated-meta.ts b/packages/jsts/src/rules/S6481/generated-meta.ts new file mode 100644 index 00000000000..b86966ca866 --- /dev/null +++ b/packages/jsts/src/rules/S6481/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6486/generated-meta.ts new file mode 100644 index 00000000000..7a4639ae931 --- /dev/null +++ b/packages/jsts/src/rules/S6486/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6509/generated-meta.ts new file mode 100644 index 00000000000..3c72e049476 --- /dev/null +++ b/packages/jsts/src/rules/S6509/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Extra boolean casts should be removed', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6509/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S6509'; 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/generated-meta.ts b/packages/jsts/src/rules/S6522/generated-meta.ts new file mode 100644 index 00000000000..4add0f27aba --- /dev/null +++ b/packages/jsts/src/rules/S6522/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 variables should not be reassigned', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6522/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6522'; 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/generated-meta.ts b/packages/jsts/src/rules/S6523/generated-meta.ts new file mode 100644 index 00000000000..9e43711db04 --- /dev/null +++ b/packages/jsts/src/rules/S6523/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Optional chaining should not be used if returning "undefined" throws an error', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6523/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6523'; 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/generated-meta.ts b/packages/jsts/src/rules/S6534/generated-meta.ts new file mode 100644 index 00000000000..cda8ba7a94e --- /dev/null +++ b/packages/jsts/src/rules/S6534/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Numbers should not lose precision', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6534/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6534'; 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/generated-meta.ts b/packages/jsts/src/rules/S6535/generated-meta.ts new file mode 100644 index 00000000000..9689576ee8c --- /dev/null +++ b/packages/jsts/src/rules/S6535/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6544/generated-meta.ts new file mode 100644 index 00000000000..506e64cc737 --- /dev/null +++ b/packages/jsts/src/rules/S6544/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6550/generated-meta.ts new file mode 100644 index 00000000000..f06ed2cb288 --- /dev/null +++ b/packages/jsts/src/rules/S6550/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'All enum members should be literals', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6550/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6550'; 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/generated-meta.ts b/packages/jsts/src/rules/S6551/generated-meta.ts new file mode 100644 index 00000000000..ce007ecfc10 --- /dev/null +++ b/packages/jsts/src/rules/S6551/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6557/generated-meta.ts new file mode 100644 index 00000000000..23d60306fbc --- /dev/null +++ b/packages/jsts/src/rules/S6557/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6564/generated-meta.ts new file mode 100644 index 00000000000..3bf6184e7db --- /dev/null +++ b/packages/jsts/src/rules/S6564/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6565/generated-meta.ts new file mode 100644 index 00000000000..16907bae732 --- /dev/null +++ b/packages/jsts/src/rules/S6565/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Prefer the return type "this" in fluent interfaces', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6565/javascript', + requiresTypeChecking: true, + }, + fixable: 'code', +}; + +export const sonarKey = 'S6565'; 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/generated-meta.ts b/packages/jsts/src/rules/S6568/generated-meta.ts new file mode 100644 index 00000000000..67efa2ec723 --- /dev/null +++ b/packages/jsts/src/rules/S6568/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Non-null assertions should not be used misleadingly', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6568/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S6568'; 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/generated-meta.ts b/packages/jsts/src/rules/S6569/generated-meta.ts new file mode 100644 index 00000000000..8be65e550e5 --- /dev/null +++ b/packages/jsts/src/rules/S6569/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Unnecessary type constraints should be removed', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6569/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S6569'; 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/generated-meta.ts b/packages/jsts/src/rules/S6571/generated-meta.ts new file mode 100644 index 00000000000..d1ee333fde3 --- /dev/null +++ b/packages/jsts/src/rules/S6571/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6572/generated-meta.ts new file mode 100644 index 00000000000..5f80f846b36 --- /dev/null +++ b/packages/jsts/src/rules/S6572/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6578/generated-meta.ts new file mode 100644 index 00000000000..508c840b30e --- /dev/null +++ b/packages/jsts/src/rules/S6578/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 values should be unique', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6578/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6578'; 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/generated-meta.ts b/packages/jsts/src/rules/S6582/generated-meta.ts new file mode 100644 index 00000000000..fff5b7afa36 --- /dev/null +++ b/packages/jsts/src/rules/S6582/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6583/generated-meta.ts new file mode 100644 index 00000000000..bb216b5380e --- /dev/null +++ b/packages/jsts/src/rules/S6583/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 members should not mix value types', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6583/javascript', + requiresTypeChecking: true, + }, +}; + +export const sonarKey = 'S6583'; 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/generated-meta.ts b/packages/jsts/src/rules/S6590/generated-meta.ts new file mode 100644 index 00000000000..87d7e0eb961 --- /dev/null +++ b/packages/jsts/src/rules/S6590/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: '"as const" assertions should be preferred', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6590/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S6590'; 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/generated-meta.ts b/packages/jsts/src/rules/S6594/generated-meta.ts new file mode 100644 index 00000000000..30932365f0a --- /dev/null +++ b/packages/jsts/src/rules/S6594/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6598/generated-meta.ts new file mode 100644 index 00000000000..517d207ae39 --- /dev/null +++ b/packages/jsts/src/rules/S6598/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6606/generated-meta.ts new file mode 100644 index 00000000000..126a7a7b5cc --- /dev/null +++ b/packages/jsts/src/rules/S6606/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6627/generated-meta.ts new file mode 100644 index 00000000000..580b017a6c8 --- /dev/null +++ b/packages/jsts/src/rules/S6627/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6635/generated-meta.ts new file mode 100644 index 00000000000..9dc5f0e2c0e --- /dev/null +++ b/packages/jsts/src/rules/S6635/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 return values', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6635/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6635'; 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/generated-meta.ts b/packages/jsts/src/rules/S6637/generated-meta.ts new file mode 100644 index 00000000000..2f2c5d70eb5 --- /dev/null +++ b/packages/jsts/src/rules/S6637/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Unnecessary calls to ".bind()" should not be used', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6637/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S6637'; 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/generated-meta.ts b/packages/jsts/src/rules/S6638/generated-meta.ts new file mode 100644 index 00000000000..bcd2b7c181f --- /dev/null +++ b/packages/jsts/src/rules/S6638/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Binary expressions should not always return the same value', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6638/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6638'; 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/generated-meta.ts b/packages/jsts/src/rules/S6643/generated-meta.ts new file mode 100644 index 00000000000..97ef2aa4dbf --- /dev/null +++ b/packages/jsts/src/rules/S6643/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6644/generated-meta.ts new file mode 100644 index 00000000000..750d569acbf --- /dev/null +++ b/packages/jsts/src/rules/S6644/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Ternary operator should not be used instead of simpler alternatives', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6644/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S6644'; 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/generated-meta.ts b/packages/jsts/src/rules/S6645/generated-meta.ts new file mode 100644 index 00000000000..345a8de4a1c --- /dev/null +++ b/packages/jsts/src/rules/S6645/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Variables should not be initialized to undefined', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6645/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S6645'; 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/generated-meta.ts b/packages/jsts/src/rules/S6647/generated-meta.ts new file mode 100644 index 00000000000..a123778fb6c --- /dev/null +++ b/packages/jsts/src/rules/S6647/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6650/generated-meta.ts new file mode 100644 index 00000000000..c34fec1c315 --- /dev/null +++ b/packages/jsts/src/rules/S6650/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: + 'Renaming import, export, and destructuring assignments should not be to the same name', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6650/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S6650'; 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/generated-meta.ts b/packages/jsts/src/rules/S6653/generated-meta.ts new file mode 100644 index 00000000000..1c66cdf60c3 --- /dev/null +++ b/packages/jsts/src/rules/S6653/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Use Object.hasOwn static method instead of hasOwnProperty', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6653/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S6653'; 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/generated-meta.ts b/packages/jsts/src/rules/S6654/generated-meta.ts new file mode 100644 index 00000000000..1a12292e887 --- /dev/null +++ b/packages/jsts/src/rules/S6654/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: '__proto__ property should not be used', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6654/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6654'; 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/generated-meta.ts b/packages/jsts/src/rules/S6657/generated-meta.ts new file mode 100644 index 00000000000..6da94099b49 --- /dev/null +++ b/packages/jsts/src/rules/S6657/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Octal escape sequences should not be used', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6657/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6657'; 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/generated-meta.ts b/packages/jsts/src/rules/S6660/generated-meta.ts new file mode 100644 index 00000000000..e5b55dad935 --- /dev/null +++ b/packages/jsts/src/rules/S6660/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6661/generated-meta.ts new file mode 100644 index 00000000000..353b2c035a1 --- /dev/null +++ b/packages/jsts/src/rules/S6661/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6666/generated-meta.ts new file mode 100644 index 00000000000..5b8d6125a14 --- /dev/null +++ b/packages/jsts/src/rules/S6666/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6671/generated-meta.ts new file mode 100644 index 00000000000..1bd6fb6b907 --- /dev/null +++ b/packages/jsts/src/rules/S6671/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 used for promise rejection', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6671/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6671'; 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/generated-meta.ts b/packages/jsts/src/rules/S6676/generated-meta.ts new file mode 100644 index 00000000000..a112cd5bc6d --- /dev/null +++ b/packages/jsts/src/rules/S6676/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6679/generated-meta.ts new file mode 100644 index 00000000000..cc65a238324 --- /dev/null +++ b/packages/jsts/src/rules/S6679/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6746/generated-meta.ts new file mode 100644 index 00000000000..cc6d5d33eb4 --- /dev/null +++ b/packages/jsts/src/rules/S6746/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 React "this.state" should not be mutated directly', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6746/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6746'; 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/generated-meta.ts b/packages/jsts/src/rules/S6747/generated-meta.ts new file mode 100644 index 00000000000..17d3a585272 --- /dev/null +++ b/packages/jsts/src/rules/S6747/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6748/generated-meta.ts new file mode 100644 index 00000000000..fbb9d94c973 --- /dev/null +++ b/packages/jsts/src/rules/S6748/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 "children" should not be passed as prop', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6748/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6748'; 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/generated-meta.ts b/packages/jsts/src/rules/S6749/generated-meta.ts new file mode 100644 index 00000000000..0e20f64c61c --- /dev/null +++ b/packages/jsts/src/rules/S6749/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6750/generated-meta.ts new file mode 100644 index 00000000000..cf559db4f70 --- /dev/null +++ b/packages/jsts/src/rules/S6750/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 "ReactDOM.render" should not be used', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6750/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6750'; 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/generated-meta.ts b/packages/jsts/src/rules/S6754/generated-meta.ts new file mode 100644 index 00000000000..6bcf1b19b22 --- /dev/null +++ b/packages/jsts/src/rules/S6754/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6756/generated-meta.ts new file mode 100644 index 00000000000..214b9467f2e --- /dev/null +++ b/packages/jsts/src/rules/S6756/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: '"setState" should use a callback when referencing the previous state', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6756/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6756'; 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/generated-meta.ts b/packages/jsts/src/rules/S6757/generated-meta.ts new file mode 100644 index 00000000000..83ee8799f02 --- /dev/null +++ b/packages/jsts/src/rules/S6757/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: '"this" should not be used in functional components', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6757/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6757'; 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/generated-meta.ts b/packages/jsts/src/rules/S6759/generated-meta.ts new file mode 100644 index 00000000000..cf711a1d815 --- /dev/null +++ b/packages/jsts/src/rules/S6759/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6761/generated-meta.ts new file mode 100644 index 00000000000..eda8e689bba --- /dev/null +++ b/packages/jsts/src/rules/S6761/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: '"children" and "dangerouslySetInnerHTML" should not be used together', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6761/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6761'; 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/generated-meta.ts b/packages/jsts/src/rules/S6763/generated-meta.ts new file mode 100644 index 00000000000..36391777adb --- /dev/null +++ b/packages/jsts/src/rules/S6763/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: + '"shouldComponentUpdate" should not be defined when extending "React.PureComponent"', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6763/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6763'; 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/generated-meta.ts b/packages/jsts/src/rules/S6766/generated-meta.ts new file mode 100644 index 00000000000..748ce5a00fb --- /dev/null +++ b/packages/jsts/src/rules/S6766/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 special characters should be escaped', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6766/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6766'; 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/generated-meta.ts b/packages/jsts/src/rules/S6767/generated-meta.ts new file mode 100644 index 00000000000..f7854b74192 --- /dev/null +++ b/packages/jsts/src/rules/S6767/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 React typed props should be removed', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6767/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6767'; 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/generated-meta.ts b/packages/jsts/src/rules/S6770/generated-meta.ts new file mode 100644 index 00000000000..ece9d3a9728 --- /dev/null +++ b/packages/jsts/src/rules/S6770/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'User-defined JSX components should use Pascal case', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6770/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6770'; 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/generated-meta.ts b/packages/jsts/src/rules/S6772/generated-meta.ts new file mode 100644 index 00000000000..9775551533a --- /dev/null +++ b/packages/jsts/src/rules/S6772/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Spacing between inline elements should be explicit', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6772/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6772'; 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/generated-meta.ts b/packages/jsts/src/rules/S6774/generated-meta.ts new file mode 100644 index 00000000000..e01ab81b9e0 --- /dev/null +++ b/packages/jsts/src/rules/S6774/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 validate prop types', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6774/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6774'; 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/generated-meta.ts b/packages/jsts/src/rules/S6775/generated-meta.ts new file mode 100644 index 00000000000..21383680307 --- /dev/null +++ b/packages/jsts/src/rules/S6775/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'All "defaultProps" should have non-required PropTypes', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6775/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6775'; 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/generated-meta.ts b/packages/jsts/src/rules/S6788/generated-meta.ts new file mode 100644 index 00000000000..ff009e85192 --- /dev/null +++ b/packages/jsts/src/rules/S6788/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6789/generated-meta.ts new file mode 100644 index 00000000000..49a3c301c4b --- /dev/null +++ b/packages/jsts/src/rules/S6789/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 "isMounted" should not be used', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6789/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6789'; 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/generated-meta.ts b/packages/jsts/src/rules/S6790/generated-meta.ts new file mode 100644 index 00000000000..a2bf0e73ae7 --- /dev/null +++ b/packages/jsts/src/rules/S6790/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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 references should not be used', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6790/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6790'; 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/generated-meta.ts b/packages/jsts/src/rules/S6791/generated-meta.ts new file mode 100644 index 00000000000..c67f11ec0c4 --- /dev/null +++ b/packages/jsts/src/rules/S6791/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6793/generated-meta.ts new file mode 100644 index 00000000000..97b441ab9b5 --- /dev/null +++ b/packages/jsts/src/rules/S6793/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'ARIA properties in DOM elements should have valid values', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6793/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6793'; 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/generated-meta.ts b/packages/jsts/src/rules/S6807/generated-meta.ts new file mode 100644 index 00000000000..476bfa9b078 --- /dev/null +++ b/packages/jsts/src/rules/S6807/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'DOM elements with ARIA roles should have the required properties', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6807/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6807'; 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/generated-meta.ts b/packages/jsts/src/rules/S6811/generated-meta.ts new file mode 100644 index 00000000000..3cb33127bf7 --- /dev/null +++ b/packages/jsts/src/rules/S6811/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'DOM elements with ARIA role should only have supported properties', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6811/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6811'; 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/generated-meta.ts b/packages/jsts/src/rules/S6819/generated-meta.ts new file mode 100644 index 00000000000..05be3a9c4df --- /dev/null +++ b/packages/jsts/src/rules/S6819/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Prefer tag over ARIA role', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6819/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6819'; 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/generated-meta.ts b/packages/jsts/src/rules/S6821/generated-meta.ts new file mode 100644 index 00000000000..3a32efd4500 --- /dev/null +++ b/packages/jsts/src/rules/S6821/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'DOM elements with ARIA roles should have a valid non-abstract role', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6821/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6821'; 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/generated-meta.ts b/packages/jsts/src/rules/S6822/generated-meta.ts new file mode 100644 index 00000000000..6aedb799b17 --- /dev/null +++ b/packages/jsts/src/rules/S6822/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'No redundant ARIA role', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6822/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6822'; 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/generated-meta.ts b/packages/jsts/src/rules/S6823/generated-meta.ts new file mode 100644 index 00000000000..cfdb4621d80 --- /dev/null +++ b/packages/jsts/src/rules/S6823/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: + 'DOM elements with the `aria-activedescendant` property should be accessible via the tab key', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6823/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6823'; diff --git a/packages/jsts/src/rules/core/index.ts b/packages/jsts/src/rules/S6823/index.ts similarity index 65% rename from packages/jsts/src/rules/core/index.ts rename to packages/jsts/src/rules/S6823/index.ts index 8764704f215..5b5ab1264ac 100644 --- a/packages/jsts/src/rules/core/index.ts +++ b/packages/jsts/src/rules/S6823/index.ts @@ -14,12 +14,5 @@ * 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()); +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/generated-meta.ts b/packages/jsts/src/rules/S6824/generated-meta.ts new file mode 100644 index 00000000000..3fd7a37b630 --- /dev/null +++ b/packages/jsts/src/rules/S6824/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'No ARIA role or property for unsupported DOM elements', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6824/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6824'; 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/generated-meta.ts b/packages/jsts/src/rules/S6825/generated-meta.ts new file mode 100644 index 00000000000..032cd0b0aa6 --- /dev/null +++ b/packages/jsts/src/rules/S6825/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Focusable elements should not have "aria-hidden" attribute', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6825/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6825'; 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/generated-meta.ts b/packages/jsts/src/rules/S6827/generated-meta.ts new file mode 100644 index 00000000000..c61fb01c542 --- /dev/null +++ b/packages/jsts/src/rules/S6827/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6836/generated-meta.ts new file mode 100644 index 00000000000..72701c63c5a --- /dev/null +++ b/packages/jsts/src/rules/S6836/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: '"case" and "default" clauses should not contain lexical declarations', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6836/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6836'; 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/generated-meta.ts b/packages/jsts/src/rules/S6840/generated-meta.ts new file mode 100644 index 00000000000..5ff3f2194a6 --- /dev/null +++ b/packages/jsts/src/rules/S6840/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'DOM elements should use the "autocomplete" attribute correctly', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6840/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6840'; 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/generated-meta.ts b/packages/jsts/src/rules/S6841/generated-meta.ts new file mode 100644 index 00000000000..05b9acf03fa --- /dev/null +++ b/packages/jsts/src/rules/S6841/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: '"tabIndex" values should be 0 or -1', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6841/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6841'; 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/generated-meta.ts b/packages/jsts/src/rules/S6842/generated-meta.ts new file mode 100644 index 00000000000..3df04ed424d --- /dev/null +++ b/packages/jsts/src/rules/S6842/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Non-interactive DOM elements should not have interactive ARIA roles', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6842/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6842'; 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/generated-meta.ts b/packages/jsts/src/rules/S6843/generated-meta.ts new file mode 100644 index 00000000000..a2757406615 --- /dev/null +++ b/packages/jsts/src/rules/S6843/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Interactive DOM elements should not have non-interactive ARIA roles', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6843/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6843'; 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/generated-meta.ts b/packages/jsts/src/rules/S6844/generated-meta.ts new file mode 100644 index 00000000000..62608ffdaa0 --- /dev/null +++ b/packages/jsts/src/rules/S6844/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6845/generated-meta.ts new file mode 100644 index 00000000000..fa56c0ad242 --- /dev/null +++ b/packages/jsts/src/rules/S6845/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Non-interactive DOM elements should not have the `tabIndex` property', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6845/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6845'; 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/generated-meta.ts b/packages/jsts/src/rules/S6846/generated-meta.ts new file mode 100644 index 00000000000..da599c1b0e5 --- /dev/null +++ b/packages/jsts/src/rules/S6846/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'DOM elements should not use the "accesskey" property', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6846/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6846'; 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/generated-meta.ts b/packages/jsts/src/rules/S6847/generated-meta.ts new file mode 100644 index 00000000000..7ae140cc746 --- /dev/null +++ b/packages/jsts/src/rules/S6847/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: "Non-interactive elements shouldn't have event handlers", + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6847/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6847'; 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/generated-meta.ts b/packages/jsts/src/rules/S6848/generated-meta.ts new file mode 100644 index 00000000000..39321da3277 --- /dev/null +++ b/packages/jsts/src/rules/S6848/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Non-interactive DOM elements should not have an interactive handler', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6848/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6848'; 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/generated-meta.ts b/packages/jsts/src/rules/S6850/generated-meta.ts new file mode 100644 index 00000000000..a5bf5dbff76 --- /dev/null +++ b/packages/jsts/src/rules/S6850/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Heading elements should have accessible content', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6850/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6850'; 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/generated-meta.ts b/packages/jsts/src/rules/S6851/generated-meta.ts new file mode 100644 index 00000000000..1ba36937632 --- /dev/null +++ b/packages/jsts/src/rules/S6851/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Images should have a non-redundant alternate description', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6851/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6851'; 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/generated-meta.ts b/packages/jsts/src/rules/S6852/generated-meta.ts new file mode 100644 index 00000000000..a8331920f8c --- /dev/null +++ b/packages/jsts/src/rules/S6852/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Elements with an interactive role should support focus', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6852/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6852'; 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/generated-meta.ts b/packages/jsts/src/rules/S6853/generated-meta.ts new file mode 100644 index 00000000000..ddc5e1cfe7c --- /dev/null +++ b/packages/jsts/src/rules/S6853/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6859/generated-meta.ts new file mode 100644 index 00000000000..73e44a2d7a1 --- /dev/null +++ b/packages/jsts/src/rules/S6859/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +export const meta = { + type: 'suggestion', + docs: { + description: 'Imports should not use absolute paths', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6859/javascript', + requiresTypeChecking: false, + }, + fixable: 'code', +}; + +export const sonarKey = 'S6859'; 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/generated-meta.ts b/packages/jsts/src/rules/S6861/generated-meta.ts new file mode 100644 index 00000000000..ddbebd483ea --- /dev/null +++ b/packages/jsts/src/rules/S6861/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Mutable variables should not be exported', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S6861/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S6861'; 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/generated-meta.ts b/packages/jsts/src/rules/S6957/generated-meta.ts new file mode 100644 index 00000000000..94b5159366f --- /dev/null +++ b/packages/jsts/src/rules/S6957/generated-meta.ts @@ -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/ + */ + +// DO NOT EDIT! This file is autogenerated by "npm run generate-meta" + +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; 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/generated-meta.ts b/packages/jsts/src/rules/S6958/generated-meta.ts new file mode 100644 index 00000000000..3c1b67dcffe --- /dev/null +++ b/packages/jsts/src/rules/S6958/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S6959/generated-meta.ts new file mode 100644 index 00000000000..3e64762d2c2 --- /dev/null +++ b/packages/jsts/src/rules/S6959/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S7059/generated-meta.ts new file mode 100644 index 00000000000..3dcbe0845d1 --- /dev/null +++ b/packages/jsts/src/rules/S7059/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S7060/generated-meta.ts new file mode 100644 index 00000000000..dd3b2a3c9b9 --- /dev/null +++ b/packages/jsts/src/rules/S7060/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S878/generated-meta.ts new file mode 100644 index 00000000000..0c707a1211e --- /dev/null +++ b/packages/jsts/src/rules/S878/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: 'Comma operator should not be used', + recommended: true, + url: 'https://sonarsource.github.io/rspec/#/rspec/S878/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S878'; 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/generated-meta.ts b/packages/jsts/src/rules/S881/generated-meta.ts new file mode 100644 index 00000000000..2318620ec18 --- /dev/null +++ b/packages/jsts/src/rules/S881/generated-meta.ts @@ -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/ + */ + +// 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S888/generated-meta.ts new file mode 100644 index 00000000000..67447bd0b75 --- /dev/null +++ b/packages/jsts/src/rules/S888/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S905/generated-meta.ts new file mode 100644 index 00000000000..faf57c1dbd2 --- /dev/null +++ b/packages/jsts/src/rules/S905/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/generated-meta.ts b/packages/jsts/src/rules/S909/generated-meta.ts new file mode 100644 index 00000000000..d25d54328cb --- /dev/null +++ b/packages/jsts/src/rules/S909/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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: '"continue" should not be used', + recommended: false, + url: 'https://sonarsource.github.io/rspec/#/rspec/S909/javascript', + requiresTypeChecking: false, + }, +}; + +export const sonarKey = 'S909'; 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/generated-meta.ts b/packages/jsts/src/rules/S930/generated-meta.ts new file mode 100644 index 00000000000..d8dfd542879 --- /dev/null +++ b/packages/jsts/src/rules/S930/generated-meta.ts @@ -0,0 +1,30 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; 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'; 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/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/typescript-eslint/index.ts b/packages/jsts/src/rules/external/typescript-eslint/index.ts similarity index 83% rename from packages/jsts/src/rules/typescript-eslint/index.ts rename to packages/jsts/src/rules/external/typescript-eslint/index.ts index cbe17211000..f1a1d5a4e4b 100644 --- a/packages/jsts/src/rules/typescript-eslint/index.ts +++ b/packages/jsts/src/rules/external/typescript-eslint/index.ts @@ -16,7 +16,7 @@ */ import type { Rule } from 'eslint'; import pkg from '@typescript-eslint/eslint-plugin'; -const { rules } = pkg; +const { rules: tsEslintRules } = pkg; import { sanitize } from './sanitize.js'; /** @@ -24,11 +24,11 @@ import { sanitize } from './sanitize.js'; * 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); +for (const ruleKey of Object.keys(tsEslintRules)) { + sanitized[ruleKey] = sanitize(tsEslintRules[ruleKey] as unknown as Rule.RuleModule); } /** * TypeScript ESLint rules. */ -export const tsEslintRules = sanitized; +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/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/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 498892d23d7..04d5f834f51 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/tools/generate-external-rules-docs.ts b/tools/generate-external-rules-docs.ts new file mode 100644 index 00000000000..b7f02d4b5ea --- /dev/null +++ b/tools/generate-external-rules-docs.ts @@ -0,0 +1,133 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * 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, writeFile } from 'node:fs/promises'; +import { dirname, join } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; +import { readdir } from 'fs/promises'; +import prettier from 'prettier'; +import { prettier as prettierOpts } from '../package.json'; + +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)})`; +} + +const sonarKeySorter = (a, b) => + parseInt(a.sonarId.substring(1)) < parseInt(b.sonarId.substring(1)) ? -1 : 1; + +const ruleRegex = /^S\d+$/; +const RULES_FOLDER = join( + dirname(fileURLToPath(import.meta.url)), + '..', + 'packages', + 'jsts', + 'src', + 'rules', +); + +const decoratedRules = []; +const externalRules = []; +const files = await readdir(RULES_FOLDER, { withFileTypes: true }); +for (const file of files) { + if (ruleRegex.test(file.name) && file.isDirectory()) { + const metadata = await import( + pathToFileURL(join(RULES_FOLDER, file.name, 'meta.js')).toString() + ); + if (metadata.implementation === 'decorated') { + decoratedRules.push({ + sonarId: file.name, + rules: metadata.externalRules, + }); + } else if (metadata.implementation === 'external') { + externalRules.push({ + sonarId: file.name, + externalPlugin: metadata.externalPlugin, + externalRule: metadata.eslintId, + }); + } + } +} + +externalRules.sort(sonarKeySorter); +decoratedRules.sort(sonarKeySorter); + +const externalContents = `| SonarJS rule ID | Rule implemented by |\n|:---|:---|\n${externalRules + .map( + rule => + `| ${sonarCell(rule.sonarId)} | ${externalRuleCell(rule.externalPlugin, rule.externalRule)} |\n`, + ) + .join('')}`; + +const decoratedContents = `| SonarJS rule ID | Rules used in the SonarJS implementation |\n|:---|:---|\n${decoratedRules + .map( + rule => + `| ${sonarCell(rule.sonarId)} | ${rule.rules.map(r => externalRuleCell(r.externalPlugin, r.externalRule)).join('
')} |\n`, + ) + .join('')}`; + +const README = join( + dirname(fileURLToPath(import.meta.url)), + '..', + 'packages', + 'jsts', + 'src', + 'rules', + 'README.md', +); + +await writeFile( + README, + await prettier.format( + (await readFile(README, 'utf8')) + .replace( + /.*/gs, + `\n${externalContents}\n`, + ) + .replace( + /.*/gs, + `\n${decoratedContents}\n`, + ), + { ...(prettierOpts as prettier.Options), filepath: README }, + ), + 'utf8', +); diff --git a/tools/generate-meta.ts b/tools/generate-meta.ts index 0c5b3a16673..64f8c83a302 100644 --- a/tools/generate-meta.ts +++ b/tools/generate-meta.ts @@ -14,8 +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/ */ +import prettier from 'prettier'; import { RuleMetaData } from '@typescript-eslint/utils/ts-eslint'; import { readdirSync, readFileSync, writeFileSync } from 'fs'; +import { prettier as prettierOpts } from '../package.json'; import { join } from 'node:path/posix'; const ruleRegex = /^S\d+$/; @@ -24,6 +26,23 @@ function toUnixPath(path: string) { return path.replace(/[\\/]+/g, '/'); } +const header = `/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */`; + const typeMatrix = { CODE_SMELL: 'suggestion', BUG: 'problem', @@ -47,7 +66,7 @@ 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) { +async function generateMetaForRule(ruleDir: string, ruleId: string) { const ruleRspecMeta = JSON.parse( readFileSync(join(METADATA_FOLDER, `${ruleId}.json`), 'utf-8'), ) as rspecMeta; @@ -77,29 +96,11 @@ function generateMetaForRule(ruleDir: string, ruleId: string) { readFileSync(join(METADATA_FOLDER, 'schemas', `${ruleId}-schema.json`), 'utf-8'), ); } catch {} - + const metaFile = join(ruleDir, ruleId, 'generated-meta.ts'); 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. - */ - + metaFile, + await prettier.format( + `${header} // DO NOT EDIT! This file is autogenerated by "npm run generate-meta" @@ -113,20 +114,21 @@ export const schema = ${JSON.stringify(schema, null, 2)} as const satisfies JSON : '' } `, + { ...(prettierOpts as prettier.Options), filepath: metaFile }, + ), ); } -function generateMetaForRules(ruleDir: string) { +async 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); + await generateMetaForRule(ruleDir, file.name); } } } -generateMetaForRules(RULES_FOLDER); +await generateMetaForRules(RULES_FOLDER); diff --git a/tools/generate-rule-indexes.ts b/tools/generate-rule-indexes.ts new file mode 100644 index 00000000000..9408c985a84 --- /dev/null +++ b/tools/generate-rule-indexes.ts @@ -0,0 +1,95 @@ +/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * 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 } from 'fs/promises'; +import { join, dirname } from 'node:path/posix'; +import { fileURLToPath, pathToFileURL } from 'node:url'; +import { prettier as prettierOpts } from '../package.json'; + +function toUnixPath(path: string) { + return path.replace(/[\\/]+/g, '/'); +} + +const header = `/* + * SonarQube JavaScript Plugin + * Copyright (C) 2011-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */`; + +const RULES_FOLDER = join( + dirname(toUnixPath(fileURLToPath(import.meta.url))), + '../packages/jsts/src/rules/', +); + +const allRulesIndex = join(RULES_FOLDER, './rules.ts'); +const pluginRulesIndex = join(RULES_FOLDER, './plugin-rules.ts'); +const ruleRegex = /^S\d+$/; + +const allRules: string[] = []; +const pluginRules: string[] = []; +const eslintIds: Record = {}; + +const files = await readdir(RULES_FOLDER, { withFileTypes: true }); +for (const file of files) { + if (ruleRegex.test(file.name) && file.isDirectory()) { + const metadata = await import( + pathToFileURL(join(RULES_FOLDER, file.name, 'meta.js')).toString() + ); + eslintIds[metadata.sonarKey] = metadata.eslintId; + allRules.push(metadata.sonarKey); + if (metadata.implementation === 'original') { + pluginRules.push(metadata.sonarKey); + } + } +} + +const sonarKeySorter = (a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)); + +await writeFile( + allRulesIndex, + await prettier.format( + `${header}\n\n// DO NOT EDIT! This file was generated by generate-rule-indexes.ts\n${allRules + .sort(sonarKeySorter) + .map(id => `export { rule as ${id} } from './${id}/index.js'; // ${eslintIds[id]}\n`) + .join('')}`, + { ...(prettierOpts as prettier.Options), filepath: allRulesIndex }, + ), +); + +//sort once; +pluginRules.sort(sonarKeySorter); + +await writeFile( + pluginRulesIndex, + await prettier.format( + `${header}\n\n// DO NOT EDIT! This file was generated by generate-rule-indexes.ts\n +${pluginRules.map(id => `import { rule as ${id} } from './${id}/index.js';\n`).join('')} +export const rules = {\n${pluginRules.map(id => ` '${eslintIds[id]}': ${id},\n`).join('')}};\n`, + { ...(prettierOpts as prettier.Options), filepath: allRulesIndex }, + ), +); diff --git a/tools/tsconfig.json b/tools/tsconfig.json index e66e8d31a37..2f2edb1f928 100644 --- a/tools/tsconfig.json +++ b/tools/tsconfig.json @@ -1,9 +1,11 @@ { "compilerOptions": { - "module": "NodeNext", - "target": "es6", + "module": "nodenext", + "target": "ES2023", "allowJs": true, - "moduleResolution": "NodeNext" + "moduleResolution": "NodeNext", + "resolveJsonModule": true, + "typeRoots": ["../node_modules/@types", "../typings"] }, - "files": ["generate-meta.ts"] + "files": ["*.ts"] } 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; }