Skip to content

Commit 3a68da3

Browse files
authored
chore: Apply linting to root of project. (#557)
There is a `check` command at the root, it lints things that are out of scope of the individual linters. After this baseline we may want to consider updating some of the per-project linting rules. This linting is in its own chore PR to prevent creating a release for these changes.
1 parent fd0c144 commit 3a68da3

File tree

31 files changed

+82
-112
lines changed

31 files changed

+82
-112
lines changed

.sdk_metadata.json

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
"name": "Akamai SDK",
66
"type": "edge",
77
"path": "packages/sdk/akamai-base",
8-
"languages": [
9-
"JavaScript",
10-
"TypeScript"
11-
],
8+
"languages": ["JavaScript", "TypeScript"],
129
"releases": {
1310
"tag-prefix": "akamai-server-base-sdk-"
1411
}
@@ -17,10 +14,7 @@
1714
"name": "Akamai SDK for EdgeKV",
1815
"type": "edge",
1916
"path": "packages/sdk/akamai-edgekv",
20-
"languages": [
21-
"JavaScript",
22-
"TypeScript"
23-
],
17+
"languages": ["JavaScript", "TypeScript"],
2418
"releases": {
2519
"tag-prefix": "akamai-server-edgekv-sdk-"
2620
}
@@ -29,10 +23,7 @@
2923
"name": "Cloudflare SDK",
3024
"type": "edge",
3125
"path": "packages/sdk/cloudflare",
32-
"languages": [
33-
"JavaScript",
34-
"TypeScript"
35-
],
26+
"languages": ["JavaScript", "TypeScript"],
3627
"releases": {
3728
"tag-prefix": "cloudflare-server-sdk-"
3829
}
@@ -41,10 +32,7 @@
4132
"name": "React Native SDK",
4233
"type": "client-side",
4334
"path": "packages/sdk/react-native",
44-
"languages": [
45-
"JavaScript",
46-
"TypeScript"
47-
],
35+
"languages": ["JavaScript", "TypeScript"],
4836
"releases": {
4937
"tag-prefix": "react-native-client-sdk-"
5038
}
@@ -53,10 +41,7 @@
5341
"name": "Node.js Server SDK",
5442
"type": "server-side",
5543
"path": "packages/sdk/server-node",
56-
"languages": [
57-
"JavaScript",
58-
"TypeScript"
59-
],
44+
"languages": ["JavaScript", "TypeScript"],
6045
"releases": {
6146
"tag-prefix": "node-server-sdk-"
6247
}
@@ -65,10 +50,7 @@
6550
"name": "Vercel Edge SDK",
6651
"type": "edge",
6752
"path": "packages/sdk/vercel",
68-
"languages": [
69-
"JavaScript",
70-
"TypeScript"
71-
],
53+
"languages": ["JavaScript", "TypeScript"],
7254
"releases": {
7355
"tag-prefix": "vercel-server-sdk-"
7456
}

PROVENANCE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages.
44

5-
As part of [SLSA requirements for level 3 compliance](https://slsa.dev/spec/v1.0/requirements), LaunchDarkly publishes provenance attestations about our SDK package builds to npm for distribution alongside our packages.
5+
As part of [SLSA requirements for level 3 compliance](https://slsa.dev/spec/v1.0/requirements), LaunchDarkly publishes provenance attestations about our SDK package builds to npm for distribution alongside our packages.
66

7-
For npm packages that are published with provenance, npm automatically [verifies the authenticity of the package using Sigstore](https://docs.npmjs.com/generating-provenance-statements#about-npm-provenance).
7+
For npm packages that are published with provenance, npm automatically [verifies the authenticity of the package using Sigstore](https://docs.npmjs.com/generating-provenance-statements#about-npm-provenance).

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ This includes shared libraries, used by SDKs and other tools, as well as SDKs.
2626
| [@launchdarkly/node-server-sdk-redis](packages/store/node-server-sdk-redis/README.md) | [![NPM][node-redis-npm-badge]][node-redis-npm-link] | [Node Redis][node-redis-issues] | [![Actions Status][node-redis-ci-badge]][node-redis-ci] |
2727
| [@launchdarkly/node-server-sdk-dynamodb](packages/store/node-server-sdk-dynamodb/README.md) | [![NPM][node-dynamodb-npm-badge]][node-dynamodb-npm-link] | [Node DynamoDB][node-dynamodb-issues] | [![Actions Status][node-dynamodb-ci-badge]][node-dynamodb-ci] |
2828

29-
| Telemetry Packages | npm | issues | tests |
30-
| ------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ------------------------------------- | ------------------------------------------------------------- |
31-
| [@launchdarkly/node-server-sdk-otel](packages/telemetry/node-server-sdk-otel/README.md) | [![NPM][node-otel-npm-badge]][node-otel-npm-link] | [Node OTel][node-otel-issues] | [![Actions Status][node-otel-ci-badge]][node-otel-ci] |
29+
| Telemetry Packages | npm | issues | tests |
30+
| --------------------------------------------------------------------------------------- | ------------------------------------------------- | ----------------------------- | ----------------------------------------------------- |
31+
| [@launchdarkly/node-server-sdk-otel](packages/telemetry/node-server-sdk-otel/README.md) | [![NPM][node-otel-npm-badge]][node-otel-npm-link] | [Node OTel][node-otel-issues] | [![Actions Status][node-otel-ci-badge]][node-otel-ci] |
3232

3333
## Organization
3434

@@ -62,7 +62,7 @@ We encourage pull requests and other contributions from the community. Check out
6262
- Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
6363
- Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
6464
- Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
65-
- Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan).
65+
- Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan).
6666
- Disable parts of your application to facilitate maintenance, without taking everything offline.
6767
- LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read [our documentation](https://docs.launchdarkly.com/sdk) for a complete list.
6868
- Explore LaunchDarkly
@@ -168,4 +168,4 @@ We encourage pull requests and other contributions from the community. Check out
168168
[node-otel-ci]: https://github.com/launchdarkly/js-core/actions/workflows/node-otel.yml
169169
[node-otel-npm-badge]: https://img.shields.io/npm/v/@launchdarkly/node-server-sdk-otel.svg?style=flat-square
170170
[node-otel-npm-link]: https://www.npmjs.com/package/@launchdarkly/node-server-sdk-otel
171-
[node-otel-issues]: https://github.com/launchdarkly/js-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+telemetry%2Fnode-server-sdk-otel%22+
171+
[node-otel-issues]: https://github.com/launchdarkly/js-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+telemetry%2Fnode-server-sdk-otel%22+

contract-tests/TestHook.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default class TestHook {
2424
}
2525

2626
beforeEvaluation(hookContext, data) {
27-
if(this._errors?.beforeEvaluation) {
27+
if (this._errors?.beforeEvaluation) {
2828
throw new Error(this._errors.beforeEvaluation);
2929
}
3030
this._safePost({
@@ -36,7 +36,7 @@ export default class TestHook {
3636
}
3737

3838
afterEvaluation(hookContext, data, detail) {
39-
if(this._errors?.afterEvaluation) {
39+
if (this._errors?.afterEvaluation) {
4040
throw new Error(this._errors.afterEvaluation);
4141
}
4242
this._safePost({
@@ -46,7 +46,6 @@ export default class TestHook {
4646
evaluationDetail: detail,
4747
});
4848

49-
5049
return { ...data, ...(this._data?.['afterEvaluation'] || {}) };
5150
}
5251
}

contract-tests/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ app.get('/', (req, res) => {
3535
'inline-context',
3636
'anonymous-redaction',
3737
'evaluation-hooks',
38-
'wrapper'
38+
'wrapper',
3939
],
4040
});
4141
});

contract-tests/sdkClientEntity.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ export function makeSdkConfig(options, tag) {
6868
);
6969
}
7070
if (options.wrapper) {
71-
if(options.wrapper.name) {
71+
if (options.wrapper.name) {
7272
cf.wrapperName = options.wrapper.name;
7373
}
74-
if(options.wrapper.version) {
74+
if (options.wrapper.version) {
7575
cf.wrapperVersion = options.wrapper.version;
7676
}
7777
}
@@ -117,7 +117,7 @@ export async function newSdkClientEntity(options) {
117117
makeSdkConfig(options.configuration, options.tag),
118118
);
119119
try {
120-
await client.waitForInitialization({timeout: timeout});
120+
await client.waitForInitialization({ timeout: timeout });
121121
} catch (_) {
122122
// if waitForInitialization() rejects, the client failed to initialize, see next line
123123
}

packages/sdk/akamai-base/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ yarn test
3232

3333
## Verifying SDK build provenance with the SLSA framework
3434

35-
LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. To learn more, see the [provenance guide](PROVENANCE.md).
35+
LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. To learn more, see the [provenance guide](PROVENANCE.md).
3636

3737
## About LaunchDarkly
3838

3939
- LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
4040
- Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
4141
- Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
4242
- Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
43-
- Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan).
43+
- Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan).
4444
- Disable parts of your application to facilitate maintenance, without taking everything offline.
4545
- LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read [our documentation](https://docs.launchdarkly.com/sdk) for a complete list.
4646
- Explore LaunchDarkly

packages/sdk/akamai-edgekv/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ yarn test
3232

3333
## Verifying SDK build provenance with the SLSA framework
3434

35-
LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. To learn more, see the [provenance guide](PROVENANCE.md).
35+
LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. To learn more, see the [provenance guide](PROVENANCE.md).
3636

3737
## About LaunchDarkly
3838

3939
- LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
4040
- Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
4141
- Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
4242
- Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
43-
- Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan).
43+
- Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan).
4444
- Disable parts of your application to facilitate maintenance, without taking everything offline.
4545
- LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read [our documentation](https://docs.launchdarkly.com/sdk) for a complete list.
4646
- Explore LaunchDarkly

packages/sdk/cloudflare/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ yarn test
7272

7373
## Verifying SDK build provenance with the SLSA framework
7474

75-
LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. To learn more, see the [provenance guide](PROVENANCE.md).
75+
LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. To learn more, see the [provenance guide](PROVENANCE.md).
7676

7777
## About LaunchDarkly
7878

7979
- LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
8080
- Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
8181
- Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
8282
- Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
83-
- Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan).
83+
- Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan).
8484
- Disable parts of your application to facilitate maintenance, without taking everything offline.
8585
- LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read [our documentation](https://docs.launchdarkly.com/sdk) for a complete list.
8686
- Explore LaunchDarkly

packages/sdk/cloudflare/example/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ npx wrangler kv:key get --binding=LD_KV "LD-Env-test-client-side-id" --preview
4040
5. Edit [index.ts](https://github.com/launchdarkly/js-core/blob/main/packages/sdk/cloudflare/example/src/index.ts#L6) to use your clientSideID and a valid flag key from the test data you just inserted.
4141

4242
```ts
43-
const clientSideID = 'test-client-side-id';
44-
const flagKey = 'test-boolean-flag';
43+
const clientSideID = 'test-client-side-id';
44+
const flagKey = 'test-boolean-flag';
4545
```
4646

4747
6. Finally:

packages/sdk/cloudflare/jsr.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,7 @@
33
"version": "2.5.11",
44
"exports": "./src/index.ts",
55
"publish": {
6-
"include": [
7-
"LICENSE",
8-
"README.md",
9-
"package.json",
10-
"jsr.json",
11-
"src/**/*.ts"
12-
],
13-
"exclude": [
14-
"src/**/*.test.ts"
15-
]
6+
"include": ["LICENSE", "README.md", "package.json", "jsr.json", "src/**/*.ts"],
7+
"exclude": ["src/**/*.test.ts"]
168
}
179
}

packages/sdk/react-native/example/src/welcome.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export default function Welcome() {
1616
.catch((e: any) => console.error(`error identifying ${userKey}: ${e}`));
1717
};
1818

19-
2019
const setConnectionMode = (m: ConnectionMode) => {
2120
ldc.setConnectionMode(m);
2221
};
@@ -51,7 +50,10 @@ export default function Welcome() {
5150
testID="flagKey"
5251
/>
5352
<View style={styles.connectionModeContainer}>
54-
<TouchableOpacity style={styles.buttonContainer} onPress={() => setConnectionMode('offline')}>
53+
<TouchableOpacity
54+
style={styles.buttonContainer}
55+
onPress={() => setConnectionMode('offline')}
56+
>
5557
<Text style={styles.buttonText}>Set offline</Text>
5658
</TouchableOpacity>
5759
<TouchableOpacity

packages/sdk/react-native/example/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
"jsx": "react-jsx",
55
"strict": true,
6-
"typeRoots": ["./types"],
6+
"typeRoots": ["./types"]
77
},
8-
"exclude": ["e2e"],
8+
"exclude": ["e2e"]
99
}

packages/sdk/react-native/src/fromExternal/react-native-sse/EventSource.test.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ describe('EventSource', () => {
2424
.mockImplementationOnce(() => 0.888)
2525
.mockImplementationOnce(() => 0.999);
2626

27-
mockXhr = {
28-
open: jest.fn(),
29-
send: jest.fn(),
30-
setRequestHeader: jest.fn(),
31-
abort: jest.fn(),
32-
};
27+
mockXhr = {
28+
open: jest.fn(),
29+
send: jest.fn(),
30+
setRequestHeader: jest.fn(),
31+
abort: jest.fn(),
32+
};
3333

34-
jest.spyOn(window, 'XMLHttpRequest').mockImplementation(() => mockXhr as XMLHttpRequest);
34+
jest.spyOn(window, 'XMLHttpRequest').mockImplementation(() => mockXhr as XMLHttpRequest);
3535

3636
eventSource = new EventSource<EventName>(uri, { logger });
3737
eventSource.onclose = jest.fn();
@@ -84,7 +84,9 @@ describe('EventSource', () => {
8484
test('initial connection', () => {
8585
jest.runAllTimers();
8686

87-
expect(logger.debug).toHaveBeenCalledWith(expect.stringMatching(/\[EventSource\] opening new connection./));
87+
expect(logger.debug).toHaveBeenCalledWith(
88+
expect.stringMatching(/\[EventSource\] opening new connection./),
89+
);
8890
expect(mockXhr.open).toHaveBeenCalledTimes(1);
8991
expect(eventSource.onclose).toHaveBeenCalledTimes(0);
9092
});

packages/sdk/react-native/src/fromExternal/react-native-sse/EventSource.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default class EventSource<E extends string = never> {
9191
private tryConnect(initialConnection: boolean = false) {
9292
let delay = initialConnection ? 0 : this.getNextRetryDelay();
9393
if (initialConnection) {
94-
this.logger?.debug(`[EventSource] opening new connection.`)
94+
this.logger?.debug(`[EventSource] opening new connection.`);
9595
} else {
9696
this.logger?.debug(`[EventSource] Will open new connection in ${delay} ms.`);
9797
this.dispatch('retry', { type: 'retry', delayMillis: delay });
@@ -138,7 +138,8 @@ export default class EventSource<E extends string = never> {
138138
}
139139

140140
this.logger?.debug(
141-
`[EventSource][onreadystatechange] ReadyState: ${XMLReadyStateMap[this.xhr.readyState] || 'Unknown'
141+
`[EventSource][onreadystatechange] ReadyState: ${
142+
XMLReadyStateMap[this.xhr.readyState] || 'Unknown'
142143
}(${this.xhr.readyState}), status: ${this.xhr.status}`,
143144
);
144145

@@ -349,8 +350,8 @@ export default class EventSource<E extends string = never> {
349350
return this.status;
350351
}
351352

352-
onopen() { }
353-
onclose() { }
354-
onerror(_err: any) { }
355-
onretrying(_e: any) { }
353+
onopen() {}
354+
onclose() {}
355+
onerror(_err: any) {}
356+
onretrying(_e: any) {}
356357
}

0 commit comments

Comments
 (0)