Skip to content

Commit 72bb169

Browse files
committed
Merge branch 'master' into feature/SDK-121-upgrade-jest
Set CI=true for the circular dependency pre-commit hook so dpdm's ora spinner does not hang on stdin when lefthook runs the job in parallel. Without this, the hook deadlocks during merge commits.
2 parents 510dd2e + 05c8e67 commit 72bb169

8 files changed

Lines changed: 658 additions & 143 deletions

File tree

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
- name: Typecheck files
2727
run: yarn typecheck
2828

29+
- name: Check circular dependencies
30+
run: yarn check:circular
31+
2932
test:
3033
runs-on: ubuntu-latest
3134
steps:

eslint.config.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
const reactNativeConfig = require('@react-native/eslint-config/flat');
2+
const tsEslintPlugin = require('@typescript-eslint/eslint-plugin');
3+
const reactPlugin = require('eslint-plugin-react');
4+
const reactNativePlugin = require('eslint-plugin-react-native');
5+
const tsdoc = require('eslint-plugin-tsdoc');
6+
7+
const typescriptFiles = ['**/*.ts', '**/*.tsx'];
8+
const [, tsEslintRecommended, tsRecommended] =
9+
tsEslintPlugin.configs['flat/recommended'];
10+
11+
module.exports = [
12+
{
13+
ignores: ['coverage/**/*', 'lib/**/*', 'docs/**/*'],
14+
},
15+
...reactNativeConfig,
16+
reactPlugin.configs.flat.recommended,
17+
{
18+
plugins: {
19+
'react-native': reactNativePlugin,
20+
},
21+
rules: reactNativePlugin.configs.all.rules,
22+
},
23+
{
24+
rules: {
25+
'react/react-in-jsx-scope': 'off',
26+
},
27+
},
28+
{
29+
...tsEslintRecommended,
30+
files: typescriptFiles,
31+
},
32+
{
33+
...tsRecommended,
34+
files: typescriptFiles,
35+
},
36+
{
37+
files: typescriptFiles,
38+
plugins: {
39+
tsdoc,
40+
},
41+
languageOptions: {
42+
parserOptions: {
43+
project: true,
44+
tsconfigRootDir: __dirname,
45+
},
46+
},
47+
rules: {
48+
'@typescript-eslint/no-var-requires': [
49+
'error',
50+
{ allow: ['/package\\.json$'] },
51+
],
52+
'@typescript-eslint/no-require-imports': [
53+
'error',
54+
{ allow: ['/package\\.json$'] },
55+
],
56+
'tsdoc/syntax': 'warn',
57+
},
58+
},
59+
{
60+
files: [
61+
'**/*.test.{js,ts,tsx}',
62+
'**/__mocks__/*',
63+
'**/__tests__/*',
64+
],
65+
rules: {
66+
'@typescript-eslint/no-var-requires': 'off',
67+
'@typescript-eslint/no-require-imports': 'off',
68+
},
69+
},
70+
];

lefthook.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ pre-commit:
77
types:
88
glob: "*.{js,ts,jsx,tsx}"
99
run: npx tsc
10+
circular:
11+
glob: "src/**/*.{ts,tsx}"
12+
env:
13+
CI: "true"
14+
run: yarn check:circular
1015
# version-check:
1116
# glob: "package.json"
1217
# run: node scripts/checkVersionAndUpdateBuildInfo.js

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"test:coverage": "jest --coverage",
4242
"typecheck": "tsc",
4343
"lint": "eslint \"**/*.{js,ts,tsx}\"",
44+
"check:circular": "dpdm --no-warning --no-tree -T --circular --exit-code circular:1 src/index.tsx",
4445
"docs": "typedoc",
4546
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
4647
"prebuild": "yarn add_build_info",
@@ -86,11 +87,12 @@
8687
"baseline-browser-mapping": "^2.10.29",
8788
"commitlint": "^19.6.1",
8889
"del-cli": "^5.1.0",
89-
"eslint": "^8.51.0",
90+
"dpdm": "^4.2.0",
91+
"eslint": "^9.39.5",
9092
"eslint-config-prettier": "^10.1.8",
91-
"eslint-plugin-jest": "^28.9.0",
93+
"eslint-plugin-jest": "^29.0.1",
9294
"eslint-plugin-prettier": "^5.0.1",
93-
"eslint-plugin-tsdoc": "^0.3.0",
95+
"eslint-plugin-tsdoc": "^0.5.2",
9496
"jest": "^29.7.0",
9597
"prettier": "^3.0.3",
9698
"prettier-eslint": "^16.4.2",
@@ -112,7 +114,8 @@
112114
"resolutions": {
113115
"@types/react": "^19.2.0",
114116
"babel-jest": "29.7.0",
115-
"jest-environment-node": "29.7.0"
117+
"jest-environment-node": "29.7.0",
118+
"eslint-plugin-ft-flow": "^3.0.11"
116119
},
117120
"peerDependencies": {
118121
"@react-navigation/native": "*",

src/core/classes/IterableConfig.ts

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -449,47 +449,30 @@ export class IterableConfig {
449449
inAppDisplayInterval: this.inAppDisplayInterval,
450450
/**
451451
* A boolean indicating if a URL handler is present.
452-
*
453-
* TODO: Figure out if this is purposeful
454452
*/
455-
// eslint-disable-next-line eqeqeq
456-
urlHandlerPresent: this.urlHandler != undefined,
453+
urlHandlerPresent: this.urlHandler !== undefined,
457454
/**
458455
* A boolean indicating if a custom action handler is present.
459-
*
460-
* TODO: Figure out if this is purposeful
461456
*/
462-
// eslint-disable-next-line eqeqeq
463-
customActionHandlerPresent: this.customActionHandler != undefined,
457+
customActionHandlerPresent: this.customActionHandler !== undefined,
464458
/**
465459
* A boolean indicating if an in-app handler is present.
466-
*
467-
* TODO: Figure out if this is purposeful
468460
*/
469-
// eslint-disable-next-line eqeqeq
470-
inAppHandlerPresent: this.inAppHandler != undefined,
461+
inAppHandlerPresent: this.inAppHandler !== undefined,
471462
/**
472463
* A boolean indicating if an authentication handler is present.
473-
*
474-
* TODO: Figure out if this is purposeful
475464
*/
476-
// eslint-disable-next-line eqeqeq
477-
authHandlerPresent: this.authHandler != undefined,
465+
authHandlerPresent: this.authHandler !== undefined,
478466
/**
479467
* A boolean indicating if an embedded message update callback is present.
480-
*
481-
* TODO: Figure out if this is purposeful
482468
*/
483-
// eslint-disable-next-line eqeqeq
484-
onEmbeddedMessageUpdatePresent: this.onEmbeddedMessageUpdate != undefined,
469+
onEmbeddedMessageUpdatePresent:
470+
this.onEmbeddedMessageUpdate !== undefined,
485471
/**
486472
* A boolean indicating if an embedded messaging disabled callback is present.
487-
*
488-
* TODO: Figure out if this is purposeful
489473
*/
490-
// eslint-disable-next-line eqeqeq
491474
onEmbeddedMessagingDisabledPresent:
492-
this.onEmbeddedMessagingDisabled != undefined,
475+
this.onEmbeddedMessagingDisabled !== undefined,
493476
/** The log level for the SDK. */
494477
logLevel: this.logLevel,
495478
expiringAuthTokenRefreshPeriod: this.expiringAuthTokenRefreshPeriod,

0 commit comments

Comments
 (0)