Skip to content

Commit

Permalink
chore: update to eslint v9
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed May 16, 2024
1 parent 509a037 commit e63c598
Show file tree
Hide file tree
Showing 9 changed files with 328 additions and 1,235 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

8 changes: 0 additions & 8 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ await ofetch("https://google.com/404");
To catch error response:

```ts
await ofetch("/url").catch((err) => err.data);
await ofetch("/url").catch((error) => error.data);
```

To bypass status error catching you can set `ignoreResponseError` option:
Expand Down
11 changes: 11 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import unjs from "eslint-config-unjs";

// https://github.com/unjs/eslint-config
export default unjs({
ignores: [],
rules: {
"no-undef": 0,
"unicorn/consistent-destructuring": 0,
"unicorn/no-await-expression-member": 0
},
});
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
"scripts": {
"build": "unbuild",
"dev": "vitest",
"lint": "eslint --ext .ts . && prettier -c src test playground examples",
"lint:fix": "eslint --fix --ext .ts . && prettier -w src test playground examples",
"lint": "eslint . && prettier -c src test playground examples",
"lint:fix": "eslint --fix . && prettier -w src test playground examples",
"prepack": "pnpm build",
"play": "jiti playground/index.ts",
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
Expand All @@ -78,8 +78,8 @@
"@types/node": "^20.12.12",
"@vitest/coverage-v8": "^1.6.0",
"changelogen": "^0.5.5",
"eslint": "^8.57.0",
"eslint-config-unjs": "^0.2.1",
"eslint": "^9.2.0",
"eslint-config-unjs": "^0.3.1",
"fetch-blob": "^4.0.0",
"formdata-polyfill": "^4.0.10",
"h3": "^1.11.1",
Expand All @@ -92,4 +92,4 @@
"vitest": "^1.6.0"
},
"packageManager": "[email protected]"
}
}
3 changes: 1 addition & 2 deletions playground/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ async function main() {
// const r = await $fetch<string>('http://google.com/404')
const r = await $fetch<string>("http://httpstat.us/500");
// const r = await $fetch<string>('http://httpstat/500')
// eslint-disable-next-line no-console

console.log(r);
}

// eslint-disable-next-line unicorn/prefer-top-level-await
main().catch((error) => {
// eslint-disable-next-line no-console
console.error(error);
// eslint-disable-next-line unicorn/no-process-exit
process.exit(1);
Expand Down
Loading

0 comments on commit e63c598

Please sign in to comment.