Enforce strict ESLint block formatting - #185
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
The newly introduced ESLint stylistic formatting rules are incompatible with the repo’s enforced Prettier configuration/workflow, which will cause non-idempotent formatting and likely CI lint failures.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR introduces stricter, ESLint-enforced formatting rules (mandatory control-flow braces, multiline block bodies, multiline non-empty object literals, and padding between consecutive block-like statements) across the Exceptionless JavaScript SDK monorepo, and reformats existing source/tests accordingly without intended behavioral or public API changes.
Changes:
- Add
@stylistic/eslint-pluginand new ESLint rules to enforce consistent block/object formatting. - Add a new Vitest project plus a
scripts/test that validates the ESLint rule behavior. - Reformat SDK source and test files across packages (core/browser/node/react/react-native/angularjs) to comply with the new rules.
File summaries
| File | Description |
|---|---|
| vitest.config.ts | Adds a dedicated Vitest “scripts” project to discover .mjs tests under scripts/. |
| scripts/eslint-rules.test.mjs | Adds rule-level tests that lint fixture snippets and assert expected ESLint rule IDs. |
| eslint.config.mjs | Adds @stylistic plugin plus formatting rules; adds a scripts/**/*.mjs config block. |
| package.json | Adds @stylistic/eslint-plugin devDependency. |
| package-lock.json | Locks @stylistic/eslint-plugin and its transitive dev dependencies. |
| packages/react/src/ExceptionlessErrorBoundary.tsx | Formatting-only updates to object literals. |
| packages/react-native/src/ExceptionlessErrorBoundary.tsx | Formatting-only updates to object literals. |
| packages/react-native/src/logging/CallbackLog.ts | Formatting-only updates to object literal construction. |
| packages/node/src/storage/NodeDirectoryStorage.ts | Formatting-only updates to mkdirSync options object literal. |
| packages/core/src/ExceptionlessClient.ts | Formatting-only updates to object literal construction/arguments. |
| packages/core/src/EventBuilder.ts | Formatting-only updates to inline object literal creation. |
| packages/core/src/Utils.ts | Formatting-only updates to type guards, casts, and wrapped expressions. |
| packages/core/src/storage/InMemoryStorage.ts | Formatting-only updates to control-flow braces. |
| packages/core/src/queue/DefaultEventQueue.ts | Formatting-only updates to block braces and object literal construction. |
| packages/core/src/plugins/EventPluginContext.ts | Formatting-only updates to control-flow braces. |
| packages/core/src/plugins/default/DuplicateCheckerPlugin.ts | Formatting-only updates (including padding line insertion). |
| packages/browser/src/plugins/BrowserGlobalHandlerPlugin.ts | Formatting-only updates to function/type formatting and callback shape. |
| packages/browser/src/plugins/BrowserErrorPlugin.ts | Formatting-only updates to object literal push. |
| packages/angularjs/src/index.ts | Formatting-only updates to function signature wrapping and casts. |
| packages/react-native/test/storage/AsyncStorageProvider.test.ts | Formatting-only updates to inline type/object formatting. |
| packages/react-native/test/ReactNativeExceptionlessClient.test.ts | Formatting-only updates to defineProperty options objects. |
| packages/react-native/test/plugins/ReactNativeLifeCyclePlugin.test.ts | Formatting-only updates to startup call objects and defineProperty options. |
| packages/react-native/test/plugins/ReactNativeGlobalHandlerPlugin.test.ts | Formatting-only updates to startup call objects, errors, and defineProperty options. |
| packages/react-native/test/plugins/ReactNativeErrorPlugin.test.ts | Formatting-only updates to EventPluginContext construction formatting. |
| packages/react-native/test/plugins/ReactNativeEnvironmentInfoPlugin.test.ts | Formatting-only updates to defineProperty options and object literals. |
| packages/react-native/test/plugins/NativeCrashPlugin.test.ts | Formatting-only updates to startup call objects and defineProperty options. |
| packages/react-native/test/logging/CallbackLog.test.ts | Formatting-only updates to inline mocked logger object literals. |
| packages/node/test/storage/NodeDirectoryStorage.test.ts | Formatting-only updates to fs call options objects. |
| packages/core/test/Utils.test.ts | Formatting-only updates to many test literals/arrays/maps and wrapped calls. |
| packages/core/test/submission/TestSubmissionClient.test.ts | Formatting-only updates to event arrays and request option objects. |
| packages/core/test/queue/DefaultEventQueue.test.ts | Formatting-only updates to event object literals and wrapped assertions. |
| packages/core/test/plugins/default/EventExclusionPlugin.test.ts | Formatting-only updates to event/context object construction and settings objects. |
| packages/core/test/plugins/default/ConfigurationDefaultsPlugin.test.ts | Formatting-only updates to event and expected object literals. |
| packages/core/test/DocumentationExamples.test.ts | Formatting-only updates to expected object literals. |
| packages/core/test/configuration/Configuration.test.ts | Formatting-only updates to server settings object literal. |
| packages/browser/test/plugins/BrowserIgnoreExtensionErrorsPlugin.test.ts | Formatting-only updates to EventPluginContext construction formatting. |
| packages/browser/test/plugins/BrowserErrorPlugin.test.ts | Formatting-only updates to Error options object literal. |
Review details
- Files reviewed: 37/38 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| curly: ["error", "all"], | ||
| "@stylistic/object-curly-newline": [ | ||
| "error", | ||
| { | ||
| ObjectExpression: { |
Enforce consistent formatting with mandatory control-flow braces, multiline block bodies and non-empty object literals, and a blank line before
if/while/for/dowhen the preceding statement is block-like. Existing SDK source and tests are reformatted without changing behavior or public APIs.The five tooling files add the Stylistic development dependency, ESLint configuration, and five configuration tests with Vitest discovery. Object newlines use the supported
ObjectExpression: { minProperties: 1 }option; empty objects, imports, and destructuring retain Prettier-compatible formatting.Verification
main: syntax trees and comments match after excluding source positions, literal spelling, and safe single-statement control braces. Types, expressions, literals, and JSX content are unchanged.1e04d3ded9c8f7c35d1c7553f5f6906a0cbda9a8, including build, lint, and tests on Linux/macOS/Windows plus CodeQL.main(92c4599ae3fac56260440ba1db72daa35d1b289f), with no conflicts or unresolved review threads.