Skip to content

Commit

Permalink
Merge pull request #1283 from hougesen/feat/linters/oxlint
Browse files Browse the repository at this point in the history
feat: add support for oxlint as linter
  • Loading branch information
mrlubos authored Nov 13, 2024
2 parents 93ed61b + 781d1a4 commit 5fe365f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/loud-peaches-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hey-api/openapi-ts': patch
---

feat: add support for oxlint as linter
11 changes: 11 additions & 0 deletions docs/openapi-ts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,17 @@ export default {
};
```

```js [oxlint]
export default {
client: '@hey-api/client-fetch',
input: 'path/to/openapi.json',
output: {
lint: 'oxlint', // [!code ++]
path: 'src/client',
},
};
```

:::

You can also prevent your output from being linted by adding your output path to the linter's ignore file.
Expand Down
5 changes: 5 additions & 0 deletions packages/openapi-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ const linters: Record<
command: 'eslint',
name: 'ESLint',
},
oxlint: {
args: (path) => ['--fix', path],
command: 'oxlint',
name: 'oxlint',
},
};

const processOutput = ({ config }: { config: Config }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi-ts/src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export interface ClientConfig {
* Process output folder with linter?
* @default false
*/
lint?: 'biome' | 'eslint' | false;
lint?: 'biome' | 'eslint' | 'oxlint' | false;
/**
* The relative location of the output folder
*/
Expand Down

0 comments on commit 5fe365f

Please sign in to comment.