Skip to content

Commit bfdc2bf

Browse files
authored
chore: fixing global npm lint (#1172)
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Low Risk** > Low risk configuration-only changes; primary impact is which files ESLint/TypeScript analyze, so failures may shift between local and package-level linting. > > **Overview** > Repo-wide linting is adjusted to avoid treating `packages/sdk/react/contract-tests` as part of the root TS/ESLint project: it’s added to `.eslintignore`, and its `tsconfig.json` now `extends` the package `tsconfig` instead of redefining compiler options. > > ESLint’s TS config (`tsconfig.eslint.json`) is narrowed to `packages/**/*.ts` and now excludes `node_modules` and `dist` broadly. A few `// eslint-disable-next-line @typescript-eslint/no-redeclare` directives are added in `CommandParams.ts` to allow `const` enums + same-named union `type` aliases without lint errors. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c4028f5. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/launchdarkly/js-core/pull/1172" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end -->
1 parent d4373ed commit bfdc2bf

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Package-level lint handles this via packages/sdk/react/.eslintrc.cjs overrides.
2+
packages/sdk/react/contract-tests/

packages/sdk/react/contract-tests/tsconfig.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
{
2+
"extends": "../tsconfig.json",
23
"compilerOptions": {
3-
"target": "ES2017",
44
"lib": ["dom", "dom.iterable", "esnext"],
55
"allowJs": true,
6-
"skipLibCheck": true,
7-
"strict": true,
86
"noEmit": true,
97
"esModuleInterop": true,
10-
"module": "esnext",
118
"moduleResolution": "bundler",
12-
"resolveJsonModule": true,
139
"isolatedModules": true,
1410
"jsx": "react-jsx",
1511
"incremental": true,

packages/tooling/contract-test-utils/src/types/CommandParams.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const CommandType = {
1212
ContextComparison: 'contextComparison',
1313
SecureModeHash: 'secureModeHash',
1414
} as const;
15+
// eslint-disable-next-line @typescript-eslint/no-redeclare
1516
export type CommandType = (typeof CommandType)[keyof typeof CommandType];
1617

1718
export const ValueType = {
@@ -21,6 +22,7 @@ export const ValueType = {
2122
String: 'string',
2223
Any: 'any',
2324
} as const;
25+
// eslint-disable-next-line @typescript-eslint/no-redeclare
2426
export type ValueType = (typeof ValueType)[keyof typeof ValueType];
2527

2628
export interface CommandParams {
@@ -143,6 +145,7 @@ export const HookStage = {
143145
BeforeEvaluation: 'beforeEvaluation',
144146
AfterEvaluation: 'afterEvaluation',
145147
} as const;
148+
// eslint-disable-next-line @typescript-eslint/no-redeclare
146149
export type HookStage = (typeof HookStage)[keyof typeof HookStage];
147150

148151
export interface EvaluationSeriesContext {

tsconfig.eslint.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"extends": "./tsconfig.json",
3-
"include": ["/**/*.ts"],
4-
"exclude": ["node_modules"]
3+
"include": ["packages/**/*.ts"],
4+
"exclude": ["**/node_modules/**", "**/dist/**"]
55
}

0 commit comments

Comments
 (0)