diff --git a/.eslintrc.js b/.eslintrc.js index 54819e030..532191d4d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,6 +25,10 @@ module.exports = { es6: true, }, rules: { + '@typescript-eslint/array-type': ['error', 'array-simple'], + '@typescript-eslint/no-require-imports': 'error', + '@typescript-eslint/ban-ts-ignore': 'warn', + 'no-else-return': 'error', eqeqeq: ['error', 'smart'], strict: 'error', 'prefer-template': 'warn', @@ -42,6 +46,12 @@ module.exports = { 'import/no-extraneous-dependencies': 'error', }, overrides: [ + { + files: ['*.js'], + rules: { + '@typescript-eslint/no-require-imports': 'off', + }, + }, { files: ['*.test.js', '*.test.ts'], globals, @@ -55,6 +65,7 @@ module.exports = { { files: ['.eslintrc.js', 'babel.config.js'], rules: { + '@typescript-eslint/no-require-imports': 'off', 'import/no-commonjs': 'off', }, }, diff --git a/src/rules/no-if.ts b/src/rules/no-if.ts index f08daa375..e448a882c 100644 --- a/src/rules/no-if.ts +++ b/src/rules/no-if.ts @@ -34,7 +34,7 @@ export default createRule({ }, defaultOptions: [], create(context) { - const stack: Array = []; + const stack: boolean[] = []; function validate( node: TSESTree.ConditionalExpression | TSESTree.IfStatement, diff --git a/src/rules/no-large-snapshots.js b/src/rules/no-large-snapshots.js index dd06edbd4..5edc08c49 100644 --- a/src/rules/no-large-snapshots.js +++ b/src/rules/no-large-snapshots.js @@ -35,9 +35,8 @@ const reportOnViolation = (context, node) => { isWhitelisted = whitelistedSnapshotsInFile.some(name => { if (name.test && typeof name.test === 'function') { return name.test(snapshotName); - } else { - return name === snapshotName; } + return name === snapshotName; }); } } diff --git a/src/rules/valid-expect-in-promise.js b/src/rules/valid-expect-in-promise.js index 202618b7b..f13977093 100644 --- a/src/rules/valid-expect-in-promise.js +++ b/src/rules/valid-expect-in-promise.js @@ -14,9 +14,8 @@ const isExpectCallPresentInFunction = body => { return isExpectCall(line.expression); if (line.type === 'ReturnStatement') return isExpectCall(line.argument); }); - } else { - return isExpectCall(body); } + return isExpectCall(body); }; const isExpectCall = expression => {