Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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/
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

220 changes: 220 additions & 0 deletions packages/biome-config-godaddy/README.md
Original file line number Diff line number Diff line change
@@ -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

Loading
Loading