diff --git a/babel.config.js b/babel.config.js index f7b3da3..8353a5c 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,7 @@ module.exports = { - presets: ['module:@react-native/babel-preset'], + presets: [ + ['@babel/preset-env', { targets: { node: 'current' } }], + '@babel/preset-react', + '@babel/preset-typescript', + ], }; diff --git a/package.json b/package.json index 86167e0..fa27d51 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,9 @@ "node": ">= 18.0.0" }, "jest": { - "preset": "react-native", + "transform": { + "^.+\\.[tj]sx?$": "babel-jest" + }, "modulePathIgnorePatterns": [ "/example/node_modules", "/lib/" @@ -124,10 +126,18 @@ }, "eslintConfig": { "root": true, + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint", "prettier"], "extends": [ - "@react-native", + "eslint:recommended", + "plugin:@typescript-eslint/recommended", "prettier" ], + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module", + "ecmaFeatures": { "jsx": true } + }, "rules": { "prettier/prettier": [ "error", @@ -138,12 +148,19 @@ "trailingComma": "es5", "useTabs": false } - ] + ], + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/no-var-requires": "off" } }, "eslintIgnore": [ "node_modules/", - "lib/" + "lib/", + "babel.config.js", + "example/", + "watch-example/" ], "prettier": { "quoteProps": "consistent", diff --git a/src/__tests__/index.test.ts b/src/__tests__/index.test.ts new file mode 100644 index 0000000..866a051 --- /dev/null +++ b/src/__tests__/index.test.ts @@ -0,0 +1,5 @@ +describe('basic test', () => { + it('passes', () => { + expect(1 + 1).toBe(2); + }); +}); diff --git a/src/__tests__/index.test.tsx b/src/__tests__/index.test.tsx deleted file mode 100644 index bf84291..0000000 --- a/src/__tests__/index.test.tsx +++ /dev/null @@ -1 +0,0 @@ -it.todo('write a test'); diff --git a/src/utilities.ts b/src/utilities.ts deleted file mode 100644 index e69de29..0000000