Skip to content

Commit

Permalink
Fix retrieval of rule names (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
yassin-kammoun-sonarsource committed Jul 2, 2021
1 parent 49a65c0 commit f62edbb
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,43 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as fs from 'fs';
import * as path from 'path';
import { TSESLint } from '@typescript-eslint/experimental-utils';

const sonarjsRules: string[] = fs
.readdirSync(path.join(__dirname, 'rules'))
.map(filename => filename.substr(0, filename.lastIndexOf('.ts')));
const sonarjsRules: string[] = [
'cognitive-complexity',
'elseif-without-else',
'generator-without-yield',
'max-switch-cases',
'no-all-duplicated-branches',
'no-collapsible-if',
'no-collection-size-mischeck',
'no-duplicate-string',
'no-duplicated-branches',
'no-element-overwrite',
'no-empty-collection',
'no-extra-arguments',
'no-gratuitous-expressions',
'no-identical-conditions',
'no-identical-expressions',
'no-identical-functions',
'no-ignored-return',
'no-inverted-boolean-check',
'no-nested-switch',
'no-nested-template-literals',
'no-one-iteration-loop',
'no-redundant-boolean',
'no-redundant-jump',
'no-same-line-conditional',
'no-small-switch',
'no-unused-collection',
'no-use-of-empty-return-value',
'no-useless-catch',
'non-existent-operator',
'prefer-immediate-return',
'prefer-object-literal',
'prefer-single-boolean-return',
'prefer-while',
];

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

Expand Down

0 comments on commit f62edbb

Please sign in to comment.