Skip to content

Commit

Permalink
add eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
christiansiegel committed Feb 17, 2021
1 parent 29f261d commit 1475b56
Show file tree
Hide file tree
Showing 10 changed files with 853 additions and 590 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
extends: ['plugin:@typescript-eslint/recommended', 'prettier/@typescript-eslint', 'plugin:prettier/recommended'],
rules: {},
};
7 changes: 7 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
semi: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 120,
tabWidth: 2,
};
6 changes: 3 additions & 3 deletions functions/deep-equal.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use strict";
'use strict';

module.exports = (actual, {expected}) => {
module.exports = (actual, { expected }) => {
if (JSON.stringify(actual) !== JSON.stringify(expected)) {
return [
{
message: `${JSON.stringify(actual)} must equal ${JSON.stringify(expected)}.`,
},
];
}
};
};
4 changes: 2 additions & 2 deletions functions/my-own-equal-func.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use strict";
'use strict';

module.exports = (targetVal, opts) => {
const { value } = opts;
Expand All @@ -9,4 +9,4 @@ module.exports = (targetVal, opts) => {
},
];
}
};
};
14 changes: 7 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
roots: ['<rootDir>/tests'],
transform: {
'^.+\\.ts$': 'ts-jest',
},
testRegex: '^.+\\.test\\.ts$',
moduleFileExtensions: ['ts','js'],
};
roots: ['<rootDir>/tests'],
transform: {
'^.+\\.ts$': 'ts-jest',
},
testRegex: '^.+\\.test\\.ts$',
moduleFileExtensions: ['ts', 'js'],
};
Loading

0 comments on commit 1475b56

Please sign in to comment.