Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit f62edbb

Browse files
Fix retrieval of rule names (#255)
1 parent 49a65c0 commit f62edbb

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

src/index.ts

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,43 @@
1717
* along with this program; if not, write to the Free Software Foundation,
1818
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1919
*/
20-
import * as fs from 'fs';
21-
import * as path from 'path';
2220
import { TSESLint } from '@typescript-eslint/experimental-utils';
2321

24-
const sonarjsRules: string[] = fs
25-
.readdirSync(path.join(__dirname, 'rules'))
26-
.map(filename => filename.substr(0, filename.lastIndexOf('.ts')));
22+
const sonarjsRules: string[] = [
23+
'cognitive-complexity',
24+
'elseif-without-else',
25+
'generator-without-yield',
26+
'max-switch-cases',
27+
'no-all-duplicated-branches',
28+
'no-collapsible-if',
29+
'no-collection-size-mischeck',
30+
'no-duplicate-string',
31+
'no-duplicated-branches',
32+
'no-element-overwrite',
33+
'no-empty-collection',
34+
'no-extra-arguments',
35+
'no-gratuitous-expressions',
36+
'no-identical-conditions',
37+
'no-identical-expressions',
38+
'no-identical-functions',
39+
'no-ignored-return',
40+
'no-inverted-boolean-check',
41+
'no-nested-switch',
42+
'no-nested-template-literals',
43+
'no-one-iteration-loop',
44+
'no-redundant-boolean',
45+
'no-redundant-jump',
46+
'no-same-line-conditional',
47+
'no-small-switch',
48+
'no-unused-collection',
49+
'no-use-of-empty-return-value',
50+
'no-useless-catch',
51+
'non-existent-operator',
52+
'prefer-immediate-return',
53+
'prefer-object-literal',
54+
'prefer-single-boolean-return',
55+
'prefer-while',
56+
];
2757

2858
const sonarjsRuleModules: { [key: string]: any } = {};
2959

0 commit comments

Comments
 (0)