From f20a77a458ebe43284ff98a981f8c0f1336e67fd Mon Sep 17 00:00:00 2001 From: Victor Diez Date: Mon, 25 Nov 2024 21:44:33 +0100 Subject: [PATCH] fix tests and eslint plugin --- packages/jsts/src/rules/.gitignore | 2 + packages/jsts/src/rules/plugin-rules.ts | 579 ------------------------ packages/jsts/src/rules/rules.ts | 461 ------------------- tools/generate-rule-indexes.ts | 35 +- 4 files changed, 28 insertions(+), 1049 deletions(-) create mode 100644 packages/jsts/src/rules/.gitignore delete mode 100644 packages/jsts/src/rules/plugin-rules.ts delete mode 100644 packages/jsts/src/rules/rules.ts 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/plugin-rules.ts b/packages/jsts/src/rules/plugin-rules.ts deleted file mode 100644 index 0c8002ec22c..00000000000 --- a/packages/jsts/src/rules/plugin-rules.ts +++ /dev/null @@ -1,579 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-2024 SonarSource SA - * 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. - */ - -// DO NOT EDIT! This file was generated by generate-rule-indexes.ts - -import { rule as S100 } from './S100/index.js'; -import { rule as S101 } from './S101/index.js'; -import { rule as S104 } from './S104/index.js'; -import { rule as S105 } from './S105/index.js'; -import { rule as S109 } from './S109/index.js'; -import { rule as S117 } from './S117/index.js'; -import { rule as S124 } from './S124/index.js'; -import { rule as S125 } from './S125/index.js'; -import { rule as S126 } from './S126/index.js'; -import { rule as S128 } from './S128/index.js'; -import { rule as S134 } from './S134/index.js'; -import { rule as S135 } from './S135/index.js'; -import { rule as S138 } from './S138/index.js'; -import { rule as S881 } from './S881/index.js'; -import { rule as S888 } from './S888/index.js'; -import { rule as S930 } from './S930/index.js'; -import { rule as S1066 } from './S1066/index.js'; -import { rule as S1067 } from './S1067/index.js'; -import { rule as S1082 } from './S1082/index.js'; -import { rule as S1110 } from './S1110/index.js'; -import { rule as S1119 } from './S1119/index.js'; -import { rule as S1121 } from './S1121/index.js'; -import { rule as S1125 } from './S1125/index.js'; -import { rule as S1126 } from './S1126/index.js'; -import { rule as S1128 } from './S1128/index.js'; -import { rule as S1134 } from './S1134/index.js'; -import { rule as S1135 } from './S1135/index.js'; -import { rule as S1154 } from './S1154/index.js'; -import { rule as S1172 } from './S1172/index.js'; -import { rule as S1192 } from './S1192/index.js'; -import { rule as S1219 } from './S1219/index.js'; -import { rule as S1226 } from './S1226/index.js'; -import { rule as S1264 } from './S1264/index.js'; -import { rule as S1301 } from './S1301/index.js'; -import { rule as S1313 } from './S1313/index.js'; -import { rule as S1439 } from './S1439/index.js'; -import { rule as S1444 } from './S1444/index.js'; -import { rule as S1451 } from './S1451/index.js'; -import { rule as S1472 } from './S1472/index.js'; -import { rule as S1479 } from './S1479/index.js'; -import { rule as S1481 } from './S1481/index.js'; -import { rule as S1488 } from './S1488/index.js'; -import { rule as S1515 } from './S1515/index.js'; -import { rule as S1523 } from './S1523/index.js'; -import { rule as S1526 } from './S1526/index.js'; -import { rule as S1527 } from './S1527/index.js'; -import { rule as S1528 } from './S1528/index.js'; -import { rule as S1529 } from './S1529/index.js'; -import { rule as S1530 } from './S1530/index.js'; -import { rule as S1533 } from './S1533/index.js'; -import { rule as S1535 } from './S1535/index.js'; -import { rule as S1541 } from './S1541/index.js'; -import { rule as S1607 } from './S1607/index.js'; -import { rule as S1751 } from './S1751/index.js'; -import { rule as S1764 } from './S1764/index.js'; -import { rule as S1821 } from './S1821/index.js'; -import { rule as S1848 } from './S1848/index.js'; -import { rule as S1854 } from './S1854/index.js'; -import { rule as S1862 } from './S1862/index.js'; -import { rule as S1871 } from './S1871/index.js'; -import { rule as S1874 } from './S1874/index.js'; -import { rule as S1940 } from './S1940/index.js'; -import { rule as S1994 } from './S1994/index.js'; -import { rule as S2004 } from './S2004/index.js'; -import { rule as S2068 } from './S2068/index.js'; -import { rule as S2077 } from './S2077/index.js'; -import { rule as S2092 } from './S2092/index.js'; -import { rule as S2123 } from './S2123/index.js'; -import { rule as S2137 } from './S2137/index.js'; -import { rule as S2138 } from './S2138/index.js'; -import { rule as S2187 } from './S2187/index.js'; -import { rule as S2201 } from './S2201/index.js'; -import { rule as S2208 } from './S2208/index.js'; -import { rule as S2234 } from './S2234/index.js'; -import { rule as S2245 } from './S2245/index.js'; -import { rule as S2251 } from './S2251/index.js'; -import { rule as S2255 } from './S2255/index.js'; -import { rule as S2259 } from './S2259/index.js'; -import { rule as S2301 } from './S2301/index.js'; -import { rule as S2310 } from './S2310/index.js'; -import { rule as S2392 } from './S2392/index.js'; -import { rule as S2424 } from './S2424/index.js'; -import { rule as S2428 } from './S2428/index.js'; -import { rule as S2486 } from './S2486/index.js'; -import { rule as S2589 } from './S2589/index.js'; -import { rule as S2598 } from './S2598/index.js'; -import { rule as S2612 } from './S2612/index.js'; -import { rule as S2639 } from './S2639/index.js'; -import { rule as S2681 } from './S2681/index.js'; -import { rule as S2692 } from './S2692/index.js'; -import { rule as S2699 } from './S2699/index.js'; -import { rule as S2703 } from './S2703/index.js'; -import { rule as S2737 } from './S2737/index.js'; -import { rule as S2755 } from './S2755/index.js'; -import { rule as S2757 } from './S2757/index.js'; -import { rule as S2817 } from './S2817/index.js'; -import { rule as S2819 } from './S2819/index.js'; -import { rule as S2870 } from './S2870/index.js'; -import { rule as S2871 } from './S2871/index.js'; -import { rule as S2970 } from './S2970/index.js'; -import { rule as S2990 } from './S2990/index.js'; -import { rule as S2999 } from './S2999/index.js'; -import { rule as S3001 } from './S3001/index.js'; -import { rule as S3003 } from './S3003/index.js'; -import { rule as S3317 } from './S3317/index.js'; -import { rule as S3330 } from './S3330/index.js'; -import { rule as S3358 } from './S3358/index.js'; -import { rule as S3402 } from './S3402/index.js'; -import { rule as S3403 } from './S3403/index.js'; -import { rule as S3415 } from './S3415/index.js'; -import { rule as S3499 } from './S3499/index.js'; -import { rule as S3500 } from './S3500/index.js'; -import { rule as S3513 } from './S3513/index.js'; -import { rule as S3514 } from './S3514/index.js'; -import { rule as S3516 } from './S3516/index.js'; -import { rule as S3524 } from './S3524/index.js'; -import { rule as S3525 } from './S3525/index.js'; -import { rule as S3531 } from './S3531/index.js'; -import { rule as S3533 } from './S3533/index.js'; -import { rule as S3579 } from './S3579/index.js'; -import { rule as S3616 } from './S3616/index.js'; -import { rule as S3626 } from './S3626/index.js'; -import { rule as S3686 } from './S3686/index.js'; -import { rule as S3699 } from './S3699/index.js'; -import { rule as S3723 } from './S3723/index.js'; -import { rule as S3735 } from './S3735/index.js'; -import { rule as S3757 } from './S3757/index.js'; -import { rule as S3758 } from './S3758/index.js'; -import { rule as S3760 } from './S3760/index.js'; -import { rule as S3776 } from './S3776/index.js'; -import { rule as S3782 } from './S3782/index.js'; -import { rule as S3785 } from './S3785/index.js'; -import { rule as S3796 } from './S3796/index.js'; -import { rule as S3798 } from './S3798/index.js'; -import { rule as S3800 } from './S3800/index.js'; -import { rule as S3801 } from './S3801/index.js'; -import { rule as S3827 } from './S3827/index.js'; -import { rule as S3854 } from './S3854/index.js'; -import { rule as S3923 } from './S3923/index.js'; -import { rule as S3972 } from './S3972/index.js'; -import { rule as S3973 } from './S3973/index.js'; -import { rule as S3981 } from './S3981/index.js'; -import { rule as S3984 } from './S3984/index.js'; -import { rule as S4030 } from './S4030/index.js'; -import { rule as S4036 } from './S4036/index.js'; -import { rule as S4043 } from './S4043/index.js'; -import { rule as S4123 } from './S4123/index.js'; -import { rule as S4139 } from './S4139/index.js'; -import { rule as S4143 } from './S4143/index.js'; -import { rule as S4144 } from './S4144/index.js'; -import { rule as S4158 } from './S4158/index.js'; -import { rule as S4165 } from './S4165/index.js'; -import { rule as S4322 } from './S4322/index.js'; -import { rule as S4323 } from './S4323/index.js'; -import { rule as S4324 } from './S4324/index.js'; -import { rule as S4328 } from './S4328/index.js'; -import { rule as S4335 } from './S4335/index.js'; -import { rule as S4423 } from './S4423/index.js'; -import { rule as S4426 } from './S4426/index.js'; -import { rule as S4502 } from './S4502/index.js'; -import { rule as S4507 } from './S4507/index.js'; -import { rule as S4524 } from './S4524/index.js'; -import { rule as S4619 } from './S4619/index.js'; -import { rule as S4621 } from './S4621/index.js'; -import { rule as S4622 } from './S4622/index.js'; -import { rule as S4623 } from './S4623/index.js'; -import { rule as S4624 } from './S4624/index.js'; -import { rule as S4634 } from './S4634/index.js'; -import { rule as S4721 } from './S4721/index.js'; -import { rule as S4782 } from './S4782/index.js'; -import { rule as S4784 } from './S4784/index.js'; -import { rule as S4787 } from './S4787/index.js'; -import { rule as S4790 } from './S4790/index.js'; -import { rule as S4798 } from './S4798/index.js'; -import { rule as S4817 } from './S4817/index.js'; -import { rule as S4818 } from './S4818/index.js'; -import { rule as S4822 } from './S4822/index.js'; -import { rule as S4823 } from './S4823/index.js'; -import { rule as S4829 } from './S4829/index.js'; -import { rule as S4830 } from './S4830/index.js'; -import { rule as S5042 } from './S5042/index.js'; -import { rule as S5122 } from './S5122/index.js'; -import { rule as S5148 } from './S5148/index.js'; -import { rule as S5247 } from './S5247/index.js'; -import { rule as S5256 } from './S5256/index.js'; -import { rule as S5257 } from './S5257/index.js'; -import { rule as S5260 } from './S5260/index.js'; -import { rule as S5264 } from './S5264/index.js'; -import { rule as S5332 } from './S5332/index.js'; -import { rule as S5443 } from './S5443/index.js'; -import { rule as S5527 } from './S5527/index.js'; -import { rule as S5542 } from './S5542/index.js'; -import { rule as S5547 } from './S5547/index.js'; -import { rule as S5604 } from './S5604/index.js'; -import { rule as S5659 } from './S5659/index.js'; -import { rule as S5689 } from './S5689/index.js'; -import { rule as S5691 } from './S5691/index.js'; -import { rule as S5693 } from './S5693/index.js'; -import { rule as S5725 } from './S5725/index.js'; -import { rule as S5728 } from './S5728/index.js'; -import { rule as S5730 } from './S5730/index.js'; -import { rule as S5732 } from './S5732/index.js'; -import { rule as S5734 } from './S5734/index.js'; -import { rule as S5736 } from './S5736/index.js'; -import { rule as S5739 } from './S5739/index.js'; -import { rule as S5742 } from './S5742/index.js'; -import { rule as S5743 } from './S5743/index.js'; -import { rule as S5757 } from './S5757/index.js'; -import { rule as S5759 } from './S5759/index.js'; -import { rule as S5842 } from './S5842/index.js'; -import { rule as S5843 } from './S5843/index.js'; -import { rule as S5850 } from './S5850/index.js'; -import { rule as S5852 } from './S5852/index.js'; -import { rule as S5856 } from './S5856/index.js'; -import { rule as S5860 } from './S5860/index.js'; -import { rule as S5863 } from './S5863/index.js'; -import { rule as S5867 } from './S5867/index.js'; -import { rule as S5868 } from './S5868/index.js'; -import { rule as S5869 } from './S5869/index.js'; -import { rule as S5876 } from './S5876/index.js'; -import { rule as S5958 } from './S5958/index.js'; -import { rule as S5973 } from './S5973/index.js'; -import { rule as S6019 } from './S6019/index.js'; -import { rule as S6035 } from './S6035/index.js'; -import { rule as S6079 } from './S6079/index.js'; -import { rule as S6080 } from './S6080/index.js'; -import { rule as S6092 } from './S6092/index.js'; -import { rule as S6245 } from './S6245/index.js'; -import { rule as S6249 } from './S6249/index.js'; -import { rule as S6252 } from './S6252/index.js'; -import { rule as S6265 } from './S6265/index.js'; -import { rule as S6268 } from './S6268/index.js'; -import { rule as S6270 } from './S6270/index.js'; -import { rule as S6275 } from './S6275/index.js'; -import { rule as S6281 } from './S6281/index.js'; -import { rule as S6299 } from './S6299/index.js'; -import { rule as S6302 } from './S6302/index.js'; -import { rule as S6303 } from './S6303/index.js'; -import { rule as S6304 } from './S6304/index.js'; -import { rule as S6308 } from './S6308/index.js'; -import { rule as S6317 } from './S6317/index.js'; -import { rule as S6319 } from './S6319/index.js'; -import { rule as S6321 } from './S6321/index.js'; -import { rule as S6323 } from './S6323/index.js'; -import { rule as S6324 } from './S6324/index.js'; -import { rule as S6326 } from './S6326/index.js'; -import { rule as S6327 } from './S6327/index.js'; -import { rule as S6328 } from './S6328/index.js'; -import { rule as S6329 } from './S6329/index.js'; -import { rule as S6330 } from './S6330/index.js'; -import { rule as S6331 } from './S6331/index.js'; -import { rule as S6332 } from './S6332/index.js'; -import { rule as S6333 } from './S6333/index.js'; -import { rule as S6351 } from './S6351/index.js'; -import { rule as S6353 } from './S6353/index.js'; -import { rule as S6397 } from './S6397/index.js'; -import { rule as S6426 } from './S6426/index.js'; -import { rule as S6439 } from './S6439/index.js'; -import { rule as S6441 } from './S6441/index.js'; -import { rule as S6442 } from './S6442/index.js'; -import { rule as S6443 } from './S6443/index.js'; -import { rule as S6477 } from './S6477/index.js'; -import { rule as S6478 } from './S6478/index.js'; -import { rule as S6479 } from './S6479/index.js'; -import { rule as S6481 } from './S6481/index.js'; -import { rule as S6486 } from './S6486/index.js'; -import { rule as S6564 } from './S6564/index.js'; -import { rule as S6582 } from './S6582/index.js'; -import { rule as S6594 } from './S6594/index.js'; -import { rule as S6627 } from './S6627/index.js'; -import { rule as S6754 } from './S6754/index.js'; -import { rule as S6759 } from './S6759/index.js'; -import { rule as S6791 } from './S6791/index.js'; -import { rule as S6957 } from './S6957/index.js'; -import { rule as S6958 } from './S6958/index.js'; -import { rule as S6959 } from './S6959/index.js'; -import { rule as S7059 } from './S7059/index.js'; - -export const rules = { - 'function-name': S100, - 'class-name': S101, - 'max-lines': S104, - 'no-tab': S105, - 'no-magic-numbers': S109, - 'variable-name': S117, - 'comment-regex': S124, - 'no-commented-code': S125, - 'elseif-without-else': S126, - 'no-fallthrough': S128, - 'nested-control-flow': S134, - 'too-many-break-or-continue-in-loop': S135, - 'max-lines-per-function': S138, - 'no-nested-incdec': S881, - 'no-equals-in-for-termination': S888, - 'no-extra-arguments': S930, - 'no-collapsible-if': S1066, - 'expression-complexity': S1067, - 'mouse-events-a11y': S1082, - 'no-redundant-parentheses': S1110, - 'no-labels': S1119, - 'no-nested-assignment': S1121, - 'no-redundant-boolean': S1125, - 'prefer-single-boolean-return': S1126, - 'unused-import': S1128, - 'fixme-tag': S1134, - 'todo-tag': S1135, - 'useless-string-operation': S1154, - 'no-unused-function-argument': S1172, - 'no-duplicate-string': S1192, - 'no-case-label-in-switch': S1219, - 'no-parameter-reassignment': S1226, - 'prefer-while': S1264, - 'no-small-switch': S1301, - 'no-hardcoded-ip': S1313, - 'label-position': S1439, - 'public-static-readonly': S1444, - 'file-header': S1451, - 'call-argument-line': S1472, - 'max-switch-cases': S1479, - 'no-unused-vars': S1481, - 'prefer-immediate-return': S1488, - 'function-inside-loop': S1515, - 'code-eval': S1523, - 'no-variable-usage-before-declaration': S1526, - 'future-reserved-words': S1527, - 'array-constructor': S1528, - 'bitwise-operators': S1529, - 'no-function-declaration-in-block': S1530, - 'no-primitive-wrappers': S1533, - 'for-in': S1535, - 'cyclomatic-complexity': S1541, - 'no-skipped-tests': S1607, - 'no-one-iteration-loop': S1751, - 'no-identical-expressions': S1764, - 'no-nested-switch': S1821, - 'constructor-for-side-effects': S1848, - 'no-dead-store': S1854, - 'no-identical-conditions': S1862, - 'no-duplicated-branches': S1871, - deprecation: S1874, - 'no-inverted-boolean-check': S1940, - 'misplaced-loop-counter': S1994, - 'no-nested-functions': S2004, - 'no-hardcoded-credentials': S2068, - 'sql-queries': S2077, - 'insecure-cookie': S2092, - 'no-useless-increment': S2123, - 'no-globals-shadowing': S2137, - 'no-undefined-assignment': S2138, - 'no-empty-test-file': S2187, - 'no-ignored-return': S2201, - 'no-wildcard-import': S2208, - 'arguments-order': S2234, - 'pseudo-random': S2245, - 'for-loop-increment-sign': S2251, - cookies: S2255, - 'null-dereference': S2259, - 'no-selector-parameter': S2301, - 'updated-loop-counter': S2310, - 'block-scoped-var': S2392, - 'no-built-in-override': S2424, - 'prefer-object-literal': S2428, - 'no-ignored-exceptions': S2486, - 'no-gratuitous-expressions': S2589, - 'file-uploads': S2598, - 'file-permissions': S2612, - 'no-empty-character-class': S2639, - 'no-unenclosed-multiline-block': S2681, - 'index-of-compare-to-positive-number': S2692, - 'assertions-in-tests': S2699, - 'no-implicit-global': S2703, - 'no-useless-catch': S2737, - 'xml-parser-xxe': S2755, - 'non-existent-operator': S2757, - 'web-sql-database': S2817, - 'post-message': S2819, - 'no-array-delete': S2870, - 'no-alphabetical-sort': S2871, - 'no-incomplete-assertions': S2970, - 'no-global-this': S2990, - 'new-operator-misuse': S2999, - 'no-delete-var': S3001, - 'strings-comparison': S3003, - 'file-name-differ-from-class': S3317, - 'cookie-no-httponly': S3330, - 'no-nested-conditional': S3358, - 'no-incorrect-string-concat': S3402, - 'different-types-comparison': S3403, - 'inverted-assertion-arguments': S3415, - 'shorthand-property-grouping': S3499, - 'updated-const-var': S3500, - 'arguments-usage': S3513, - 'destructuring-assignment-syntax': S3514, - 'no-invariant-returns': S3516, - 'arrow-function-convention': S3524, - 'class-prototype': S3525, - 'generator-without-yield': S3531, - 'no-require-or-define': S3533, - 'no-associative-arrays': S3579, - 'comma-or-logical-or-case': S3616, - 'no-redundant-jump': S3626, - 'inconsistent-function-call': S3686, - 'no-use-of-empty-return-value': S3699, - 'enforce-trailing-comma': S3723, - 'void-use': S3735, - 'operation-returning-nan': S3757, - 'values-not-convertible-to-numbers': S3758, - 'non-number-in-arithmetic-expression': S3760, - 'cognitive-complexity': S3776, - 'argument-type': S3782, - 'in-operator-type-error': S3785, - 'array-callback-without-return': S3796, - 'declarations-in-global-scope': S3798, - 'function-return-type': S3800, - 'no-inconsistent-returns': S3801, - 'no-reference-error': S3827, - 'super-invocation': S3854, - 'no-all-duplicated-branches': S3923, - 'no-same-line-conditional': S3972, - 'conditional-indentation': S3973, - 'no-collection-size-mischeck': S3981, - 'no-unthrown-error': S3984, - 'no-unused-collection': S4030, - 'no-os-command-from-path': S4036, - 'no-misleading-array-reverse': S4043, - 'no-invalid-await': S4123, - 'no-for-in-iterable': S4139, - 'no-element-overwrite': S4143, - 'no-identical-functions': S4144, - 'no-empty-collection': S4158, - 'no-redundant-assignments': S4165, - 'prefer-type-guard': S4322, - 'use-type-alias': S4323, - 'no-return-type-any': S4324, - 'no-implicit-dependencies': S4328, - 'no-useless-intersection': S4335, - 'weak-ssl': S4423, - 'no-weak-keys': S4426, - csrf: S4502, - 'production-debug': S4507, - 'prefer-default-last': S4524, - 'no-in-misuse': S4619, - 'no-duplicate-in-composite': S4621, - 'max-union-size': S4622, - 'no-undefined-argument': S4623, - 'no-nested-template-literals': S4624, - 'prefer-promise-shorthand': S4634, - 'os-command': S4721, - 'no-redundant-optional': S4782, - 'regular-expr': S4784, - encryption: S4787, - hashing: S4790, - 'bool-param-default': S4798, - xpath: S4817, - sockets: S4818, - 'no-try-promise': S4822, - 'process-argv': S4823, - 'standard-input': S4829, - 'unverified-certificate': S4830, - 'no-unsafe-unzip': S5042, - cors: S5122, - 'link-with-target-blank': S5148, - 'disabled-auto-escaping': S5247, - 'table-header': S5256, - 'no-table-as-layout': S5257, - 'table-header-reference': S5260, - 'object-alt-content': S5264, - 'no-clear-text-protocols': S5332, - 'publicly-writable-directories': S5443, - 'unverified-hostname': S5527, - 'encryption-secure-mode': S5542, - 'no-weak-cipher': S5547, - 'no-intrusive-permissions': S5604, - 'insecure-jwt-token': S5659, - 'x-powered-by': S5689, - 'hidden-files': S5691, - 'content-length': S5693, - 'disabled-resource-integrity': S5725, - 'content-security-policy': S5728, - 'no-mixed-content': S5730, - 'frame-ancestors': S5732, - 'no-mime-sniff': S5734, - 'no-referrer-policy': S5736, - 'strict-transport-security': S5739, - 'certificate-transparency': S5742, - 'dns-prefetching': S5743, - 'confidential-information-logging': S5757, - 'no-ip-forward': S5759, - 'empty-string-repetition': S5842, - 'regex-complexity': S5843, - 'anchor-precedence': S5850, - 'slow-regex': S5852, - 'no-invalid-regexp': S5856, - 'unused-named-groups': S5860, - 'no-same-argument-assert': S5863, - 'unicode-aware-regex': S5867, - 'no-misleading-character-class': S5868, - 'duplicates-in-character-class': S5869, - 'session-regeneration': S5876, - 'test-check-exception': S5958, - 'stable-tests': S5973, - 'no-empty-after-reluctant': S6019, - 'single-character-alternation': S6035, - 'no-code-after-done': S6079, - 'disabled-timeout': S6080, - 'chai-determinate-assertion': S6092, - 'aws-s3-bucket-server-encryption': S6245, - 'aws-s3-bucket-insecure-http': S6249, - 'aws-s3-bucket-versioning': S6252, - 'aws-s3-bucket-granted-access': S6265, - 'no-angular-bypass-sanitization': S6268, - 'aws-iam-public-access': S6270, - 'aws-ec2-unencrypted-ebs-volume': S6275, - 'aws-s3-bucket-public-access': S6281, - 'no-vue-bypass-sanitization': S6299, - 'aws-iam-all-privileges': S6302, - 'aws-rds-unencrypted-databases': S6303, - 'aws-iam-all-resources-accessible': S6304, - 'aws-opensearchservice-domain': S6308, - 'aws-iam-privilege-escalation': S6317, - 'aws-sagemaker-unencrypted-notebook': S6319, - 'aws-restricted-ip-admin-access': S6321, - 'no-empty-alternatives': S6323, - 'no-control-regex': S6324, - 'no-regex-spaces': S6326, - 'aws-sns-unencrypted-topics': S6327, - 'existing-groups': S6328, - 'aws-ec2-rds-dms-public': S6329, - 'aws-sqs-unencrypted-queue': S6330, - 'no-empty-group': S6331, - 'aws-efs-unencrypted': S6332, - 'aws-apigateway-public-api': S6333, - 'stateful-regex': S6351, - 'concise-regex': S6353, - 'single-char-in-character-classes': S6397, - 'no-exclusive-tests': S6426, - 'jsx-no-leaked-render': S6439, - 'no-unused-class-component-methods': S6441, - 'no-hook-setter-in-body': S6442, - 'no-useless-react-setstate': S6443, - 'jsx-key': S6477, - 'no-unstable-nested-components': S6478, - 'no-array-index-key': S6479, - 'jsx-no-constructed-context-values': S6481, - 'no-uniq-key': S6486, - 'redundant-type-aliases': S6564, - 'prefer-optional-chain': S6582, - 'prefer-regexp-exec': S6594, - 'no-internal-api-use': S6627, - 'hook-use-state': S6754, - 'prefer-read-only-props': S6759, - 'no-unsafe': S6791, - 'no-deprecated-react': S6957, - 'no-literal-call': S6958, - 'reduce-initial-value': S6959, - 'no-async-constructor': S7059, -}; diff --git a/packages/jsts/src/rules/rules.ts b/packages/jsts/src/rules/rules.ts deleted file mode 100644 index 9282927db0f..00000000000 --- a/packages/jsts/src/rules/rules.ts +++ /dev/null @@ -1,461 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-2024 SonarSource SA - * 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. - */ - -// DO NOT EDIT! This file was generated by generate-rule-indexes.ts -export { rule as S100 } from './S100/index.js'; // function-name -export { rule as S101 } from './S101/index.js'; // class-name -export { rule as S103 } from './S103/index.js'; // max-len -export { rule as S104 } from './S104/index.js'; // max-lines -export { rule as S105 } from './S105/index.js'; // no-tab -export { rule as S106 } from './S106/index.js'; // no-console -export { rule as S107 } from './S107/index.js'; // max-params -export { rule as S108 } from './S108/index.js'; // no-empty -export { rule as S109 } from './S109/index.js'; // no-magic-numbers -export { rule as S113 } from './S113/index.js'; // eol-last -export { rule as S117 } from './S117/index.js'; // variable-name -export { rule as S121 } from './S121/index.js'; // curly -export { rule as S122 } from './S122/index.js'; // max-statements-per-line -export { rule as S124 } from './S124/index.js'; // comment-regex -export { rule as S125 } from './S125/index.js'; // no-commented-code -export { rule as S126 } from './S126/index.js'; // elseif-without-else -export { rule as S128 } from './S128/index.js'; // no-fallthrough -export { rule as S131 } from './S131/index.js'; // switch-without-default -export { rule as S134 } from './S134/index.js'; // nested-control-flow -export { rule as S135 } from './S135/index.js'; // too-many-break-or-continue-in-loop -export { rule as S138 } from './S138/index.js'; // max-lines-per-function -export { rule as S139 } from './S139/index.js'; // line-comment-position -export { rule as S878 } from './S878/index.js'; // no-sequences -export { rule as S881 } from './S881/index.js'; // no-nested-incdec -export { rule as S888 } from './S888/index.js'; // no-equals-in-for-termination -export { rule as S905 } from './S905/index.js'; // no-unused-expressions -export { rule as S909 } from './S909/index.js'; // no-continue -export { rule as S930 } from './S930/index.js'; // no-extra-arguments -export { rule as S1066 } from './S1066/index.js'; // no-collapsible-if -export { rule as S1067 } from './S1067/index.js'; // expression-complexity -export { rule as S1068 } from './S1068/index.js'; // no-unused-private-class-members -export { rule as S1077 } from './S1077/index.js'; // alt-text -export { rule as S1082 } from './S1082/index.js'; // mouse-events-a11y -export { rule as S1090 } from './S1090/index.js'; // iframe-has-title -export { rule as S1105 } from './S1105/index.js'; // brace-style -export { rule as S1110 } from './S1110/index.js'; // no-redundant-parentheses -export { rule as S1116 } from './S1116/index.js'; // no-extra-semi -export { rule as S1117 } from './S1117/index.js'; // no-shadow -export { rule as S1119 } from './S1119/index.js'; // no-labels -export { rule as S1121 } from './S1121/index.js'; // no-nested-assignment -export { rule as S1125 } from './S1125/index.js'; // no-redundant-boolean -export { rule as S1126 } from './S1126/index.js'; // prefer-single-boolean-return -export { rule as S1128 } from './S1128/index.js'; // unused-import -export { rule as S1131 } from './S1131/index.js'; // no-trailing-spaces -export { rule as S1134 } from './S1134/index.js'; // fixme-tag -export { rule as S1135 } from './S1135/index.js'; // todo-tag -export { rule as S1143 } from './S1143/index.js'; // no-unsafe-finally -export { rule as S1154 } from './S1154/index.js'; // useless-string-operation -export { rule as S1172 } from './S1172/index.js'; // no-unused-function-argument -export { rule as S1186 } from './S1186/index.js'; // no-empty-function -export { rule as S1192 } from './S1192/index.js'; // no-duplicate-string -export { rule as S1199 } from './S1199/index.js'; // no-lone-blocks -export { rule as S1219 } from './S1219/index.js'; // no-case-label-in-switch -export { rule as S1226 } from './S1226/index.js'; // no-parameter-reassignment -export { rule as S1264 } from './S1264/index.js'; // prefer-while -export { rule as S1301 } from './S1301/index.js'; // no-small-switch -export { rule as S1313 } from './S1313/index.js'; // no-hardcoded-ip -export { rule as S1314 } from './S1314/index.js'; // no-octal -export { rule as S1321 } from './S1321/index.js'; // no-with -export { rule as S1438 } from './S1438/index.js'; // semi -export { rule as S1439 } from './S1439/index.js'; // label-position -export { rule as S1440 } from './S1440/index.js'; // eqeqeq -export { rule as S1441 } from './S1441/index.js'; // quotes -export { rule as S1442 } from './S1442/index.js'; // no-alert -export { rule as S1444 } from './S1444/index.js'; // public-static-readonly -export { rule as S1451 } from './S1451/index.js'; // file-header -export { rule as S1472 } from './S1472/index.js'; // call-argument-line -export { rule as S1479 } from './S1479/index.js'; // max-switch-cases -export { rule as S1481 } from './S1481/index.js'; // no-unused-vars -export { rule as S1488 } from './S1488/index.js'; // prefer-immediate-return -export { rule as S1515 } from './S1515/index.js'; // function-inside-loop -export { rule as S1516 } from './S1516/index.js'; // no-multi-str -export { rule as S1523 } from './S1523/index.js'; // code-eval -export { rule as S1525 } from './S1525/index.js'; // no-debugger -export { rule as S1526 } from './S1526/index.js'; // no-variable-usage-before-declaration -export { rule as S1527 } from './S1527/index.js'; // future-reserved-words -export { rule as S1528 } from './S1528/index.js'; // array-constructor -export { rule as S1529 } from './S1529/index.js'; // bitwise-operators -export { rule as S1530 } from './S1530/index.js'; // no-function-declaration-in-block -export { rule as S1533 } from './S1533/index.js'; // no-primitive-wrappers -export { rule as S1534 } from './S1534/index.js'; // no-dupe-keys -export { rule as S1535 } from './S1535/index.js'; // for-in -export { rule as S1536 } from './S1536/index.js'; // no-dupe-args -export { rule as S1537 } from './S1537/index.js'; // comma-dangle -export { rule as S1539 } from './S1539/index.js'; // strict -export { rule as S1541 } from './S1541/index.js'; // cyclomatic-complexity -export { rule as S1607 } from './S1607/index.js'; // no-skipped-tests -export { rule as S1656 } from './S1656/index.js'; // no-self-assign -export { rule as S1751 } from './S1751/index.js'; // no-one-iteration-loop -export { rule as S1763 } from './S1763/index.js'; // no-unreachable -export { rule as S1764 } from './S1764/index.js'; // no-identical-expressions -export { rule as S1774 } from './S1774/index.js'; // no-ternary -export { rule as S1788 } from './S1788/index.js'; // default-param-last -export { rule as S1821 } from './S1821/index.js'; // no-nested-switch -export { rule as S1848 } from './S1848/index.js'; // constructor-for-side-effects -export { rule as S1854 } from './S1854/index.js'; // no-dead-store -export { rule as S1862 } from './S1862/index.js'; // no-identical-conditions -export { rule as S1871 } from './S1871/index.js'; // no-duplicated-branches -export { rule as S1874 } from './S1874/index.js'; // deprecation -export { rule as S1940 } from './S1940/index.js'; // no-inverted-boolean-check -export { rule as S1994 } from './S1994/index.js'; // misplaced-loop-counter -export { rule as S2004 } from './S2004/index.js'; // no-nested-functions -export { rule as S2068 } from './S2068/index.js'; // no-hardcoded-credentials -export { rule as S2077 } from './S2077/index.js'; // sql-queries -export { rule as S2092 } from './S2092/index.js'; // insecure-cookie -export { rule as S2094 } from './S2094/index.js'; // no-extraneous-class -export { rule as S2123 } from './S2123/index.js'; // no-useless-increment -export { rule as S2137 } from './S2137/index.js'; // no-globals-shadowing -export { rule as S2138 } from './S2138/index.js'; // no-undefined-assignment -export { rule as S2187 } from './S2187/index.js'; // no-empty-test-file -export { rule as S2189 } from './S2189/index.js'; // no-infinite-loop -export { rule as S2201 } from './S2201/index.js'; // no-ignored-return -export { rule as S2208 } from './S2208/index.js'; // no-wildcard-import -export { rule as S2234 } from './S2234/index.js'; // arguments-order -export { rule as S2245 } from './S2245/index.js'; // pseudo-random -export { rule as S2251 } from './S2251/index.js'; // for-loop-increment-sign -export { rule as S2255 } from './S2255/index.js'; // cookies -export { rule as S2259 } from './S2259/index.js'; // null-dereference -export { rule as S2301 } from './S2301/index.js'; // no-selector-parameter -export { rule as S2310 } from './S2310/index.js'; // updated-loop-counter -export { rule as S2376 } from './S2376/index.js'; // accessor-pairs -export { rule as S2392 } from './S2392/index.js'; // block-scoped-var -export { rule as S2424 } from './S2424/index.js'; // no-built-in-override -export { rule as S2427 } from './S2427/index.js'; // radix -export { rule as S2428 } from './S2428/index.js'; // prefer-object-literal -export { rule as S2430 } from './S2430/index.js'; // new-cap -export { rule as S2432 } from './S2432/index.js'; // no-setter-return -export { rule as S2486 } from './S2486/index.js'; // no-ignored-exceptions -export { rule as S2589 } from './S2589/index.js'; // no-gratuitous-expressions -export { rule as S2598 } from './S2598/index.js'; // file-uploads -export { rule as S2612 } from './S2612/index.js'; // file-permissions -export { rule as S2639 } from './S2639/index.js'; // no-empty-character-class -export { rule as S2681 } from './S2681/index.js'; // no-unenclosed-multiline-block -export { rule as S2685 } from './S2685/index.js'; // no-caller -export { rule as S2688 } from './S2688/index.js'; // use-isnan -export { rule as S2692 } from './S2692/index.js'; // index-of-compare-to-positive-number -export { rule as S2699 } from './S2699/index.js'; // assertions-in-tests -export { rule as S2703 } from './S2703/index.js'; // no-implicit-global -export { rule as S2737 } from './S2737/index.js'; // no-useless-catch -export { rule as S2755 } from './S2755/index.js'; // xml-parser-xxe -export { rule as S2757 } from './S2757/index.js'; // non-existent-operator -export { rule as S2814 } from './S2814/index.js'; // no-redeclare -export { rule as S2817 } from './S2817/index.js'; // web-sql-database -export { rule as S2819 } from './S2819/index.js'; // post-message -export { rule as S2870 } from './S2870/index.js'; // no-array-delete -export { rule as S2871 } from './S2871/index.js'; // no-alphabetical-sort -export { rule as S2933 } from './S2933/index.js'; // prefer-readonly -export { rule as S2966 } from './S2966/index.js'; // no-non-null-assertion -export { rule as S2970 } from './S2970/index.js'; // no-incomplete-assertions -export { rule as S2990 } from './S2990/index.js'; // no-global-this -export { rule as S2999 } from './S2999/index.js'; // new-operator-misuse -export { rule as S3001 } from './S3001/index.js'; // no-delete-var -export { rule as S3003 } from './S3003/index.js'; // strings-comparison -export { rule as S3257 } from './S3257/index.js'; // no-inferrable-types -export { rule as S3317 } from './S3317/index.js'; // file-name-differ-from-class -export { rule as S3330 } from './S3330/index.js'; // cookie-no-httponly -export { rule as S3353 } from './S3353/index.js'; // prefer-const -export { rule as S3358 } from './S3358/index.js'; // no-nested-conditional -export { rule as S3402 } from './S3402/index.js'; // no-incorrect-string-concat -export { rule as S3403 } from './S3403/index.js'; // different-types-comparison -export { rule as S3415 } from './S3415/index.js'; // inverted-assertion-arguments -export { rule as S3498 } from './S3498/index.js'; // object-shorthand -export { rule as S3499 } from './S3499/index.js'; // shorthand-property-grouping -export { rule as S3500 } from './S3500/index.js'; // updated-const-var -export { rule as S3504 } from './S3504/index.js'; // no-var -export { rule as S3512 } from './S3512/index.js'; // prefer-template -export { rule as S3513 } from './S3513/index.js'; // arguments-usage -export { rule as S3514 } from './S3514/index.js'; // destructuring-assignment-syntax -export { rule as S3516 } from './S3516/index.js'; // no-invariant-returns -export { rule as S3523 } from './S3523/index.js'; // no-new-func -export { rule as S3524 } from './S3524/index.js'; // arrow-function-convention -export { rule as S3525 } from './S3525/index.js'; // class-prototype -export { rule as S3531 } from './S3531/index.js'; // generator-without-yield -export { rule as S3533 } from './S3533/index.js'; // no-require-or-define -export { rule as S3579 } from './S3579/index.js'; // no-associative-arrays -export { rule as S3616 } from './S3616/index.js'; // comma-or-logical-or-case -export { rule as S3626 } from './S3626/index.js'; // no-redundant-jump -export { rule as S3686 } from './S3686/index.js'; // inconsistent-function-call -export { rule as S3696 } from './S3696/index.js'; // no-throw-literal -export { rule as S3699 } from './S3699/index.js'; // no-use-of-empty-return-value -export { rule as S3723 } from './S3723/index.js'; // enforce-trailing-comma -export { rule as S3735 } from './S3735/index.js'; // void-use -export { rule as S3757 } from './S3757/index.js'; // operation-returning-nan -export { rule as S3758 } from './S3758/index.js'; // values-not-convertible-to-numbers -export { rule as S3760 } from './S3760/index.js'; // non-number-in-arithmetic-expression -export { rule as S3776 } from './S3776/index.js'; // cognitive-complexity -export { rule as S3782 } from './S3782/index.js'; // argument-type -export { rule as S3785 } from './S3785/index.js'; // in-operator-type-error -export { rule as S3786 } from './S3786/index.js'; // no-template-curly-in-string -export { rule as S3796 } from './S3796/index.js'; // array-callback-without-return -export { rule as S3798 } from './S3798/index.js'; // declarations-in-global-scope -export { rule as S3799 } from './S3799/index.js'; // no-empty-pattern -export { rule as S3800 } from './S3800/index.js'; // function-return-type -export { rule as S3801 } from './S3801/index.js'; // no-inconsistent-returns -export { rule as S3812 } from './S3812/index.js'; // no-unsafe-negation -export { rule as S3827 } from './S3827/index.js'; // no-reference-error -export { rule as S3834 } from './S3834/index.js'; // no-new-native-nonconstructor -export { rule as S3854 } from './S3854/index.js'; // super-invocation -export { rule as S3863 } from './S3863/index.js'; // no-duplicates -export { rule as S3923 } from './S3923/index.js'; // no-all-duplicated-branches -export { rule as S3972 } from './S3972/index.js'; // no-same-line-conditional -export { rule as S3973 } from './S3973/index.js'; // conditional-indentation -export { rule as S3981 } from './S3981/index.js'; // no-collection-size-mischeck -export { rule as S3984 } from './S3984/index.js'; // no-unthrown-error -export { rule as S4023 } from './S4023/index.js'; // no-empty-interface -export { rule as S4030 } from './S4030/index.js'; // no-unused-collection -export { rule as S4036 } from './S4036/index.js'; // no-os-command-from-path -export { rule as S4043 } from './S4043/index.js'; // no-misleading-array-reverse -export { rule as S4084 } from './S4084/index.js'; // media-has-caption -export { rule as S4123 } from './S4123/index.js'; // no-invalid-await -export { rule as S4124 } from './S4124/index.js'; // no-misused-new -export { rule as S4125 } from './S4125/index.js'; // valid-typeof -export { rule as S4136 } from './S4136/index.js'; // adjacent-overload-signatures -export { rule as S4137 } from './S4137/index.js'; // consistent-type-assertions -export { rule as S4138 } from './S4138/index.js'; // prefer-for-of -export { rule as S4139 } from './S4139/index.js'; // no-for-in-iterable -export { rule as S4140 } from './S4140/index.js'; // no-sparse-arrays -export { rule as S4143 } from './S4143/index.js'; // no-element-overwrite -export { rule as S4144 } from './S4144/index.js'; // no-identical-functions -export { rule as S4156 } from './S4156/index.js'; // prefer-namespace-keyword -export { rule as S4157 } from './S4157/index.js'; // no-unnecessary-type-arguments -export { rule as S4158 } from './S4158/index.js'; // no-empty-collection -export { rule as S4165 } from './S4165/index.js'; // no-redundant-assignments -export { rule as S4204 } from './S4204/index.js'; // no-explicit-any -export { rule as S4275 } from './S4275/index.js'; // no-accessor-field-mismatch -export { rule as S4322 } from './S4322/index.js'; // prefer-type-guard -export { rule as S4323 } from './S4323/index.js'; // use-type-alias -export { rule as S4324 } from './S4324/index.js'; // no-return-type-any -export { rule as S4325 } from './S4325/index.js'; // no-unnecessary-type-assertion -export { rule as S4326 } from './S4326/index.js'; // no-return-await -export { rule as S4327 } from './S4327/index.js'; // no-this-alias -export { rule as S4328 } from './S4328/index.js'; // no-implicit-dependencies -export { rule as S4335 } from './S4335/index.js'; // no-useless-intersection -export { rule as S4423 } from './S4423/index.js'; // weak-ssl -export { rule as S4426 } from './S4426/index.js'; // no-weak-keys -export { rule as S4502 } from './S4502/index.js'; // csrf -export { rule as S4507 } from './S4507/index.js'; // production-debug -export { rule as S4524 } from './S4524/index.js'; // prefer-default-last -export { rule as S4619 } from './S4619/index.js'; // no-in-misuse -export { rule as S4621 } from './S4621/index.js'; // no-duplicate-in-composite -export { rule as S4622 } from './S4622/index.js'; // max-union-size -export { rule as S4623 } from './S4623/index.js'; // no-undefined-argument -export { rule as S4624 } from './S4624/index.js'; // no-nested-template-literals -export { rule as S4634 } from './S4634/index.js'; // prefer-promise-shorthand -export { rule as S4721 } from './S4721/index.js'; // os-command -export { rule as S4782 } from './S4782/index.js'; // no-redundant-optional -export { rule as S4784 } from './S4784/index.js'; // regular-expr -export { rule as S4787 } from './S4787/index.js'; // encryption -export { rule as S4790 } from './S4790/index.js'; // hashing -export { rule as S4798 } from './S4798/index.js'; // bool-param-default -export { rule as S4817 } from './S4817/index.js'; // xpath -export { rule as S4818 } from './S4818/index.js'; // sockets -export { rule as S4822 } from './S4822/index.js'; // no-try-promise -export { rule as S4823 } from './S4823/index.js'; // process-argv -export { rule as S4829 } from './S4829/index.js'; // standard-input -export { rule as S4830 } from './S4830/index.js'; // unverified-certificate -export { rule as S5042 } from './S5042/index.js'; // no-unsafe-unzip -export { rule as S5122 } from './S5122/index.js'; // cors -export { rule as S5148 } from './S5148/index.js'; // link-with-target-blank -export { rule as S5247 } from './S5247/index.js'; // disabled-auto-escaping -export { rule as S5254 } from './S5254/index.js'; // html-has-lang -export { rule as S5256 } from './S5256/index.js'; // table-header -export { rule as S5257 } from './S5257/index.js'; // no-table-as-layout -export { rule as S5260 } from './S5260/index.js'; // table-header-reference -export { rule as S5264 } from './S5264/index.js'; // object-alt-content -export { rule as S5332 } from './S5332/index.js'; // no-clear-text-protocols -export { rule as S5443 } from './S5443/index.js'; // publicly-writable-directories -export { rule as S5527 } from './S5527/index.js'; // unverified-hostname -export { rule as S5542 } from './S5542/index.js'; // encryption-secure-mode -export { rule as S5547 } from './S5547/index.js'; // no-weak-cipher -export { rule as S5604 } from './S5604/index.js'; // no-intrusive-permissions -export { rule as S5659 } from './S5659/index.js'; // insecure-jwt-token -export { rule as S5689 } from './S5689/index.js'; // x-powered-by -export { rule as S5691 } from './S5691/index.js'; // hidden-files -export { rule as S5693 } from './S5693/index.js'; // content-length -export { rule as S5725 } from './S5725/index.js'; // disabled-resource-integrity -export { rule as S5728 } from './S5728/index.js'; // content-security-policy -export { rule as S5730 } from './S5730/index.js'; // no-mixed-content -export { rule as S5732 } from './S5732/index.js'; // frame-ancestors -export { rule as S5734 } from './S5734/index.js'; // no-mime-sniff -export { rule as S5736 } from './S5736/index.js'; // no-referrer-policy -export { rule as S5739 } from './S5739/index.js'; // strict-transport-security -export { rule as S5742 } from './S5742/index.js'; // certificate-transparency -export { rule as S5743 } from './S5743/index.js'; // dns-prefetching -export { rule as S5757 } from './S5757/index.js'; // confidential-information-logging -export { rule as S5759 } from './S5759/index.js'; // no-ip-forward -export { rule as S5842 } from './S5842/index.js'; // empty-string-repetition -export { rule as S5843 } from './S5843/index.js'; // regex-complexity -export { rule as S5850 } from './S5850/index.js'; // anchor-precedence -export { rule as S5852 } from './S5852/index.js'; // slow-regex -export { rule as S5856 } from './S5856/index.js'; // no-invalid-regexp -export { rule as S5860 } from './S5860/index.js'; // unused-named-groups -export { rule as S5863 } from './S5863/index.js'; // no-same-argument-assert -export { rule as S5867 } from './S5867/index.js'; // unicode-aware-regex -export { rule as S5868 } from './S5868/index.js'; // no-misleading-character-class -export { rule as S5869 } from './S5869/index.js'; // duplicates-in-character-class -export { rule as S5876 } from './S5876/index.js'; // session-regeneration -export { rule as S5958 } from './S5958/index.js'; // test-check-exception -export { rule as S5973 } from './S5973/index.js'; // stable-tests -export { rule as S6019 } from './S6019/index.js'; // no-empty-after-reluctant -export { rule as S6035 } from './S6035/index.js'; // single-character-alternation -export { rule as S6079 } from './S6079/index.js'; // no-code-after-done -export { rule as S6080 } from './S6080/index.js'; // disabled-timeout -export { rule as S6092 } from './S6092/index.js'; // chai-determinate-assertion -export { rule as S6245 } from './S6245/index.js'; // aws-s3-bucket-server-encryption -export { rule as S6249 } from './S6249/index.js'; // aws-s3-bucket-insecure-http -export { rule as S6252 } from './S6252/index.js'; // aws-s3-bucket-versioning -export { rule as S6265 } from './S6265/index.js'; // aws-s3-bucket-granted-access -export { rule as S6268 } from './S6268/index.js'; // no-angular-bypass-sanitization -export { rule as S6270 } from './S6270/index.js'; // aws-iam-public-access -export { rule as S6275 } from './S6275/index.js'; // aws-ec2-unencrypted-ebs-volume -export { rule as S6281 } from './S6281/index.js'; // aws-s3-bucket-public-access -export { rule as S6299 } from './S6299/index.js'; // no-vue-bypass-sanitization -export { rule as S6302 } from './S6302/index.js'; // aws-iam-all-privileges -export { rule as S6303 } from './S6303/index.js'; // aws-rds-unencrypted-databases -export { rule as S6304 } from './S6304/index.js'; // aws-iam-all-resources-accessible -export { rule as S6308 } from './S6308/index.js'; // aws-opensearchservice-domain -export { rule as S6317 } from './S6317/index.js'; // aws-iam-privilege-escalation -export { rule as S6319 } from './S6319/index.js'; // aws-sagemaker-unencrypted-notebook -export { rule as S6321 } from './S6321/index.js'; // aws-restricted-ip-admin-access -export { rule as S6323 } from './S6323/index.js'; // no-empty-alternatives -export { rule as S6324 } from './S6324/index.js'; // no-control-regex -export { rule as S6325 } from './S6325/index.js'; // prefer-regex-literals -export { rule as S6326 } from './S6326/index.js'; // no-regex-spaces -export { rule as S6327 } from './S6327/index.js'; // aws-sns-unencrypted-topics -export { rule as S6328 } from './S6328/index.js'; // existing-groups -export { rule as S6329 } from './S6329/index.js'; // aws-ec2-rds-dms-public -export { rule as S6330 } from './S6330/index.js'; // aws-sqs-unencrypted-queue -export { rule as S6331 } from './S6331/index.js'; // no-empty-group -export { rule as S6332 } from './S6332/index.js'; // aws-efs-unencrypted -export { rule as S6333 } from './S6333/index.js'; // aws-apigateway-public-api -export { rule as S6351 } from './S6351/index.js'; // stateful-regex -export { rule as S6353 } from './S6353/index.js'; // concise-regex -export { rule as S6397 } from './S6397/index.js'; // single-char-in-character-classes -export { rule as S6426 } from './S6426/index.js'; // no-exclusive-tests -export { rule as S6435 } from './S6435/index.js'; // require-render-return -export { rule as S6438 } from './S6438/index.js'; // jsx-no-comment-textnodes -export { rule as S6439 } from './S6439/index.js'; // jsx-no-leaked-render -export { rule as S6440 } from './S6440/index.js'; // rules-of-hooks -export { rule as S6441 } from './S6441/index.js'; // no-unused-class-component-methods -export { rule as S6442 } from './S6442/index.js'; // no-hook-setter-in-body -export { rule as S6443 } from './S6443/index.js'; // no-useless-react-setstate -export { rule as S6477 } from './S6477/index.js'; // jsx-key -export { rule as S6478 } from './S6478/index.js'; // no-unstable-nested-components -export { rule as S6479 } from './S6479/index.js'; // no-array-index-key -export { rule as S6480 } from './S6480/index.js'; // jsx-no-bind -export { rule as S6481 } from './S6481/index.js'; // jsx-no-constructed-context-values -export { rule as S6486 } from './S6486/index.js'; // no-uniq-key -export { rule as S6509 } from './S6509/index.js'; // no-extra-boolean-cast -export { rule as S6522 } from './S6522/index.js'; // no-import-assign -export { rule as S6523 } from './S6523/index.js'; // no-unsafe-optional-chaining -export { rule as S6534 } from './S6534/index.js'; // no-loss-of-precision -export { rule as S6535 } from './S6535/index.js'; // unnecessary-character-escapes -export { rule as S6544 } from './S6544/index.js'; // no-misused-promises -export { rule as S6550 } from './S6550/index.js'; // prefer-literal-enum-member -export { rule as S6551 } from './S6551/index.js'; // no-base-to-string -export { rule as S6557 } from './S6557/index.js'; // prefer-string-starts-ends-with -export { rule as S6564 } from './S6564/index.js'; // redundant-type-aliases -export { rule as S6565 } from './S6565/index.js'; // prefer-return-this-type -export { rule as S6568 } from './S6568/index.js'; // no-confusing-non-null-assertion -export { rule as S6569 } from './S6569/index.js'; // no-unnecessary-type-constraint -export { rule as S6571 } from './S6571/index.js'; // no-redundant-type-constituents -export { rule as S6572 } from './S6572/index.js'; // prefer-enum-initializers -export { rule as S6578 } from './S6578/index.js'; // no-duplicate-enum-values -export { rule as S6582 } from './S6582/index.js'; // prefer-optional-chain -export { rule as S6583 } from './S6583/index.js'; // no-mixed-enums -export { rule as S6590 } from './S6590/index.js'; // prefer-as-const -export { rule as S6594 } from './S6594/index.js'; // prefer-regexp-exec -export { rule as S6598 } from './S6598/index.js'; // prefer-function-type -export { rule as S6606 } from './S6606/index.js'; // prefer-nullish-coalescing -export { rule as S6627 } from './S6627/index.js'; // no-internal-api-use -export { rule as S6635 } from './S6635/index.js'; // no-constructor-return -export { rule as S6637 } from './S6637/index.js'; // no-extra-bind -export { rule as S6638 } from './S6638/index.js'; // no-constant-binary-expression -export { rule as S6643 } from './S6643/index.js'; // no-extend-native -export { rule as S6644 } from './S6644/index.js'; // no-unneeded-ternary -export { rule as S6645 } from './S6645/index.js'; // no-undef-init -export { rule as S6647 } from './S6647/index.js'; // no-useless-constructor -export { rule as S6650 } from './S6650/index.js'; // no-useless-rename -export { rule as S6653 } from './S6653/index.js'; // prefer-object-has-own -export { rule as S6654 } from './S6654/index.js'; // no-proto -export { rule as S6657 } from './S6657/index.js'; // no-octal-escape -export { rule as S6660 } from './S6660/index.js'; // no-lonely-if -export { rule as S6661 } from './S6661/index.js'; // prefer-object-spread -export { rule as S6666 } from './S6666/index.js'; // prefer-spread -export { rule as S6671 } from './S6671/index.js'; // prefer-promise-reject-errors -export { rule as S6676 } from './S6676/index.js'; // no-useless-call -export { rule as S6679 } from './S6679/index.js'; // no-self-compare -export { rule as S6746 } from './S6746/index.js'; // no-direct-mutation-state -export { rule as S6747 } from './S6747/index.js'; // no-unknown-property -export { rule as S6748 } from './S6748/index.js'; // no-children-prop -export { rule as S6749 } from './S6749/index.js'; // jsx-no-useless-fragment -export { rule as S6750 } from './S6750/index.js'; // no-render-return-value -export { rule as S6754 } from './S6754/index.js'; // hook-use-state -export { rule as S6756 } from './S6756/index.js'; // no-access-state-in-setstate -export { rule as S6757 } from './S6757/index.js'; // no-this-in-sfc -export { rule as S6759 } from './S6759/index.js'; // prefer-read-only-props -export { rule as S6761 } from './S6761/index.js'; // no-danger-with-children -export { rule as S6763 } from './S6763/index.js'; // no-redundant-should-component-update -export { rule as S6766 } from './S6766/index.js'; // no-unescaped-entities -export { rule as S6767 } from './S6767/index.js'; // no-unused-prop-types -export { rule as S6770 } from './S6770/index.js'; // jsx-pascal-case -export { rule as S6772 } from './S6772/index.js'; // jsx-child-element-spacing -export { rule as S6774 } from './S6774/index.js'; // prop-types -export { rule as S6775 } from './S6775/index.js'; // default-props-match-prop-types -export { rule as S6788 } from './S6788/index.js'; // no-find-dom-node -export { rule as S6789 } from './S6789/index.js'; // no-is-mounted -export { rule as S6790 } from './S6790/index.js'; // no-string-refs -export { rule as S6791 } from './S6791/index.js'; // no-unsafe -export { rule as S6793 } from './S6793/index.js'; // aria-proptypes -export { rule as S6807 } from './S6807/index.js'; // role-has-required-aria-props -export { rule as S6811 } from './S6811/index.js'; // role-supports-aria-props -export { rule as S6819 } from './S6819/index.js'; // prefer-tag-over-role -export { rule as S6821 } from './S6821/index.js'; // aria-role -export { rule as S6822 } from './S6822/index.js'; // no-redundant-roles -export { rule as S6823 } from './S6823/index.js'; // aria-activedescendant-has-tabindex -export { rule as S6824 } from './S6824/index.js'; // aria-unsupported-elements -export { rule as S6825 } from './S6825/index.js'; // no-aria-hidden-on-focusable -export { rule as S6827 } from './S6827/index.js'; // anchor-has-content -export { rule as S6836 } from './S6836/index.js'; // no-case-declarations -export { rule as S6840 } from './S6840/index.js'; // autocomplete-valid -export { rule as S6841 } from './S6841/index.js'; // tabindex-no-positive -export { rule as S6842 } from './S6842/index.js'; // no-noninteractive-element-to-interactive-role -export { rule as S6843 } from './S6843/index.js'; // no-interactive-element-to-noninteractive-role -export { rule as S6844 } from './S6844/index.js'; // anchor-is-valid -export { rule as S6845 } from './S6845/index.js'; // no-noninteractive-tabindex -export { rule as S6846 } from './S6846/index.js'; // no-access-key -export { rule as S6847 } from './S6847/index.js'; // no-noninteractive-element-interactions -export { rule as S6848 } from './S6848/index.js'; // no-static-element-interactions -export { rule as S6850 } from './S6850/index.js'; // heading-has-content -export { rule as S6851 } from './S6851/index.js'; // img-redundant-alt -export { rule as S6852 } from './S6852/index.js'; // interactive-supports-focus -export { rule as S6853 } from './S6853/index.js'; // label-has-associated-control -export { rule as S6859 } from './S6859/index.js'; // no-absolute-path -export { rule as S6861 } from './S6861/index.js'; // no-mutable-exports -export { rule as S6957 } from './S6957/index.js'; // no-deprecated-react -export { rule as S6958 } from './S6958/index.js'; // no-literal-call -export { rule as S6959 } from './S6959/index.js'; // reduce-initial-value -export { rule as S7059 } from './S7059/index.js'; // no-async-constructor -export { rule as S7060 } from './S7060/index.js'; // no-self-import diff --git a/tools/generate-rule-indexes.ts b/tools/generate-rule-indexes.ts index f60ad17a2ba..d28fe23145a 100644 --- a/tools/generate-rule-indexes.ts +++ b/tools/generate-rule-indexes.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - +import prettier from 'prettier'; import { readdir, writeFile } from 'fs/promises'; import { join, dirname } from 'node:path/posix'; import { fileURLToPath, pathToFileURL } from 'node:url'; @@ -50,6 +50,17 @@ const RULES_FOLDER = join( dirname(toUnixPath(fileURLToPath(import.meta.url))), '../packages/jsts/src/rules/', ); + +const prettierOpts = { + printWidth: 100, + trailingComma: 'all', + singleQuote: true, + arrowParens: 'avoid', + endOfLine: 'lf', +} as const; + +const allRulesIndex = join(RULES_FOLDER, './rules.ts'); +const pluginRulesIndex = join(RULES_FOLDER, './plugin-rules.ts'); const ruleRegex = /^S\d+$/; const allRules: string[] = []; @@ -73,19 +84,25 @@ for (const file of files) { const sonarKeySorter = (a, b) => (parseInt(a.substring(1)) < parseInt(b.substring(1)) ? -1 : 1); await writeFile( - join(RULES_FOLDER, './rules.ts'), - `${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('')}`, + 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, filepath: allRulesIndex }, + ), ); //sort once; pluginRules.sort(sonarKeySorter); await writeFile( - join(RULES_FOLDER, './plugin-rules.ts'), - `${header}\n\n// DO NOT EDIT! This file was generated by generate-rule-indexes.ts\n + 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 = {${pluginRules.map(id => ` "${eslintIds[id]}": ${id},\n`).join('')}};\n`, +export const rules = {\n${pluginRules.map(id => ` '${eslintIds[id]}': ${id},\n`).join('')}};\n`, + { ...prettierOpts, filepath: allRulesIndex }, + ), );