diff --git a/.editorconfig b/.editorconfig index 65365be6..e21a98ee 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,6 +8,8 @@ root = true indent_style = space indent_size = 2 +max_line_length = 120 +quote_type = single end_of_line = lf charset = utf-8 diff --git a/.oxfmtrc.json b/.oxfmtrc.json index 9d5ce399..074bfce7 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -1,5 +1,4 @@ { - "printWidth": 120, - "singleQuote": true, + "ignorePatterns": [".changeset/**", "**/lib/**"], "trailingComma": "es5" } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d71400e5..128aaa87 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,7 +39,7 @@ yarn lint To fix formatting errors, run the following: ```sh -yarn lint --fix +yarn format ``` Remember to add tests for your change if possible. Run the unit tests by: @@ -50,9 +50,9 @@ yarn test ### Linting and tests -[ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/) +[ESLint](https://eslint.org/), [oxfmt](https://oxc.rs/docs/guide/usage/formatter.html), [TypeScript](https://www.typescriptlang.org/) -We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing. +We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) for linting, [oxfmt](https://oxc.rs/docs/guide/usage/formatter.html) for formatting, and [Jest](https://jestjs.io/) for testing. Our pre-commit hooks verify that the linter and tests pass when committing. diff --git a/docs/agents/style.md b/docs/agents/style.md index 7e6c0fcb..511f4768 100644 --- a/docs/agents/style.md +++ b/docs/agents/style.md @@ -9,6 +9,6 @@ Prefer small modules. Each package exports through its `src/index.ts` — add new public symbols there explicitly. -## Prettier config +## Formatter config -Single quotes, trailing commas (ES5), `printWidth: 120`. Run `yarn lint` to enforce. +Oxfmt is the formatter. Keep shared whitespace, quote, and line-length settings in `.editorconfig` when possible; use `.oxfmtrc.json` only for options EditorConfig cannot express. Run `yarn lint` to enforce code formatting. diff --git a/test-apps/native/.oxfmtrc.json b/test-apps/native/.oxfmtrc.json index 358db5d9..4e0da720 100644 --- a/test-apps/native/.oxfmtrc.json +++ b/test-apps/native/.oxfmtrc.json @@ -1,6 +1,5 @@ { "arrowParens": "avoid", "bracketSameLine": true, - "singleQuote": true, "trailingComma": "all" }