Skip to content

[FSSDK-11503] update build target to ES6 #1055

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

Merged
merged 1 commit into from
May 15, 2025
Merged
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
8 changes: 4 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"target": "ES6",
"module": "ESNext",
"lib": [
"es2015",
"dom"
"ES6",
"DOM",
],
"declaration": true,
"strict": true,

Unchanged files with check annotations Beta

isQualifiedFor: segment => segments ? segments.indexOf(segment) > -1 : false,
qualifiedSegments: segments || [],
getUserId: () => 'mockUserId',
setAttribute: (key: string, value: any) => {},

Check warning on line 33 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / lint

'key' is defined but never used

Check warning on line 33 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / lint

'value' is defined but never used

Check warning on line 33 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / lint

Unexpected any. Specify a different type

Check warning on line 33 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (18)

'key' is defined but never used

Check warning on line 33 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (18)

'value' is defined but never used

Check warning on line 33 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (18)

Unexpected any. Specify a different type

Check warning on line 33 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (20)

'key' is defined but never used

Check warning on line 33 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (20)

'value' is defined but never used

Check warning on line 33 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (20)

Unexpected any. Specify a different type

Check warning on line 33 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (22)

'key' is defined but never used

Check warning on line 33 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (22)

'value' is defined but never used

Check warning on line 33 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (22)

Unexpected any. Specify a different type
decide: (key: string, options?: OptimizelyDecideOption[]): OptimizelyDecision => ({

Check warning on line 35 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / lint

'key' is defined but never used

Check warning on line 35 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / lint

'options' is defined but never used

Check warning on line 35 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (18)

'key' is defined but never used

Check warning on line 35 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (18)

'options' is defined but never used

Check warning on line 35 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (20)

'key' is defined but never used

Check warning on line 35 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (20)

'options' is defined but never used

Check warning on line 35 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (22)

'key' is defined but never used

Check warning on line 35 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (22)

'options' is defined but never used
variationKey: 'mockVariationKey',
enabled: true,
variables: { mockVariable: 'mockValue' },
});
it('calls customAttributeConditionEvaluator.evaluate in the leaf evaluator for audience conditions', () => {
vi.spyOn(conditionTreeEvaluator, 'evaluate').mockImplementation((conditions: any, leafEvaluator) => {

Check warning on line 253 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / lint

Unexpected any. Specify a different type

Check warning on line 253 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (18)

Unexpected any. Specify a different type

Check warning on line 253 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (20)

Unexpected any. Specify a different type

Check warning on line 253 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (22)

Unexpected any. Specify a different type
return leafEvaluator(conditions[1]);
});
});
it('logs correctly when conditionTreeEvaluator.evaluate returns null', () => {
vi.spyOn(conditionTreeEvaluator, 'evaluate').mockImplementationOnce((conditions: any, leafEvaluator) => {

Check warning on line 295 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / lint

Unexpected any. Specify a different type

Check warning on line 295 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (18)

Unexpected any. Specify a different type

Check warning on line 295 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (20)

Unexpected any. Specify a different type

Check warning on line 295 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (22)

Unexpected any. Specify a different type
return leafEvaluator(conditions[1]);
});
});
it('logs correctly when conditionTreeEvaluator.evaluate returns true', () => {
vi.spyOn(conditionTreeEvaluator, 'evaluate').mockImplementationOnce((conditions: any, leafEvaluator) => {

Check warning on line 322 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / lint

Unexpected any. Specify a different type

Check warning on line 322 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (18)

Unexpected any. Specify a different type

Check warning on line 322 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (20)

Unexpected any. Specify a different type

Check warning on line 322 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (22)

Unexpected any. Specify a different type
return leafEvaluator(conditions[1]);
});
});
it('logs correctly when conditionTreeEvaluator.evaluate returns false', () => {
vi.spyOn(conditionTreeEvaluator, 'evaluate').mockImplementationOnce((conditions: any, leafEvaluator) => {

Check warning on line 348 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / lint

Unexpected any. Specify a different type

Check warning on line 348 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (18)

Unexpected any. Specify a different type

Check warning on line 348 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (20)

Unexpected any. Specify a different type

Check warning on line 348 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (22)

Unexpected any. Specify a different type
return leafEvaluator(conditions[1]);
});
};
audienceEvaluator = createAudienceEvaluator({
special_condition_type: {
evaluate: (condition: any, user: any) => {

Check warning on line 384 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / lint

Unexpected any. Specify a different type

Check warning on line 384 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (18)

Unexpected any. Specify a different type

Check warning on line 384 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (20)

Unexpected any. Specify a different type

Check warning on line 384 in lib/core/audience_evaluator/index.spec.ts

GitHub Actions / unit_tests (22)

Unexpected any. Specify a different type
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const result = mockEnvironment[condition.value] && user.getAttributes()[condition.match] > 0;