Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert codebase to TS and update build tooling #322

Merged
merged 11 commits into from
Oct 24, 2021
9 changes: 0 additions & 9 deletions .babelrc

This file was deleted.

19 changes: 19 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { NODE_ENV, BABEL_ENV } = process.env
const cjs = NODE_ENV === 'test' || BABEL_ENV === 'commonjs'

module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
ie: 11
},
loose: true,
modules: cjs ? 'cjs' : false
}
],
'@babel/preset-typescript'
],
plugins: [cjs && ['@babel/transform-modules-commonjs']].filter(Boolean)
}
9 changes: 7 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"extends": [
"eslint-config-airbnb",
"prettier",
"plugin:@typescript-eslint/recommended"
],
Expand All @@ -21,6 +20,12 @@
"no-use-before-define": [2, "nofunc"],
"no-unused-expressions": 0,
"import/no-unresolved": 0,
"import/named": 0
"import/named": 0,
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/member-delimiter-style": 0,
"@typescript-eslint/no-use-before-define": 1,
"@typescript-eslint/camelcase": 0
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ coverage
lib
dist
es
builds/
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"arrowParens": "avoid"
}
14 changes: 14 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */

module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
coverageDirectory: './coverage/',
collectCoverage: true,
testRegex: 'test/test.ts',
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
};
Loading