Skip to content

Commit

Permalink
Merge pull request #14 from yoriiis/esm-ts
Browse files Browse the repository at this point in the history
Transform to TypeScript
  • Loading branch information
yoriiis committed May 30, 2023
2 parents f2afff2 + 8b32b92 commit 8d0e5a3
Show file tree
Hide file tree
Showing 10 changed files with 587 additions and 96 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
coverage
coverage
types
lib
7 changes: 5 additions & 2 deletions config/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
parser: '@babel/eslint-parser',
parser: '@typescript-eslint/parser',
parserOptions: {
requireConfigFile: false,
ecmaVersion: 6,
Expand All @@ -17,7 +17,7 @@ module.exports = {
jest: true
},

extends: ['standard', 'plugin:prettier/recommended'],
extends: ['standard', 'plugin:prettier/recommended', 'plugin:@typescript-eslint/recommended'],

rules: {
indent: ['error', 'tab', { ignoredNodes: ['TemplateLiteral *'], SwitchCase: 1 }],
Expand All @@ -26,6 +26,9 @@ module.exports = {
'error',
{ anonymous: 'always', named: 'never', asyncArrow: 'always' }
],
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'linebreak-style': ['error', 'unix']
},

Expand Down
7 changes: 5 additions & 2 deletions config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
export default {
moduleFileExtensions: ['js'],
moduleFileExtensions: ['js', 'ts'],
extensionsToTreatAsEsm: ['.ts'],
modulePaths: ['<rootDir>/src'],
verbose: true,
coverageDirectory: 'coverage',
testMatch: ['<rootDir>/tests/*.test.js'],
rootDir: '../',
transform: {},
transform: {
'\\.(js|ts)$': ['ts-jest', { configFile: './config/babel.config.js', useESM: true }]
},
testEnvironment: 'jsdom',
resetModules: true,
resetMocks: true,
Expand Down

0 comments on commit 8d0e5a3

Please sign in to comment.