From 70697a5c6974b82706c6c4b88f149d6639633f41 Mon Sep 17 00:00:00 2001 From: Amanda Date: Tue, 7 Oct 2025 16:24:18 -0700 Subject: [PATCH 1/5] Add biome-config-godaddy --- README.md | 46 ++- packages/biome-config-godaddy/CHANGELOG.md | 21 ++ packages/biome-config-godaddy/README.md | 220 ++++++++++++++ packages/biome-config-godaddy/biome-ts.json | 282 ++++++++++++++++++ packages/biome-config-godaddy/biome.json | 271 +++++++++++++++++ .../biome-config-godaddy/package-lock.json | 182 +++++++++++ packages/biome-config-godaddy/package.json | 36 +++ 7 files changed, 1055 insertions(+), 3 deletions(-) create mode 100644 packages/biome-config-godaddy/CHANGELOG.md create mode 100644 packages/biome-config-godaddy/README.md create mode 100644 packages/biome-config-godaddy/biome-ts.json create mode 100644 packages/biome-config-godaddy/biome.json create mode 100644 packages/biome-config-godaddy/package-lock.json create mode 100644 packages/biome-config-godaddy/package.json diff --git a/README.md b/README.md index 4c478e08..518fff9e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ # godaddy-style -Official GoDaddy JavaScript styleguide. It includes `eslint` packages for various use-cases and can be used as a standard in any new project. +Official GoDaddy JavaScript styleguide. It includes `eslint` and `biomejs` packages for various use-cases and can be used as a standard in any new project. - [`eslint-config-godaddy`]: Base configuration for _non-React_, ES6 JavaScript applications - [`eslint-config-godaddy-react`]: Configuration for ES6 React JavaScript applications - [`eslint-config-godaddy-typescript`]: Configuration for ES6 TypeScript applications - [`eslint-config-godaddy-react-typescript`]: Configuration for ES6 React JavaScript applications +- [`biome-config-godaddy`]: Fast Rust-based alternative to ESLint and Prettier using Biome There are many useful features: @@ -41,13 +42,18 @@ npm i eslint-config-godaddy-typescript --save-dev # OR (ES6 with React and TypeScript rules) npm i eslint-config-godaddy-react-typescript --save-dev + +# OR (BiomeJS with JS and TS rules available) +npm i biome-config-godaddy --save-dev ``` ## Usage -There are two ways to use this styleguide depending on your own tooling preference: directly using pre-included binaries or running `eslint` yourself with a custom `.eslintrc` config. +There are different ways to use this styleguide depending on your tooling preference and performance requirements. + +### ESLint Configuration -### 2. Define your local `eslint.config.js|mjs` and run `eslint` yourself +Define your local `eslint.config.js|mjs` and run `eslint` yourself: ``` js import GDConfig from 'eslint-config-godaddy'; @@ -73,6 +79,39 @@ The `--fix` option in `eslint` is [**only** available as a CLI option](https://g } ``` +### Biome Configuration + +For improved performance, use the Biome configuration. Create a `biome.json` file: + +```json +{ + "$schema": "https://biomejs.dev/schemas/2.2.0/schema.json", + "extends": ["biome-config-godaddy/biome.json"] +} +``` + +For TypeScript projects: + +```json +{ + "$schema": "https://biomejs.dev/schemas/2.2.0/schema.json", + "extends": ["biome-config-godaddy/biome-ts.json"] +} +``` + +Add these scripts to your `package.json`: + +```json +{ + "scripts": { + "lint": "biome lint .", + "lint:fix": "biome lint --write .", + "format": "biome format --write .", + "check": "biome check --write ." + } +} +``` + ## Additional Best Practices This section is a place for additional best practices that may be useful but are not strictly enforced by this styleguide. Have something to add here? Great! [Submit a PR](#how-do-i-contribute). @@ -174,5 +213,6 @@ No problem. Reach out to us by [opening an issue] [`eslint-config-godaddy-react`]: /packages/eslint-config-godaddy-react [`eslint-config-godaddy-typescript`]: /packages/eslint-config-godaddy-typescript [`eslint-config-godaddy-react-typescript`]: /packages/eslint-config-godaddy-react-typescript +[`biome-config-godaddy`]: /packages/biome-config-godaddy [changesets]: https://github.com/changesets/changesets [pnpm]: https://pnpm.io/ diff --git a/packages/biome-config-godaddy/CHANGELOG.md b/packages/biome-config-godaddy/CHANGELOG.md new file mode 100644 index 00000000..cc3fbca0 --- /dev/null +++ b/packages/biome-config-godaddy/CHANGELOG.md @@ -0,0 +1,21 @@ +# biome-config-godaddy + +## 1.0.0 + +### Major Changes + +- **Initial release** of biome-config-godaddy - A fast, Rust-based alternative to ESLint and Prettier configurations +- **Dual configuration support**: + - `biome.json` - Base configuration for JavaScript projects + - `biome-ts.json` - Enhanced configuration for TypeScript projects +- **Complete linting rule parity** with `eslint-config-godaddy` standards using Biome 2.2.0+ features +- **Consistent formatting rules**: + - 2-space indentation + - 130 character line width + - LF line endings + - Single quotes preference + - Automatic semicolon insertion +- **Performance optimizations**: Rust-based implementation provides 15x faster linting and formatting +- **Biome 2.2.0+ requirement**: Utilizes latest Biome features for full ESLint config compatibility +- **Monorepo integration**: Designed for seamless integration with GoDaddy's JavaScript tooling ecosystem + diff --git a/packages/biome-config-godaddy/README.md b/packages/biome-config-godaddy/README.md new file mode 100644 index 00000000..79972f2a --- /dev/null +++ b/packages/biome-config-godaddy/README.md @@ -0,0 +1,220 @@ +# biome-config-godaddy + +Base Biome configuration for JavaScript applications officially used at GoDaddy. + +This configuration provides a fast, Rust-based alternative to ESLint and Prettier using [Biome][biome]. It implements the same linting and formatting standards as GoDaddy's ESLint configurations, ensuring consistency across projects while delivering superior performance. + +**Important**: This package requires Biome 2.2.0 or newer. The configuration utilizes the latest linting rules introduced in Biome 2.2.0 that provide feature parity with GoDaddy's ESLint configurations. Earlier versions of Biome will not support all the rules used in this configuration. + +Have a question or comment? [Open an issue!][issues] + +#### Example basic setup + +```json +{ + "$schema": "https://biomejs.dev/schemas/2.2.0/schema.json", + "extends": ["biome-config-godaddy/biome.json"] +} +``` + +## Installation + +Install the package and its peer dependency using pnpm: + +```sh +pnpm install biome-config-godaddy @biomejs/biome --save-dev +``` + +Or with npm: + +```sh +npm install biome-config-godaddy @biomejs/biome --save-dev +``` + +## Configuration + +### Options + +This package provides two configuration files: + +- `biome.json` - Base configuration for JavaScript projects +- `biome-ts.json` - Enhanced configuration for TypeScript projects + +Both configurations include: + +- **Formatter settings**: 2-space indentation, 130 character line width, LF line endings +- **Linter rules**: Comprehensive rules aligned with `eslint-config-godaddy` standards +- **Fast performance**: Rust-based implementation for improved build times + +#### Example JavaScript project + +Create a `biome.json` file in your project root: + +```json +{ + "$schema": "https://biomejs.dev/schemas/2.2.0/schema.json", + "extends": ["biome-config-godaddy/biome.json"] +} +``` + +#### Example TypeScript project + +For TypeScript projects, use the TypeScript-specific configuration: + +```json +{ + "$schema": "https://biomejs.dev/schemas/2.2.0/schema.json", + "extends": ["biome-config-godaddy/biome-ts.json"] +} +``` + +#### Example with custom overrides + +Extend the base configuration and add project-specific rules: + +```json +{ + "$schema": "https://biomejs.dev/schemas/2.2.0/schema.json", + "extends": ["biome-config-godaddy/biome.json"], + "linter": { + "rules": { + "suspicious": { + "noConsoleLog": "off" + }, + "style": { + "useNodejsImportProtocol": "error" + } + } + } +} +``` + +#### Example package.json scripts + +Add these scripts to your `package.json` for common development workflows: + +```json +{ + "scripts": { + "lint": "biome lint .", + "lint:fix": "biome lint --write .", + "format": "biome format --write .", + "format:check": "biome format .", + "check": "biome check --write .", + "check:ci": "biome check ." + } +} +``` + +## Commands + +### `format` command + +Formats all files in the current directory and subdirectories according to GoDaddy style rules. + +#### Example `format` usage + +```sh +# Format and write changes +biome format --write . + +# Check formatting without making changes +biome format . +``` + +### `lint` command + +Analyzes code for potential issues using GoDaddy's linting standards. + +#### Example `lint` usage + +```sh +# Lint all files +biome lint . + +# Lint with auto-fix +biome lint --write . + +# Lint specific files +biome lint src/**/*.js +``` + +### `check` command + +Combines linting and formatting in a single operation for comprehensive code quality checks. + +#### Example `check` usage + +```sh +# Check and fix all issues +biome check --write . + +# Dry run to see what would change +biome check . + +# Check specific directories +biome check src/ tests/ +``` + +## Lifecycles + +### `pre-commit` + +Integrate with Git hooks to ensure code quality before commits. + +#### Example `pre-commit` setup + +```json +{ + "scripts": { + "pre-commit": "biome check --write --staged" + } +} +``` + +### Continuous integration + +Validate code quality in CI pipelines without making changes. + +#### Example CI validation + +```json +{ + "scripts": { + "ci:lint": "biome check .", + "ci:format": "biome format ." + } +} +``` + +## How it works + +This Biome configuration mirrors the linting and formatting standards established by GoDaddy's ESLint configurations (`eslint-config-godaddy` and `eslint-config-godaddy-typescript`). Biome, written in Rust, provides the same code quality enforcement with improved performance compared to equivalent ESLint + Prettier setups. + +The configuration enforces GoDaddy's JavaScript style guide including 2-space indentation, 130-character line limits, consistent semicolon usage, and comprehensive linting rules for code correctness, complexity management, and style consistency. The formatter ensures consistent code appearance across all team members. + +Unlike traditional ESLint + Prettier combinations, Biome provides integrated linting and formatting in a single tool, eliminating configuration conflicts and reducing the number of dependencies in your project. The configuration automatically handles JavaScript and TypeScript files for different development environments. + +## Related Packages + +This Biome configuration is designed to be a drop-in replacement for GoDaddy's ESLint configurations: + +- [`eslint-config-godaddy`][eslint-base] - Base ESLint config (equivalent to `biome.json`) +- [`eslint-config-godaddy-typescript`][eslint-typescript] - ESLint config for TypeScript (equivalent to `biome-ts.json`) +- [`eslint-config-godaddy-react`][eslint-react] - ESLint config for React applications +- [`eslint-config-godaddy-react-typescript`][eslint-react-ts] - ESLint config for React with TypeScript + +Teams can migrate from ESLint configurations to Biome while maintaining the same code quality standards and style guidelines that GoDaddy has established across its engineering organization. + +## License + +[MIT][license] + +[biome]: https://biomejs.dev/ +[issues]: https://github.com/godaddy/javascript/issues/new +[license]: https://github.com/godaddy/javascript/blob/main/LICENSE +[eslint-base]: https://www.npmjs.com/package/eslint-config-godaddy +[eslint-typescript]: https://www.npmjs.com/package/eslint-config-godaddy-typescript +[eslint-react]: https://www.npmjs.com/package/eslint-config-godaddy-react +[eslint-react-ts]: https://www.npmjs.com/package/eslint-config-godaddy-react-typescript + diff --git a/packages/biome-config-godaddy/biome-ts.json b/packages/biome-config-godaddy/biome-ts.json new file mode 100644 index 00000000..54ca8e4d --- /dev/null +++ b/packages/biome-config-godaddy/biome-ts.json @@ -0,0 +1,282 @@ +{ + "formatter": { + "enabled": true, + "formatWithErrors": false, + "indentStyle": "space", + "indentWidth": 2, + "lineEnding": "lf", + "lineWidth": 130 + }, + "linter": { + "rules": { + "recommended": false, + "complexity": { + "noAdjacentSpacesInRegex": "error", + "noCommaOperator": "error", + "noExtraBooleanCast": "error", + "noUselessCatch": "error", + "noUselessEscapeInRegex": "error", + "noUselessLoneBlockStatements": "error", + "noUselessStringConcat": "error", + "noUselessTernary": "error", + "noUselessUndefinedInitialization": "error", + "useLiteralKeys": "error" + }, + "correctness": { + "noConstAssign": "error", + "noConstantCondition": "error", + "noEmptyCharacterClassInRegex": "error", + "noEmptyPattern": "error", + "noGlobalObjectCalls": "error", + "noInvalidBuiltinInstantiation": "error", + "noInvalidConstructorSuper": "error", + "noInvalidUseBeforeDeclaration": "error", + "noNonoctalDecimalEscape": "error", + "noPrecisionLoss": "error", + "noSelfAssign": "error", + "noSetterReturn": "error", + "noSwitchDeclarations": "error", + "noUndeclaredVariables": "error", + "noUnreachable": "error", + "noUnreachableSuper": "error", + "noUnsafeFinally": "error", + "noUnsafeOptionalChaining": "error", + "noUnusedLabels": "error", + "noUnusedPrivateClassMembers": "error", + "noUnusedVariables": "error", + "useIsNan": "error", + "useParseIntRadix": "error", + "useSingleJsDocAsterisk": "error", + "useValidForDirection": "error", + "useValidTypeof": "error", + "useYield": "error" + }, + "nursery": { + "noShadow": "warn", + "useMaxParams": "error" + }, + "security": { "noGlobalEval": "error" }, + "style": { + "noNestedTernary": "error", + "noUselessElse": "warn", + "noYodaExpression": "error", + "useArrayLiterals": "error", + "useCollapsedElseIf": "error", + "useConsistentBuiltinInstantiation": "error", + "useConst": "warn", + "useDefaultSwitchClause": "error", + "useThrowOnlyError": "error" + }, + "suspicious": { + "noAlert": "error", + "noAssignInExpressions": "error", + "noAsyncPromiseExecutor": "error", + "noBitwiseOperators": "error", + "noCatchAssign": "error", + "noClassAssign": "error", + "noCompareNegZero": "error", + "noConfusingLabels": "error", + "noConsole": "warn", + "noConstantBinaryExpressions": "error", + "noControlCharactersInRegex": "error", + "noDebugger": "error", + "noDoubleEquals": "error", + "noDuplicateCase": "error", + "noDuplicateClassMembers": "error", + "noDuplicateElseIf": "error", + "noDuplicateObjectKeys": "error", + "noDuplicateParameters": "error", + "noEmptyBlockStatements": "error", + "noFallthroughSwitchClause": "error", + "noFunctionAssign": "error", + "noGlobalAssign": "error", + "noImportAssign": "error", + "noIrregularWhitespace": "error", + "noMisleadingCharacterClass": "error", + "noOctalEscape": "error", + "noPrototypeBuiltins": "error", + "noRedeclare": "error", + "noSelfCompare": "error", + "noShadowRestrictedNames": "error", + "noSparseArray": "error", + "noUnsafeNegation": "error", + "noUselessRegexBackrefs": "error", + "noWith": "error", + "useGetterReturn": "error", + "useGuardForIn": "error" + } + } + }, + "javascript": { + "globals": [ + "onanimationend", + "exports", + "ongamepadconnected", + "onlostpointercapture", + "onanimationiteration", + "onkeyup", + "onmousedown", + "onanimationstart", + "onslotchange", + "onprogress", + "ontransitionstart", + "onpause", + "onended", + "onpointerover", + "onscrollend", + "onformdata", + "ontransitionrun", + "onanimationcancel", + "ondrag", + "onchange", + "onbeforeinstallprompt", + "onbeforexrselect", + "onmessage", + "ontransitioncancel", + "onpointerdown", + "onabort", + "onpointerout", + "oncuechange", + "ongotpointercapture", + "onscrollsnapchanging", + "onsearch", + "onsubmit", + "onstalled", + "onsuspend", + "onreset", + "onerror", + "onresize", + "onmouseenter", + "ongamepaddisconnected", + "ondragover", + "onbeforetoggle", + "onmouseover", + "onpagehide", + "onmousemove", + "onratechange", + "oncommand", + "onmessageerror", + "onwheel", + "ondevicemotion", + "onauxclick", + "ontransitionend", + "onpaste", + "onpageswap", + "ononline", + "ondeviceorientationabsolute", + "onkeydown", + "onclose", + "onselect", + "onpageshow", + "onpointercancel", + "onbeforematch", + "onpointerrawupdate", + "ondragleave", + "onscrollsnapchange", + "onseeked", + "onwaiting", + "onbeforeunload", + "onplaying", + "onvolumechange", + "ondragend", + "onstorage", + "onloadeddata", + "onfocus", + "onoffline", + "onplay", + "onafterprint", + "onclick", + "oncut", + "onmouseout", + "ondblclick", + "oncanplay", + "onloadstart", + "onappinstalled", + "onpointermove", + "ontoggle", + "oncontextmenu", + "onblur", + "oncancel", + "onbeforeprint", + "oncontextrestored", + "onloadedmetadata", + "onpointerup", + "onlanguagechange", + "oncopy", + "onselectstart", + "onscroll", + "onload", + "ondragstart", + "onbeforeinput", + "oncanplaythrough", + "oninput", + "oninvalid", + "ontimeupdate", + "ondurationchange", + "onselectionchange", + "onmouseup", + "location", + "onkeypress", + "onpointerleave", + "oncontextlost", + "ondrop", + "onsecuritypolicyviolation", + "oncontentvisibilityautostatechange", + "ondeviceorientation", + "onseeking", + "onrejectionhandled", + "onunload", + "onmouseleave", + "onhashchange", + "onpointerenter", + "onmousewheel", + "onunhandledrejection", + "ondragenter", + "onpopstate", + "onpagereveal", + "onemptied" + ], + "formatter": { + "quoteStyle": "single", + "jsxQuoteStyle": "double", + "quoteProperties": "asNeeded", + "semicolons": "always", + "trailingCommas": "es5", + "bracketSpacing": true, + "bracketSameLine": false, + "arrowParentheses": "asNeeded" + } + }, + "json": { + "formatter": { + "allowComments": true, + "allowTrailingCommas": false, + "enabled": true, + "indentStyle": "space", + "indentWidth": 2, + "lineEnding": "lf", + "lineWidth": 130, + "trailingCommas": "none", + "bracketSpacing": true, + "expand": "auto" + }, + "linter": { + "enabled": true + }, + "assist": { + "enabled": false + } + }, + "overrides": [ + { + "includes": ["*.ts", "*.mts", "*.cts"], + "javascript": { "globals": [] }, + "linter": { + "rules": { + "correctness": { "noUnusedVariables": "error" }, + "nursery": { "noShadow": "off" } + } + } + } + ] +} diff --git a/packages/biome-config-godaddy/biome.json b/packages/biome-config-godaddy/biome.json new file mode 100644 index 00000000..486fa029 --- /dev/null +++ b/packages/biome-config-godaddy/biome.json @@ -0,0 +1,271 @@ +{ + "formatter": { + "enabled": true, + "formatWithErrors": false, + "indentStyle": "space", + "indentWidth": 2, + "lineEnding": "lf", + "lineWidth": 130 + }, + "linter": { + "enabled": true, + "rules": { + "recommended": false, + "complexity": { + "noAdjacentSpacesInRegex": "error", + "noCommaOperator": "error", + "noExtraBooleanCast": "error", + "noUselessCatch": "error", + "noUselessEscapeInRegex": "error", + "noUselessLoneBlockStatements": "error", + "noUselessStringConcat": "error", + "noUselessTernary": "error", + "noUselessUndefinedInitialization": "error", + "useLiteralKeys": "error" + }, + "correctness": { + "noConstAssign": "error", + "noConstantCondition": "error", + "noEmptyCharacterClassInRegex": "error", + "noEmptyPattern": "error", + "noGlobalObjectCalls": "error", + "noInvalidBuiltinInstantiation": "error", + "noInvalidConstructorSuper": "error", + "noInvalidUseBeforeDeclaration": "error", + "noNonoctalDecimalEscape": "error", + "noPrecisionLoss": "error", + "noSelfAssign": "error", + "noSetterReturn": "error", + "noSwitchDeclarations": "error", + "noUndeclaredVariables": "error", + "noUnreachable": "error", + "noUnreachableSuper": "error", + "noUnsafeFinally": "error", + "noUnsafeOptionalChaining": "error", + "noUnusedLabels": "error", + "noUnusedPrivateClassMembers": "error", + "noUnusedVariables": "error", + "useIsNan": "error", + "useParseIntRadix": "error", + "useSingleJsDocAsterisk": "error", + "useValidForDirection": "error", + "useValidTypeof": "error", + "useYield": "error" + }, + "nursery": { + "noShadow": "warn", + "useMaxParams": "error" + }, + "security": { "noGlobalEval": "error" }, + "style": { + "noNestedTernary": "error", + "noUselessElse": "warn", + "noYodaExpression": "error", + "useArrayLiterals": "error", + "useCollapsedElseIf": "error", + "useConsistentBuiltinInstantiation": "error", + "useConst": "warn", + "useDefaultSwitchClause": "error", + "useThrowOnlyError": "error" + }, + "suspicious": { + "noAlert": "error", + "noAssignInExpressions": "error", + "noAsyncPromiseExecutor": "error", + "noBitwiseOperators": "error", + "noCatchAssign": "error", + "noClassAssign": "error", + "noCompareNegZero": "error", + "noConfusingLabels": "error", + "noConsole": "warn", + "noConstantBinaryExpressions": "error", + "noControlCharactersInRegex": "error", + "noDebugger": "error", + "noDoubleEquals": "error", + "noDuplicateCase": "error", + "noDuplicateClassMembers": "error", + "noDuplicateElseIf": "error", + "noDuplicateObjectKeys": "error", + "noDuplicateParameters": "error", + "noEmptyBlockStatements": "error", + "noFallthroughSwitchClause": "error", + "noFunctionAssign": "error", + "noGlobalAssign": "error", + "noImportAssign": "error", + "noIrregularWhitespace": "error", + "noMisleadingCharacterClass": "error", + "noOctalEscape": "error", + "noPrototypeBuiltins": "error", + "noRedeclare": "error", + "noSelfCompare": "error", + "noShadowRestrictedNames": "error", + "noSparseArray": "error", + "noUnsafeNegation": "error", + "noUselessRegexBackrefs": "error", + "noWith": "error", + "useGetterReturn": "error", + "useGuardForIn": "error" + } + } + }, + "javascript": { + "globals": [ + "onanimationend", + "exports", + "ongamepadconnected", + "onlostpointercapture", + "onanimationiteration", + "onkeyup", + "onmousedown", + "onanimationstart", + "onslotchange", + "onprogress", + "ontransitionstart", + "onpause", + "onended", + "onpointerover", + "onscrollend", + "onformdata", + "ontransitionrun", + "onanimationcancel", + "ondrag", + "onchange", + "onbeforeinstallprompt", + "onbeforexrselect", + "onmessage", + "ontransitioncancel", + "onpointerdown", + "onabort", + "onpointerout", + "oncuechange", + "ongotpointercapture", + "onscrollsnapchanging", + "onsearch", + "onsubmit", + "onstalled", + "onsuspend", + "onreset", + "onerror", + "onresize", + "onmouseenter", + "ongamepaddisconnected", + "ondragover", + "onbeforetoggle", + "onmouseover", + "onpagehide", + "onmousemove", + "onratechange", + "oncommand", + "onmessageerror", + "onwheel", + "ondevicemotion", + "onauxclick", + "ontransitionend", + "onpaste", + "onpageswap", + "ononline", + "ondeviceorientationabsolute", + "onkeydown", + "onclose", + "onselect", + "onpageshow", + "onpointercancel", + "onbeforematch", + "onpointerrawupdate", + "ondragleave", + "onscrollsnapchange", + "onseeked", + "onwaiting", + "onbeforeunload", + "onplaying", + "onvolumechange", + "ondragend", + "onstorage", + "onloadeddata", + "onfocus", + "onoffline", + "onplay", + "onafterprint", + "onclick", + "oncut", + "onmouseout", + "ondblclick", + "oncanplay", + "onloadstart", + "onappinstalled", + "onpointermove", + "ontoggle", + "oncontextmenu", + "onblur", + "oncancel", + "onbeforeprint", + "oncontextrestored", + "onloadedmetadata", + "onpointerup", + "onlanguagechange", + "oncopy", + "onselectstart", + "onscroll", + "onload", + "ondragstart", + "onbeforeinput", + "oncanplaythrough", + "oninput", + "oninvalid", + "ontimeupdate", + "ondurationchange", + "onselectionchange", + "onmouseup", + "location", + "onkeypress", + "onpointerleave", + "oncontextlost", + "ondrop", + "onsecuritypolicyviolation", + "oncontentvisibilityautostatechange", + "ondeviceorientation", + "onseeking", + "onrejectionhandled", + "onunload", + "onmouseleave", + "onhashchange", + "onpointerenter", + "onmousewheel", + "onunhandledrejection", + "ondragenter", + "onpopstate", + "onpagereveal", + "onemptied" + ], + "formatter": { + "quoteStyle": "single", + "jsxQuoteStyle": "single", + "quoteProperties": "asNeeded", + "semicolons": "always", + "trailingCommas": "es5", + "bracketSpacing": true, + "bracketSameLine": false, + "arrowParentheses": "asNeeded" + } + }, + "json": { + "formatter": { + "allowComments": true, + "allowTrailingCommas": false, + "enabled": true, + "indentStyle": "space", + "indentWidth": 2, + "lineEnding": "lf", + "lineWidth": 130, + "trailingCommas": "none", + "bracketSpacing": true, + "expand": "auto" + }, + "linter": { + "enabled": true + }, + "assist": { + "enabled": false + } + } +} diff --git a/packages/biome-config-godaddy/package-lock.json b/packages/biome-config-godaddy/package-lock.json new file mode 100644 index 00000000..fde91716 --- /dev/null +++ b/packages/biome-config-godaddy/package-lock.json @@ -0,0 +1,182 @@ +{ + "name": "biome-config-godaddy", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "biome-config-godaddy", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@biomejs/biome": "^2.2.5" + }, + "peerDependencies": { + "@biomejs/biome": "^2.2.5" + } + }, + "node_modules/@biomejs/biome": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.2.5.tgz", + "integrity": "sha512-zcIi+163Rc3HtyHbEO7CjeHq8DjQRs40HsGbW6vx2WI0tg8mYQOPouhvHSyEnCBAorfYNnKdR64/IxO7xQ5faw==", + "dev": true, + "license": "MIT OR Apache-2.0", + "bin": { + "biome": "bin/biome" + }, + "engines": { + "node": ">=14.21.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/biome" + }, + "optionalDependencies": { + "@biomejs/cli-darwin-arm64": "2.2.5", + "@biomejs/cli-darwin-x64": "2.2.5", + "@biomejs/cli-linux-arm64": "2.2.5", + "@biomejs/cli-linux-arm64-musl": "2.2.5", + "@biomejs/cli-linux-x64": "2.2.5", + "@biomejs/cli-linux-x64-musl": "2.2.5", + "@biomejs/cli-win32-arm64": "2.2.5", + "@biomejs/cli-win32-x64": "2.2.5" + } + }, + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.2.5.tgz", + "integrity": "sha512-MYT+nZ38wEIWVcL5xLyOhYQQ7nlWD0b/4mgATW2c8dvq7R4OQjt/XGXFkXrmtWmQofaIM14L7V8qIz/M+bx5QQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-darwin-x64": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.2.5.tgz", + "integrity": "sha512-FLIEl73fv0R7dI10EnEiZLw+IMz3mWLnF95ASDI0kbx6DDLJjWxE5JxxBfmG+udz1hIDd3fr5wsuP7nwuTRdAg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.2.5.tgz", + "integrity": "sha512-5DjiiDfHqGgR2MS9D+AZ8kOfrzTGqLKywn8hoXpXXlJXIECGQ32t+gt/uiS2XyGBM2XQhR6ztUvbjZWeccFMoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.2.5.tgz", + "integrity": "sha512-5Ov2wgAFwqDvQiESnu7b9ufD1faRa+40uwrohgBopeY84El2TnBDoMNXx6iuQdreoFGjwW8vH6k68G21EpNERw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.2.5.tgz", + "integrity": "sha512-fq9meKm1AEXeAWan3uCg6XSP5ObA6F/Ovm89TwaMiy1DNIwdgxPkNwxlXJX8iM6oRbFysYeGnT0OG8diCWb9ew==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64-musl": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.2.5.tgz", + "integrity": "sha512-AVqLCDb/6K7aPNIcxHaTQj01sl1m989CJIQFQEaiQkGr2EQwyOpaATJ473h+nXDUuAcREhccfRpe/tu+0wu0eQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-arm64": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.2.5.tgz", + "integrity": "sha512-xaOIad4wBambwJa6mdp1FigYSIF9i7PCqRbvBqtIi9y29QtPVQ13sDGtUnsRoe6SjL10auMzQ6YAe+B3RpZXVg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-x64": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.2.5.tgz", + "integrity": "sha512-F/jhuXCssPFAuciMhHKk00xnCAxJRS/pUzVfXYmOMUp//XW7mO6QeCjsjvnm8L4AO/dG2VOB0O+fJPiJ2uXtIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + } + } +} diff --git a/packages/biome-config-godaddy/package.json b/packages/biome-config-godaddy/package.json new file mode 100644 index 00000000..c0193e68 --- /dev/null +++ b/packages/biome-config-godaddy/package.json @@ -0,0 +1,36 @@ +{ + "name": "biome-config-godaddy", + "version": "1.0.0", + "description": "Base Biome config for consistent style in JavaScript projects at GoDaddy.", + "license": "MIT", + "type": "module", + "scripts": { + "test": "echo ok", + "clean": "rimraf node_modules" + }, + "repository": { + "type": "git", + "url": "git@github.com:godaddy/javascript.git", + "directory": "packages/biome-config-godaddy" + }, + "keywords": [ + "godaddy", + "javascript", + "styleguide", + "style-guide", + "biome", + "biome-config", + "linter", + "formatter" + ], + "peerDependencies": { + "@biomejs/biome": ">= 2.2.0 < 3.0.0" + }, + "exports": { + "./biome.json": "./biome.json", + "./biome-ts.json": "./biome-ts.json" + }, + "devDependencies": { + "@biomejs/biome": "^2.2.5" + } +} From 57175881e4893da26b6781c95c89562e0f6aa35b Mon Sep 17 00:00:00 2001 From: Amanda Date: Tue, 7 Oct 2025 16:27:56 -0700 Subject: [PATCH 2/5] Replace tabs with spaces in biome-ts.json --- packages/biome-config-godaddy/biome-ts.json | 518 ++++++++++---------- 1 file changed, 259 insertions(+), 259 deletions(-) diff --git a/packages/biome-config-godaddy/biome-ts.json b/packages/biome-config-godaddy/biome-ts.json index 54ca8e4d..ddff37a3 100644 --- a/packages/biome-config-godaddy/biome-ts.json +++ b/packages/biome-config-godaddy/biome-ts.json @@ -1,252 +1,252 @@ { - "formatter": { - "enabled": true, - "formatWithErrors": false, - "indentStyle": "space", - "indentWidth": 2, - "lineEnding": "lf", - "lineWidth": 130 - }, - "linter": { - "rules": { - "recommended": false, - "complexity": { - "noAdjacentSpacesInRegex": "error", - "noCommaOperator": "error", - "noExtraBooleanCast": "error", - "noUselessCatch": "error", - "noUselessEscapeInRegex": "error", - "noUselessLoneBlockStatements": "error", - "noUselessStringConcat": "error", - "noUselessTernary": "error", - "noUselessUndefinedInitialization": "error", - "useLiteralKeys": "error" - }, - "correctness": { - "noConstAssign": "error", - "noConstantCondition": "error", - "noEmptyCharacterClassInRegex": "error", - "noEmptyPattern": "error", - "noGlobalObjectCalls": "error", - "noInvalidBuiltinInstantiation": "error", - "noInvalidConstructorSuper": "error", - "noInvalidUseBeforeDeclaration": "error", - "noNonoctalDecimalEscape": "error", - "noPrecisionLoss": "error", - "noSelfAssign": "error", - "noSetterReturn": "error", - "noSwitchDeclarations": "error", - "noUndeclaredVariables": "error", - "noUnreachable": "error", - "noUnreachableSuper": "error", - "noUnsafeFinally": "error", - "noUnsafeOptionalChaining": "error", - "noUnusedLabels": "error", - "noUnusedPrivateClassMembers": "error", - "noUnusedVariables": "error", - "useIsNan": "error", - "useParseIntRadix": "error", + "formatter": { + "enabled": true, + "formatWithErrors": false, + "indentStyle": "space", + "indentWidth": 2, + "lineEnding": "lf", + "lineWidth": 130 + }, + "linter": { + "rules": { + "recommended": false, + "complexity": { + "noAdjacentSpacesInRegex": "error", + "noCommaOperator": "error", + "noExtraBooleanCast": "error", + "noUselessCatch": "error", + "noUselessEscapeInRegex": "error", + "noUselessLoneBlockStatements": "error", + "noUselessStringConcat": "error", + "noUselessTernary": "error", + "noUselessUndefinedInitialization": "error", + "useLiteralKeys": "error" + }, + "correctness": { + "noConstAssign": "error", + "noConstantCondition": "error", + "noEmptyCharacterClassInRegex": "error", + "noEmptyPattern": "error", + "noGlobalObjectCalls": "error", + "noInvalidBuiltinInstantiation": "error", + "noInvalidConstructorSuper": "error", + "noInvalidUseBeforeDeclaration": "error", + "noNonoctalDecimalEscape": "error", + "noPrecisionLoss": "error", + "noSelfAssign": "error", + "noSetterReturn": "error", + "noSwitchDeclarations": "error", + "noUndeclaredVariables": "error", + "noUnreachable": "error", + "noUnreachableSuper": "error", + "noUnsafeFinally": "error", + "noUnsafeOptionalChaining": "error", + "noUnusedLabels": "error", + "noUnusedPrivateClassMembers": "error", + "noUnusedVariables": "error", + "useIsNan": "error", + "useParseIntRadix": "error", "useSingleJsDocAsterisk": "error", - "useValidForDirection": "error", - "useValidTypeof": "error", - "useYield": "error" - }, - "nursery": { - "noShadow": "warn", - "useMaxParams": "error" - }, - "security": { "noGlobalEval": "error" }, - "style": { - "noNestedTernary": "error", - "noUselessElse": "warn", - "noYodaExpression": "error", - "useArrayLiterals": "error", - "useCollapsedElseIf": "error", - "useConsistentBuiltinInstantiation": "error", - "useConst": "warn", - "useDefaultSwitchClause": "error", - "useThrowOnlyError": "error" - }, - "suspicious": { - "noAlert": "error", - "noAssignInExpressions": "error", - "noAsyncPromiseExecutor": "error", - "noBitwiseOperators": "error", - "noCatchAssign": "error", - "noClassAssign": "error", - "noCompareNegZero": "error", - "noConfusingLabels": "error", - "noConsole": "warn", - "noConstantBinaryExpressions": "error", - "noControlCharactersInRegex": "error", - "noDebugger": "error", - "noDoubleEquals": "error", - "noDuplicateCase": "error", - "noDuplicateClassMembers": "error", - "noDuplicateElseIf": "error", - "noDuplicateObjectKeys": "error", - "noDuplicateParameters": "error", - "noEmptyBlockStatements": "error", - "noFallthroughSwitchClause": "error", - "noFunctionAssign": "error", - "noGlobalAssign": "error", - "noImportAssign": "error", - "noIrregularWhitespace": "error", - "noMisleadingCharacterClass": "error", - "noOctalEscape": "error", - "noPrototypeBuiltins": "error", - "noRedeclare": "error", - "noSelfCompare": "error", - "noShadowRestrictedNames": "error", - "noSparseArray": "error", - "noUnsafeNegation": "error", - "noUselessRegexBackrefs": "error", - "noWith": "error", - "useGetterReturn": "error", - "useGuardForIn": "error" - } - } - }, - "javascript": { - "globals": [ - "onanimationend", - "exports", - "ongamepadconnected", - "onlostpointercapture", - "onanimationiteration", - "onkeyup", - "onmousedown", - "onanimationstart", - "onslotchange", - "onprogress", - "ontransitionstart", - "onpause", - "onended", - "onpointerover", - "onscrollend", - "onformdata", - "ontransitionrun", - "onanimationcancel", - "ondrag", - "onchange", - "onbeforeinstallprompt", - "onbeforexrselect", - "onmessage", - "ontransitioncancel", - "onpointerdown", - "onabort", - "onpointerout", - "oncuechange", - "ongotpointercapture", - "onscrollsnapchanging", - "onsearch", - "onsubmit", - "onstalled", - "onsuspend", - "onreset", - "onerror", - "onresize", - "onmouseenter", - "ongamepaddisconnected", - "ondragover", - "onbeforetoggle", - "onmouseover", - "onpagehide", - "onmousemove", - "onratechange", - "oncommand", - "onmessageerror", - "onwheel", - "ondevicemotion", - "onauxclick", - "ontransitionend", - "onpaste", - "onpageswap", - "ononline", - "ondeviceorientationabsolute", - "onkeydown", - "onclose", - "onselect", - "onpageshow", - "onpointercancel", - "onbeforematch", - "onpointerrawupdate", - "ondragleave", - "onscrollsnapchange", - "onseeked", - "onwaiting", - "onbeforeunload", - "onplaying", - "onvolumechange", - "ondragend", - "onstorage", - "onloadeddata", - "onfocus", - "onoffline", - "onplay", - "onafterprint", - "onclick", - "oncut", - "onmouseout", - "ondblclick", - "oncanplay", - "onloadstart", - "onappinstalled", - "onpointermove", - "ontoggle", - "oncontextmenu", - "onblur", - "oncancel", - "onbeforeprint", - "oncontextrestored", - "onloadedmetadata", - "onpointerup", - "onlanguagechange", - "oncopy", - "onselectstart", - "onscroll", - "onload", - "ondragstart", - "onbeforeinput", - "oncanplaythrough", - "oninput", - "oninvalid", - "ontimeupdate", - "ondurationchange", - "onselectionchange", - "onmouseup", - "location", - "onkeypress", - "onpointerleave", - "oncontextlost", - "ondrop", - "onsecuritypolicyviolation", - "oncontentvisibilityautostatechange", - "ondeviceorientation", - "onseeking", - "onrejectionhandled", - "onunload", - "onmouseleave", - "onhashchange", - "onpointerenter", - "onmousewheel", - "onunhandledrejection", - "ondragenter", - "onpopstate", - "onpagereveal", - "onemptied" - ], - "formatter": { - "quoteStyle": "single", - "jsxQuoteStyle": "double", - "quoteProperties": "asNeeded", - "semicolons": "always", - "trailingCommas": "es5", - "bracketSpacing": true, - "bracketSameLine": false, - "arrowParentheses": "asNeeded" - } - }, + "useValidForDirection": "error", + "useValidTypeof": "error", + "useYield": "error" + }, + "nursery": { + "noShadow": "warn", + "useMaxParams": "error" + }, + "security": { "noGlobalEval": "error" }, + "style": { + "noNestedTernary": "error", + "noUselessElse": "warn", + "noYodaExpression": "error", + "useArrayLiterals": "error", + "useCollapsedElseIf": "error", + "useConsistentBuiltinInstantiation": "error", + "useConst": "warn", + "useDefaultSwitchClause": "error", + "useThrowOnlyError": "error" + }, + "suspicious": { + "noAlert": "error", + "noAssignInExpressions": "error", + "noAsyncPromiseExecutor": "error", + "noBitwiseOperators": "error", + "noCatchAssign": "error", + "noClassAssign": "error", + "noCompareNegZero": "error", + "noConfusingLabels": "error", + "noConsole": "warn", + "noConstantBinaryExpressions": "error", + "noControlCharactersInRegex": "error", + "noDebugger": "error", + "noDoubleEquals": "error", + "noDuplicateCase": "error", + "noDuplicateClassMembers": "error", + "noDuplicateElseIf": "error", + "noDuplicateObjectKeys": "error", + "noDuplicateParameters": "error", + "noEmptyBlockStatements": "error", + "noFallthroughSwitchClause": "error", + "noFunctionAssign": "error", + "noGlobalAssign": "error", + "noImportAssign": "error", + "noIrregularWhitespace": "error", + "noMisleadingCharacterClass": "error", + "noOctalEscape": "error", + "noPrototypeBuiltins": "error", + "noRedeclare": "error", + "noSelfCompare": "error", + "noShadowRestrictedNames": "error", + "noSparseArray": "error", + "noUnsafeNegation": "error", + "noUselessRegexBackrefs": "error", + "noWith": "error", + "useGetterReturn": "error", + "useGuardForIn": "error" + } + } + }, + "javascript": { + "globals": [ + "onanimationend", + "exports", + "ongamepadconnected", + "onlostpointercapture", + "onanimationiteration", + "onkeyup", + "onmousedown", + "onanimationstart", + "onslotchange", + "onprogress", + "ontransitionstart", + "onpause", + "onended", + "onpointerover", + "onscrollend", + "onformdata", + "ontransitionrun", + "onanimationcancel", + "ondrag", + "onchange", + "onbeforeinstallprompt", + "onbeforexrselect", + "onmessage", + "ontransitioncancel", + "onpointerdown", + "onabort", + "onpointerout", + "oncuechange", + "ongotpointercapture", + "onscrollsnapchanging", + "onsearch", + "onsubmit", + "onstalled", + "onsuspend", + "onreset", + "onerror", + "onresize", + "onmouseenter", + "ongamepaddisconnected", + "ondragover", + "onbeforetoggle", + "onmouseover", + "onpagehide", + "onmousemove", + "onratechange", + "oncommand", + "onmessageerror", + "onwheel", + "ondevicemotion", + "onauxclick", + "ontransitionend", + "onpaste", + "onpageswap", + "ononline", + "ondeviceorientationabsolute", + "onkeydown", + "onclose", + "onselect", + "onpageshow", + "onpointercancel", + "onbeforematch", + "onpointerrawupdate", + "ondragleave", + "onscrollsnapchange", + "onseeked", + "onwaiting", + "onbeforeunload", + "onplaying", + "onvolumechange", + "ondragend", + "onstorage", + "onloadeddata", + "onfocus", + "onoffline", + "onplay", + "onafterprint", + "onclick", + "oncut", + "onmouseout", + "ondblclick", + "oncanplay", + "onloadstart", + "onappinstalled", + "onpointermove", + "ontoggle", + "oncontextmenu", + "onblur", + "oncancel", + "onbeforeprint", + "oncontextrestored", + "onloadedmetadata", + "onpointerup", + "onlanguagechange", + "oncopy", + "onselectstart", + "onscroll", + "onload", + "ondragstart", + "onbeforeinput", + "oncanplaythrough", + "oninput", + "oninvalid", + "ontimeupdate", + "ondurationchange", + "onselectionchange", + "onmouseup", + "location", + "onkeypress", + "onpointerleave", + "oncontextlost", + "ondrop", + "onsecuritypolicyviolation", + "oncontentvisibilityautostatechange", + "ondeviceorientation", + "onseeking", + "onrejectionhandled", + "onunload", + "onmouseleave", + "onhashchange", + "onpointerenter", + "onmousewheel", + "onunhandledrejection", + "ondragenter", + "onpopstate", + "onpagereveal", + "onemptied" + ], + "formatter": { + "quoteStyle": "single", + "jsxQuoteStyle": "double", + "quoteProperties": "asNeeded", + "semicolons": "always", + "trailingCommas": "es5", + "bracketSpacing": true, + "bracketSameLine": false, + "arrowParentheses": "asNeeded" + } + }, "json": { "formatter": { "allowComments": true, @@ -267,16 +267,16 @@ "enabled": false } }, - "overrides": [ - { - "includes": ["*.ts", "*.mts", "*.cts"], - "javascript": { "globals": [] }, - "linter": { - "rules": { - "correctness": { "noUnusedVariables": "error" }, - "nursery": { "noShadow": "off" } - } - } - } - ] + "overrides": [ + { + "includes": ["*.ts", "*.mts", "*.cts"], + "javascript": { "globals": [] }, + "linter": { + "rules": { + "correctness": { "noUnusedVariables": "error" }, + "nursery": { "noShadow": "off" } + } + } + } + ] } From 95dc975489f6111b7bcfd6509449e94dba70d131 Mon Sep 17 00:00:00 2001 From: Amanda Date: Tue, 7 Oct 2025 18:08:02 -0700 Subject: [PATCH 3/5] Add changeset and remove unnecessary rules --- .changeset/blue-rooms-swim.md | 16 ++++ packages/biome-config-godaddy/biome-ts.json | 2 - packages/biome-config-godaddy/biome.json | 2 - pnpm-lock.yaml | 94 +++++++++++++++++++++ 4 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 .changeset/blue-rooms-swim.md diff --git a/.changeset/blue-rooms-swim.md b/.changeset/blue-rooms-swim.md new file mode 100644 index 00000000..512a2888 --- /dev/null +++ b/.changeset/blue-rooms-swim.md @@ -0,0 +1,16 @@ +--- +"biome-config-godaddy": major +--- + +Initial release of biome-config-godaddy, a fast Rust-based alternative to ESLint and Prettier configurations for GoDaddy JavaScript applications. + +A comprehensive Biome configuration package that provides consistent code quality and formatting standards across GoDaddy's JavaScript ecosystem, featuring: + +- **Dual configuration support** with dedicated configs for JavaScript (`biome.json`) and TypeScript (`biome-ts.json`) projects +- **Complete rule parity** with existing `eslint-config-godaddy` and `eslint-config-godaddy-typescript` standards, auto-migrated using Biome's migration tools +- **Consistent formatting rules** including 2-space indentation, 130 character line width, LF line endings, and single quote preferences +- **Performance optimizations** through Rust-based implementation providing significantly faster linting and formatting compared to traditional ESLint + Prettier setups +- **Biome 2.2.0+ compatibility** utilizing the latest linting rules for full feature parity with GoDaddy's established ESLint configurations +- **Seamless integration** designed for easy adoption in GoDaddy's monorepo ecosystem and existing JavaScript projects + +This package enables development teams to maintain the same code quality standards and style guidelines established across GoDaddy's engineering organization while benefiting from improved build performance and reduced tooling complexity. diff --git a/packages/biome-config-godaddy/biome-ts.json b/packages/biome-config-godaddy/biome-ts.json index ddff37a3..cc4d4f6a 100644 --- a/packages/biome-config-godaddy/biome-ts.json +++ b/packages/biome-config-godaddy/biome-ts.json @@ -249,8 +249,6 @@ }, "json": { "formatter": { - "allowComments": true, - "allowTrailingCommas": false, "enabled": true, "indentStyle": "space", "indentWidth": 2, diff --git a/packages/biome-config-godaddy/biome.json b/packages/biome-config-godaddy/biome.json index 486fa029..a5272625 100644 --- a/packages/biome-config-godaddy/biome.json +++ b/packages/biome-config-godaddy/biome.json @@ -250,8 +250,6 @@ }, "json": { "formatter": { - "allowComments": true, - "allowTrailingCommas": false, "enabled": true, "indentStyle": "space", "indentWidth": 2, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 439e3f18..a7c0f412 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,6 +48,12 @@ importers: specifier: ^5.8.3 version: 5.9.2 + packages/biome-config-godaddy: + devDependencies: + '@biomejs/biome': + specifier: ^2.2.5 + version: 2.2.5 + packages/eslint-config-godaddy: dependencies: eslint-plugin-jsdoc: @@ -220,6 +226,59 @@ packages: resolution: {integrity: sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==} engines: {node: '>=6.9.0'} + '@biomejs/biome@2.2.5': + resolution: {integrity: sha512-zcIi+163Rc3HtyHbEO7CjeHq8DjQRs40HsGbW6vx2WI0tg8mYQOPouhvHSyEnCBAorfYNnKdR64/IxO7xQ5faw==} + engines: {node: '>=14.21.3'} + hasBin: true + + '@biomejs/cli-darwin-arm64@2.2.5': + resolution: {integrity: sha512-MYT+nZ38wEIWVcL5xLyOhYQQ7nlWD0b/4mgATW2c8dvq7R4OQjt/XGXFkXrmtWmQofaIM14L7V8qIz/M+bx5QQ==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [darwin] + + '@biomejs/cli-darwin-x64@2.2.5': + resolution: {integrity: sha512-FLIEl73fv0R7dI10EnEiZLw+IMz3mWLnF95ASDI0kbx6DDLJjWxE5JxxBfmG+udz1hIDd3fr5wsuP7nwuTRdAg==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [darwin] + + '@biomejs/cli-linux-arm64-musl@2.2.5': + resolution: {integrity: sha512-5Ov2wgAFwqDvQiESnu7b9ufD1faRa+40uwrohgBopeY84El2TnBDoMNXx6iuQdreoFGjwW8vH6k68G21EpNERw==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + + '@biomejs/cli-linux-arm64@2.2.5': + resolution: {integrity: sha512-5DjiiDfHqGgR2MS9D+AZ8kOfrzTGqLKywn8hoXpXXlJXIECGQ32t+gt/uiS2XyGBM2XQhR6ztUvbjZWeccFMoQ==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + + '@biomejs/cli-linux-x64-musl@2.2.5': + resolution: {integrity: sha512-AVqLCDb/6K7aPNIcxHaTQj01sl1m989CJIQFQEaiQkGr2EQwyOpaATJ473h+nXDUuAcREhccfRpe/tu+0wu0eQ==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + + '@biomejs/cli-linux-x64@2.2.5': + resolution: {integrity: sha512-fq9meKm1AEXeAWan3uCg6XSP5ObA6F/Ovm89TwaMiy1DNIwdgxPkNwxlXJX8iM6oRbFysYeGnT0OG8diCWb9ew==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + + '@biomejs/cli-win32-arm64@2.2.5': + resolution: {integrity: sha512-xaOIad4wBambwJa6mdp1FigYSIF9i7PCqRbvBqtIi9y29QtPVQ13sDGtUnsRoe6SjL10auMzQ6YAe+B3RpZXVg==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [win32] + + '@biomejs/cli-win32-x64@2.2.5': + resolution: {integrity: sha512-F/jhuXCssPFAuciMhHKk00xnCAxJRS/pUzVfXYmOMUp//XW7mO6QeCjsjvnm8L4AO/dG2VOB0O+fJPiJ2uXtIw==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [win32] + '@changesets/apply-release-plan@7.0.12': resolution: {integrity: sha512-EaET7As5CeuhTzvXTQCRZeBUcisoYPDDcXvgTE/2jmmypKp0RC7LxKj/yzqeh/1qFTZI7oDGFcL1PHRuQuketQ==} @@ -1830,6 +1889,41 @@ snapshots: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.27.1 + '@biomejs/biome@2.2.5': + optionalDependencies: + '@biomejs/cli-darwin-arm64': 2.2.5 + '@biomejs/cli-darwin-x64': 2.2.5 + '@biomejs/cli-linux-arm64': 2.2.5 + '@biomejs/cli-linux-arm64-musl': 2.2.5 + '@biomejs/cli-linux-x64': 2.2.5 + '@biomejs/cli-linux-x64-musl': 2.2.5 + '@biomejs/cli-win32-arm64': 2.2.5 + '@biomejs/cli-win32-x64': 2.2.5 + + '@biomejs/cli-darwin-arm64@2.2.5': + optional: true + + '@biomejs/cli-darwin-x64@2.2.5': + optional: true + + '@biomejs/cli-linux-arm64-musl@2.2.5': + optional: true + + '@biomejs/cli-linux-arm64@2.2.5': + optional: true + + '@biomejs/cli-linux-x64-musl@2.2.5': + optional: true + + '@biomejs/cli-linux-x64@2.2.5': + optional: true + + '@biomejs/cli-win32-arm64@2.2.5': + optional: true + + '@biomejs/cli-win32-x64@2.2.5': + optional: true + '@changesets/apply-release-plan@7.0.12': dependencies: '@changesets/config': 3.1.1 From 8799aaa5fcf43b671eb5b88d5c3faa528d18ae8f Mon Sep 17 00:00:00 2001 From: Amanda Date: Wed, 8 Oct 2025 13:04:08 -0700 Subject: [PATCH 4/5] Add grit plugins back --- packages/biome-config-godaddy/.grit/grit.yaml | 17 ++++++++++++++++ .../no_anonymous_function_expressions.grit | 20 +++++++++++++++++++ .../.grit/no_anonymous_functions.grit | 10 ++++++++++ .../.grit/no_anonymous_single_param.grit | 10 ++++++++++ packages/biome-config-godaddy/biome-ts.json | 5 +++++ packages/biome-config-godaddy/biome.json | 5 +++++ .../biome-config-godaddy/package-lock.json | 2 +- 7 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 packages/biome-config-godaddy/.grit/grit.yaml create mode 100644 packages/biome-config-godaddy/.grit/no_anonymous_function_expressions.grit create mode 100644 packages/biome-config-godaddy/.grit/no_anonymous_functions.grit create mode 100644 packages/biome-config-godaddy/.grit/no_anonymous_single_param.grit diff --git a/packages/biome-config-godaddy/.grit/grit.yaml b/packages/biome-config-godaddy/.grit/grit.yaml new file mode 100644 index 00000000..04ed6f78 --- /dev/null +++ b/packages/biome-config-godaddy/.grit/grit.yaml @@ -0,0 +1,17 @@ +version: 0.0.0 +patterns: + - name: no_anonymous_functions + title: No Anonymous Functions + description: "Detects anonymous arrow functions with parentheses that use block statements and don't reference 'this'" + level: warn + tags: ["style", "debugging"] + - name: no_anonymous_single_param + title: No Anonymous Single Parameter Functions + description: "Detects single-parameter anonymous arrow functions that use block statements and don't reference 'this'" + level: warn + tags: ["style", "debugging"] + - name: no_anonymous_function_expressions + title: No Anonymous Function Expressions + description: "Detects traditional anonymous function expressions" + level: warn + tags: ["style", "debugging"] \ No newline at end of file diff --git a/packages/biome-config-godaddy/.grit/no_anonymous_function_expressions.grit b/packages/biome-config-godaddy/.grit/no_anonymous_function_expressions.grit new file mode 100644 index 00000000..48208ce2 --- /dev/null +++ b/packages/biome-config-godaddy/.grit/no_anonymous_function_expressions.grit @@ -0,0 +1,20 @@ +// Detect anonymous function expressions (function() {} and function(params) {}) +// Uses 'as $funcSig' to capture function signature for better span highlighting +or { + // Pattern for anonymous function with no parameters + `function() { $body }` as $funcSig where { + register_diagnostic( + span = $funcSig, + message = "Anonymous function expressions should be assigned to a named variable or converted to named functions for better debugging", + severity = "warn" + ) + }, + // Pattern for anonymous function with parameters + `function($params) { $body }` as $funcSig where { + register_diagnostic( + span = $funcSig, + message = "Anonymous function expressions should be assigned to a named variable or converted to named functions for better debugging", + severity = "warn" + ) + } +} \ No newline at end of file diff --git a/packages/biome-config-godaddy/.grit/no_anonymous_functions.grit b/packages/biome-config-godaddy/.grit/no_anonymous_functions.grit new file mode 100644 index 00000000..c063d0d2 --- /dev/null +++ b/packages/biome-config-godaddy/.grit/no_anonymous_functions.grit @@ -0,0 +1,10 @@ +// Detect anonymous arrow functions with parentheses that use block statements (curly braces) +// Only flag them if they do NOT reference 'this' in the function body +`($args) => { $body }` where { + not $body <: contains `this`, + register_diagnostic( + span = $args, + message = "Anonymous arrow functions with block statements that don't reference 'this' should be converted to named function expressions for better debugging", + severity = "warn" + ) +} \ No newline at end of file diff --git a/packages/biome-config-godaddy/.grit/no_anonymous_single_param.grit b/packages/biome-config-godaddy/.grit/no_anonymous_single_param.grit new file mode 100644 index 00000000..1e403045 --- /dev/null +++ b/packages/biome-config-godaddy/.grit/no_anonymous_single_param.grit @@ -0,0 +1,10 @@ +// Detect single-parameter anonymous arrow functions that use block statements (curly braces) +// Only flag them if they do NOT reference 'this' in the function body +`$arg => { $body }` where { + not $body <: contains `this`, + register_diagnostic( + span = $arg, + message = "Anonymous arrow functions with block statements that don't reference 'this' should be converted to named function expressions for better debugging", + severity = "warn" + ) +} \ No newline at end of file diff --git a/packages/biome-config-godaddy/biome-ts.json b/packages/biome-config-godaddy/biome-ts.json index cc4d4f6a..8a139647 100644 --- a/packages/biome-config-godaddy/biome-ts.json +++ b/packages/biome-config-godaddy/biome-ts.json @@ -7,6 +7,11 @@ "lineEnding": "lf", "lineWidth": 130 }, + "plugins": [ + "./.grit/no_anonymous_functions.grit", + "./.grit/no_anonymous_single_param.grit", + "./.grit/no_anonymous_function_expressions.grit" + ], "linter": { "rules": { "recommended": false, diff --git a/packages/biome-config-godaddy/biome.json b/packages/biome-config-godaddy/biome.json index a5272625..c026c055 100644 --- a/packages/biome-config-godaddy/biome.json +++ b/packages/biome-config-godaddy/biome.json @@ -7,6 +7,11 @@ "lineEnding": "lf", "lineWidth": 130 }, + "plugins": [ + "./.grit/no_anonymous_functions.grit", + "./.grit/no_anonymous_single_param.grit", + "./.grit/no_anonymous_function_expressions.grit" + ], "linter": { "enabled": true, "rules": { diff --git a/packages/biome-config-godaddy/package-lock.json b/packages/biome-config-godaddy/package-lock.json index fde91716..641dd768 100644 --- a/packages/biome-config-godaddy/package-lock.json +++ b/packages/biome-config-godaddy/package-lock.json @@ -12,7 +12,7 @@ "@biomejs/biome": "^2.2.5" }, "peerDependencies": { - "@biomejs/biome": "^2.2.5" + "@biomejs/biome": ">= 2.2.0 < 3.0.0" } }, "node_modules/@biomejs/biome": { From 8c56f8db360fd7efda8ce94ef0878641e0e0927a Mon Sep 17 00:00:00 2001 From: Amanda Date: Thu, 9 Oct 2025 15:20:59 -0700 Subject: [PATCH 5/5] Remove grit files --- packages/biome-config-godaddy/.grit/grit.yaml | 17 ---------------- .../no_anonymous_function_expressions.grit | 20 ------------------- .../.grit/no_anonymous_functions.grit | 10 ---------- .../.grit/no_anonymous_single_param.grit | 10 ---------- packages/biome-config-godaddy/biome-ts.json | 5 ----- packages/biome-config-godaddy/biome.json | 5 ----- 6 files changed, 67 deletions(-) delete mode 100644 packages/biome-config-godaddy/.grit/grit.yaml delete mode 100644 packages/biome-config-godaddy/.grit/no_anonymous_function_expressions.grit delete mode 100644 packages/biome-config-godaddy/.grit/no_anonymous_functions.grit delete mode 100644 packages/biome-config-godaddy/.grit/no_anonymous_single_param.grit diff --git a/packages/biome-config-godaddy/.grit/grit.yaml b/packages/biome-config-godaddy/.grit/grit.yaml deleted file mode 100644 index 04ed6f78..00000000 --- a/packages/biome-config-godaddy/.grit/grit.yaml +++ /dev/null @@ -1,17 +0,0 @@ -version: 0.0.0 -patterns: - - name: no_anonymous_functions - title: No Anonymous Functions - description: "Detects anonymous arrow functions with parentheses that use block statements and don't reference 'this'" - level: warn - tags: ["style", "debugging"] - - name: no_anonymous_single_param - title: No Anonymous Single Parameter Functions - description: "Detects single-parameter anonymous arrow functions that use block statements and don't reference 'this'" - level: warn - tags: ["style", "debugging"] - - name: no_anonymous_function_expressions - title: No Anonymous Function Expressions - description: "Detects traditional anonymous function expressions" - level: warn - tags: ["style", "debugging"] \ No newline at end of file diff --git a/packages/biome-config-godaddy/.grit/no_anonymous_function_expressions.grit b/packages/biome-config-godaddy/.grit/no_anonymous_function_expressions.grit deleted file mode 100644 index 48208ce2..00000000 --- a/packages/biome-config-godaddy/.grit/no_anonymous_function_expressions.grit +++ /dev/null @@ -1,20 +0,0 @@ -// Detect anonymous function expressions (function() {} and function(params) {}) -// Uses 'as $funcSig' to capture function signature for better span highlighting -or { - // Pattern for anonymous function with no parameters - `function() { $body }` as $funcSig where { - register_diagnostic( - span = $funcSig, - message = "Anonymous function expressions should be assigned to a named variable or converted to named functions for better debugging", - severity = "warn" - ) - }, - // Pattern for anonymous function with parameters - `function($params) { $body }` as $funcSig where { - register_diagnostic( - span = $funcSig, - message = "Anonymous function expressions should be assigned to a named variable or converted to named functions for better debugging", - severity = "warn" - ) - } -} \ No newline at end of file diff --git a/packages/biome-config-godaddy/.grit/no_anonymous_functions.grit b/packages/biome-config-godaddy/.grit/no_anonymous_functions.grit deleted file mode 100644 index c063d0d2..00000000 --- a/packages/biome-config-godaddy/.grit/no_anonymous_functions.grit +++ /dev/null @@ -1,10 +0,0 @@ -// Detect anonymous arrow functions with parentheses that use block statements (curly braces) -// Only flag them if they do NOT reference 'this' in the function body -`($args) => { $body }` where { - not $body <: contains `this`, - register_diagnostic( - span = $args, - message = "Anonymous arrow functions with block statements that don't reference 'this' should be converted to named function expressions for better debugging", - severity = "warn" - ) -} \ No newline at end of file diff --git a/packages/biome-config-godaddy/.grit/no_anonymous_single_param.grit b/packages/biome-config-godaddy/.grit/no_anonymous_single_param.grit deleted file mode 100644 index 1e403045..00000000 --- a/packages/biome-config-godaddy/.grit/no_anonymous_single_param.grit +++ /dev/null @@ -1,10 +0,0 @@ -// Detect single-parameter anonymous arrow functions that use block statements (curly braces) -// Only flag them if they do NOT reference 'this' in the function body -`$arg => { $body }` where { - not $body <: contains `this`, - register_diagnostic( - span = $arg, - message = "Anonymous arrow functions with block statements that don't reference 'this' should be converted to named function expressions for better debugging", - severity = "warn" - ) -} \ No newline at end of file diff --git a/packages/biome-config-godaddy/biome-ts.json b/packages/biome-config-godaddy/biome-ts.json index 8a139647..cc4d4f6a 100644 --- a/packages/biome-config-godaddy/biome-ts.json +++ b/packages/biome-config-godaddy/biome-ts.json @@ -7,11 +7,6 @@ "lineEnding": "lf", "lineWidth": 130 }, - "plugins": [ - "./.grit/no_anonymous_functions.grit", - "./.grit/no_anonymous_single_param.grit", - "./.grit/no_anonymous_function_expressions.grit" - ], "linter": { "rules": { "recommended": false, diff --git a/packages/biome-config-godaddy/biome.json b/packages/biome-config-godaddy/biome.json index c026c055..a5272625 100644 --- a/packages/biome-config-godaddy/biome.json +++ b/packages/biome-config-godaddy/biome.json @@ -7,11 +7,6 @@ "lineEnding": "lf", "lineWidth": 130 }, - "plugins": [ - "./.grit/no_anonymous_functions.grit", - "./.grit/no_anonymous_single_param.grit", - "./.grit/no_anonymous_function_expressions.grit" - ], "linter": { "enabled": true, "rules": {