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

Migrate Reselect source to TS #511

Merged
merged 11 commits into from
Oct 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
const { BABEL_ENV, NODE_ENV } = process.env
const cjs = BABEL_ENV === 'cjs' || NODE_ENV === 'test'
const { NODE_ENV, BABEL_ENV } = process.env
const cjs = NODE_ENV === 'test' || BABEL_ENV === 'commonjs'

module.exports = {
presets: [
['@babel/env', { loose: true, modules: cjs ? 'cjs' : false }]
[
'@babel/preset-env',
{
targets: {
ie: 11
},
loose: true,
modules: cjs ? 'cjs' : false
}
],
'@babel/preset-typescript'
],
plugins: [cjs && ['@babel/transform-modules-commonjs']].filter(Boolean)
}
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lib
es
dist
node_modules
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: npm run test:cov

- name: Compile
run: npm run compile
run: npm run build

- name: Report to Coveralls
uses: coverallsapp/github-action@master
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ typescript_test/should_not_compile/index.js
typescript_test/common.js
flow_test/should_fail/flow-typed/index.js.flow
flow_test/should_pass/flow-typed/index.js.flow
reselect-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/.*(js|ts))$',
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json'
}
}
}
Loading