Skip to content

Commit 55f40a1

Browse files
Add biome-config-godaddy (#1189)
* Add biome-config-godaddy * Replace tabs with spaces in biome-ts.json * Add changeset and remove unnecessary rules * Add grit plugins back * Remove grit files
1 parent ef5340b commit 55f40a1

File tree

9 files changed

+1161
-3
lines changed

9 files changed

+1161
-3
lines changed

.changeset/blue-rooms-swim.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
"biome-config-godaddy": major
3+
---
4+
5+
Initial release of biome-config-godaddy, a fast Rust-based alternative to ESLint and Prettier configurations for GoDaddy JavaScript applications.
6+
7+
A comprehensive Biome configuration package that provides consistent code quality and formatting standards across GoDaddy's JavaScript ecosystem, featuring:
8+
9+
- **Dual configuration support** with dedicated configs for JavaScript (`biome.json`) and TypeScript (`biome-ts.json`) projects
10+
- **Complete rule parity** with existing `eslint-config-godaddy` and `eslint-config-godaddy-typescript` standards, auto-migrated using Biome's migration tools
11+
- **Consistent formatting rules** including 2-space indentation, 130 character line width, LF line endings, and single quote preferences
12+
- **Performance optimizations** through Rust-based implementation providing significantly faster linting and formatting compared to traditional ESLint + Prettier setups
13+
- **Biome 2.2.0+ compatibility** utilizing the latest linting rules for full feature parity with GoDaddy's established ESLint configurations
14+
- **Seamless integration** designed for easy adoption in GoDaddy's monorepo ecosystem and existing JavaScript projects
15+
16+
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.

README.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# godaddy-style
22

3-
Official GoDaddy JavaScript styleguide. It includes `eslint` packages for various use-cases and can be used as a standard in any new project.
3+
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.
44

55
- [`eslint-config-godaddy`]: Base configuration for _non-React_, ES6 JavaScript applications
66
- [`eslint-config-godaddy-react`]: Configuration for ES6 React JavaScript applications
77
- [`eslint-config-godaddy-typescript`]: Configuration for ES6 TypeScript applications
88
- [`eslint-config-godaddy-react-typescript`]: Configuration for ES6 React JavaScript applications
9+
- [`biome-config-godaddy`]: Fast Rust-based alternative to ESLint and Prettier using Biome
910

1011
There are many useful features:
1112

@@ -41,13 +42,18 @@ npm i eslint-config-godaddy-typescript --save-dev
4142

4243
# OR (ES6 with React and TypeScript rules)
4344
npm i eslint-config-godaddy-react-typescript --save-dev
45+
46+
# OR (BiomeJS with JS and TS rules available)
47+
npm i biome-config-godaddy --save-dev
4448
```
4549

4650
## Usage
4751

48-
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.
52+
There are different ways to use this styleguide depending on your tooling preference and performance requirements.
53+
54+
### ESLint Configuration
4955

50-
### 2. Define your local `eslint.config.js|mjs` and run `eslint` yourself
56+
Define your local `eslint.config.js|mjs` and run `eslint` yourself:
5157

5258
``` js
5359
import GDConfig from 'eslint-config-godaddy';
@@ -73,6 +79,39 @@ The `--fix` option in `eslint` is [**only** available as a CLI option](https://g
7379
}
7480
```
7581

82+
### Biome Configuration
83+
84+
For improved performance, use the Biome configuration. Create a `biome.json` file:
85+
86+
```json
87+
{
88+
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
89+
"extends": ["biome-config-godaddy/biome.json"]
90+
}
91+
```
92+
93+
For TypeScript projects:
94+
95+
```json
96+
{
97+
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
98+
"extends": ["biome-config-godaddy/biome-ts.json"]
99+
}
100+
```
101+
102+
Add these scripts to your `package.json`:
103+
104+
```json
105+
{
106+
"scripts": {
107+
"lint": "biome lint .",
108+
"lint:fix": "biome lint --write .",
109+
"format": "biome format --write .",
110+
"check": "biome check --write ."
111+
}
112+
}
113+
```
114+
76115
## Additional Best Practices
77116

78117
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]
174213
[`eslint-config-godaddy-react`]: /packages/eslint-config-godaddy-react
175214
[`eslint-config-godaddy-typescript`]: /packages/eslint-config-godaddy-typescript
176215
[`eslint-config-godaddy-react-typescript`]: /packages/eslint-config-godaddy-react-typescript
216+
[`biome-config-godaddy`]: /packages/biome-config-godaddy
177217
[changesets]: https://github.com/changesets/changesets
178218
[pnpm]: https://pnpm.io/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# biome-config-godaddy
2+
3+
## 1.0.0
4+
5+
### Major Changes
6+
7+
- **Initial release** of biome-config-godaddy - A fast, Rust-based alternative to ESLint and Prettier configurations
8+
- **Dual configuration support**:
9+
- `biome.json` - Base configuration for JavaScript projects
10+
- `biome-ts.json` - Enhanced configuration for TypeScript projects
11+
- **Complete linting rule parity** with `eslint-config-godaddy` standards using Biome 2.2.0+ features
12+
- **Consistent formatting rules**:
13+
- 2-space indentation
14+
- 130 character line width
15+
- LF line endings
16+
- Single quotes preference
17+
- Automatic semicolon insertion
18+
- **Performance optimizations**: Rust-based implementation provides 15x faster linting and formatting
19+
- **Biome 2.2.0+ requirement**: Utilizes latest Biome features for full ESLint config compatibility
20+
- **Monorepo integration**: Designed for seamless integration with GoDaddy's JavaScript tooling ecosystem
21+
Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
# biome-config-godaddy
2+
3+
Base Biome configuration for JavaScript applications officially used at GoDaddy.
4+
5+
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.
6+
7+
**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.
8+
9+
Have a question or comment? [Open an issue!][issues]
10+
11+
#### Example basic setup
12+
13+
```json
14+
{
15+
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
16+
"extends": ["biome-config-godaddy/biome.json"]
17+
}
18+
```
19+
20+
## Installation
21+
22+
Install the package and its peer dependency using pnpm:
23+
24+
```sh
25+
pnpm install biome-config-godaddy @biomejs/biome --save-dev
26+
```
27+
28+
Or with npm:
29+
30+
```sh
31+
npm install biome-config-godaddy @biomejs/biome --save-dev
32+
```
33+
34+
## Configuration
35+
36+
### Options
37+
38+
This package provides two configuration files:
39+
40+
- `biome.json` - Base configuration for JavaScript projects
41+
- `biome-ts.json` - Enhanced configuration for TypeScript projects
42+
43+
Both configurations include:
44+
45+
- **Formatter settings**: 2-space indentation, 130 character line width, LF line endings
46+
- **Linter rules**: Comprehensive rules aligned with `eslint-config-godaddy` standards
47+
- **Fast performance**: Rust-based implementation for improved build times
48+
49+
#### Example JavaScript project
50+
51+
Create a `biome.json` file in your project root:
52+
53+
```json
54+
{
55+
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
56+
"extends": ["biome-config-godaddy/biome.json"]
57+
}
58+
```
59+
60+
#### Example TypeScript project
61+
62+
For TypeScript projects, use the TypeScript-specific configuration:
63+
64+
```json
65+
{
66+
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
67+
"extends": ["biome-config-godaddy/biome-ts.json"]
68+
}
69+
```
70+
71+
#### Example with custom overrides
72+
73+
Extend the base configuration and add project-specific rules:
74+
75+
```json
76+
{
77+
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
78+
"extends": ["biome-config-godaddy/biome.json"],
79+
"linter": {
80+
"rules": {
81+
"suspicious": {
82+
"noConsoleLog": "off"
83+
},
84+
"style": {
85+
"useNodejsImportProtocol": "error"
86+
}
87+
}
88+
}
89+
}
90+
```
91+
92+
#### Example package.json scripts
93+
94+
Add these scripts to your `package.json` for common development workflows:
95+
96+
```json
97+
{
98+
"scripts": {
99+
"lint": "biome lint .",
100+
"lint:fix": "biome lint --write .",
101+
"format": "biome format --write .",
102+
"format:check": "biome format .",
103+
"check": "biome check --write .",
104+
"check:ci": "biome check ."
105+
}
106+
}
107+
```
108+
109+
## Commands
110+
111+
### `format` command
112+
113+
Formats all files in the current directory and subdirectories according to GoDaddy style rules.
114+
115+
#### Example `format` usage
116+
117+
```sh
118+
# Format and write changes
119+
biome format --write .
120+
121+
# Check formatting without making changes
122+
biome format .
123+
```
124+
125+
### `lint` command
126+
127+
Analyzes code for potential issues using GoDaddy's linting standards.
128+
129+
#### Example `lint` usage
130+
131+
```sh
132+
# Lint all files
133+
biome lint .
134+
135+
# Lint with auto-fix
136+
biome lint --write .
137+
138+
# Lint specific files
139+
biome lint src/**/*.js
140+
```
141+
142+
### `check` command
143+
144+
Combines linting and formatting in a single operation for comprehensive code quality checks.
145+
146+
#### Example `check` usage
147+
148+
```sh
149+
# Check and fix all issues
150+
biome check --write .
151+
152+
# Dry run to see what would change
153+
biome check .
154+
155+
# Check specific directories
156+
biome check src/ tests/
157+
```
158+
159+
## Lifecycles
160+
161+
### `pre-commit`
162+
163+
Integrate with Git hooks to ensure code quality before commits.
164+
165+
#### Example `pre-commit` setup
166+
167+
```json
168+
{
169+
"scripts": {
170+
"pre-commit": "biome check --write --staged"
171+
}
172+
}
173+
```
174+
175+
### Continuous integration
176+
177+
Validate code quality in CI pipelines without making changes.
178+
179+
#### Example CI validation
180+
181+
```json
182+
{
183+
"scripts": {
184+
"ci:lint": "biome check .",
185+
"ci:format": "biome format ."
186+
}
187+
}
188+
```
189+
190+
## How it works
191+
192+
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.
193+
194+
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.
195+
196+
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.
197+
198+
## Related Packages
199+
200+
This Biome configuration is designed to be a drop-in replacement for GoDaddy's ESLint configurations:
201+
202+
- [`eslint-config-godaddy`][eslint-base] - Base ESLint config (equivalent to `biome.json`)
203+
- [`eslint-config-godaddy-typescript`][eslint-typescript] - ESLint config for TypeScript (equivalent to `biome-ts.json`)
204+
- [`eslint-config-godaddy-react`][eslint-react] - ESLint config for React applications
205+
- [`eslint-config-godaddy-react-typescript`][eslint-react-ts] - ESLint config for React with TypeScript
206+
207+
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.
208+
209+
## License
210+
211+
[MIT][license]
212+
213+
[biome]: https://biomejs.dev/
214+
[issues]: https://github.com/godaddy/javascript/issues/new
215+
[license]: https://github.com/godaddy/javascript/blob/main/LICENSE
216+
[eslint-base]: https://www.npmjs.com/package/eslint-config-godaddy
217+
[eslint-typescript]: https://www.npmjs.com/package/eslint-config-godaddy-typescript
218+
[eslint-react]: https://www.npmjs.com/package/eslint-config-godaddy-react
219+
[eslint-react-ts]: https://www.npmjs.com/package/eslint-config-godaddy-react-typescript
220+

0 commit comments

Comments
 (0)