Skip to content

Commit e63c598

Browse files
committed
chore: update to eslint v9
1 parent 509a037 commit e63c598

File tree

9 files changed

+328
-1235
lines changed

9 files changed

+328
-1235
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ await ofetch("https://google.com/404");
9999
To catch error response:
100100

101101
```ts
102-
await ofetch("/url").catch((err) => err.data);
102+
await ofetch("/url").catch((error) => error.data);
103103
```
104104

105105
To bypass status error catching you can set `ignoreResponseError` option:

eslint.config.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import unjs from "eslint-config-unjs";
2+
3+
// https://github.com/unjs/eslint-config
4+
export default unjs({
5+
ignores: [],
6+
rules: {
7+
"no-undef": 0,
8+
"unicorn/consistent-destructuring": 0,
9+
"unicorn/no-await-expression-member": 0
10+
},
11+
});

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
"scripts": {
6363
"build": "unbuild",
6464
"dev": "vitest",
65-
"lint": "eslint --ext .ts . && prettier -c src test playground examples",
66-
"lint:fix": "eslint --fix --ext .ts . && prettier -w src test playground examples",
65+
"lint": "eslint . && prettier -c src test playground examples",
66+
"lint:fix": "eslint --fix . && prettier -w src test playground examples",
6767
"prepack": "pnpm build",
6868
"play": "jiti playground/index.ts",
6969
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
@@ -78,8 +78,8 @@
7878
"@types/node": "^20.12.12",
7979
"@vitest/coverage-v8": "^1.6.0",
8080
"changelogen": "^0.5.5",
81-
"eslint": "^8.57.0",
82-
"eslint-config-unjs": "^0.2.1",
81+
"eslint": "^9.2.0",
82+
"eslint-config-unjs": "^0.3.1",
8383
"fetch-blob": "^4.0.0",
8484
"formdata-polyfill": "^4.0.10",
8585
"h3": "^1.11.1",
@@ -92,4 +92,4 @@
9292
"vitest": "^1.6.0"
9393
},
9494
"packageManager": "pnpm@9.1.1"
95-
}
95+
}

playground/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ async function main() {
44
// const r = await $fetch<string>('http://google.com/404')
55
const r = await $fetch<string>("http://httpstat.us/500");
66
// const r = await $fetch<string>('http://httpstat/500')
7-
// eslint-disable-next-line no-console
7+
88
console.log(r);
99
}
1010

1111
// eslint-disable-next-line unicorn/prefer-top-level-await
1212
main().catch((error) => {
13-
// eslint-disable-next-line no-console
1413
console.error(error);
1514
// eslint-disable-next-line unicorn/no-process-exit
1615
process.exit(1);

0 commit comments

Comments
 (0)