Skip to content

Commit

Permalink
chore(lint): update linting rules (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath authored and SimenB committed Jul 25, 2019
1 parent 0a0f20e commit 1992b3d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.js
Expand Up @@ -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',
Expand All @@ -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,
Expand All @@ -55,6 +65,7 @@ module.exports = {
{
files: ['.eslintrc.js', 'babel.config.js'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
'import/no-commonjs': 'off',
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-if.ts
Expand Up @@ -34,7 +34,7 @@ export default createRule({
},
defaultOptions: [],
create(context) {
const stack: Array<boolean> = [];
const stack: boolean[] = [];

function validate(
node: TSESTree.ConditionalExpression | TSESTree.IfStatement,
Expand Down
3 changes: 1 addition & 2 deletions src/rules/no-large-snapshots.js
Expand Up @@ -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;
});
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/rules/valid-expect-in-promise.js
Expand Up @@ -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 => {
Expand Down

0 comments on commit 1992b3d

Please sign in to comment.