Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .changeset/blue-rooms-swim.md
Original file line number Diff line number Diff line change
@@ -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.
46 changes: 43 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down Expand Up @@ -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';
Expand All @@ -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).
Expand Down Expand Up @@ -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/
17 changes: 17 additions & 0 deletions packages/biome-config-godaddy/.grit/grit.yaml
Original file line number Diff line number Diff line change
@@ -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"]
Original file line number Diff line number Diff line change
@@ -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"
)
}
}
10 changes: 10 additions & 0 deletions packages/biome-config-godaddy/.grit/no_anonymous_functions.grit
Original file line number Diff line number Diff line change
@@ -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"
)
}
10 changes: 10 additions & 0 deletions packages/biome-config-godaddy/.grit/no_anonymous_single_param.grit
Original file line number Diff line number Diff line change
@@ -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"
)
}
21 changes: 21 additions & 0 deletions packages/biome-config-godaddy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Loading
Loading