Skip to content

Enforce strict ESLint block formatting - #185

Open
niemyjski wants to merge 1 commit into
mainfrom
feature/eslint-block-formatting
Open

Enforce strict ESLint block formatting#185
niemyjski wants to merge 1 commit into
mainfrom
feature/eslint-block-formatting

Conversation

@niemyjski

@niemyjski niemyjski commented Aug 15, 2026

Copy link
Copy Markdown
Member

Enforce consistent formatting with mandatory control-flow braces, multiline block bodies and non-empty object literals, and a blank line before if/while/for/do when 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

  • Compared all 33 modified SDK source/test files against 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.
  • Manifest/lockfile comparison confirms that only the Stylistic development plugin and its two nested development dependencies were added; the existing dependency graph is unchanged.
  • All nine GitHub checks pass for 1e04d3ded9c8f7c35d1c7553f5f6906a0cbda9a8, including build, lint, and tests on Linux/macOS/Windows plus CodeQL.
  • Test suite: 27 files / 351 tests, including the five ESLint configuration tests.
  • Verified against live refs on September 2: the branch already contains current main (92c4599ae3fac56260440ba1db72daa35d1b289f), with no conflicts or unresolved review threads.

@niemyjski
niemyjski marked this pull request as ready for review September 3, 2026 02:57
Copilot AI lite review requested due to automatic review settings September 3, 2026 02:57
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T03:00:35.422082Z 1e04d3d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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-plugin and 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.

Comment thread eslint.config.mjs
Comment on lines +64 to +68
curly: ["error", "all"],
"@stylistic/object-curly-newline": [
"error",
{
ObjectExpression: {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants