Skip to content

Commit

Permalink
Merge pull request #521 from ClarityCafe/dependabot/npm_and_yarn/esli…
Browse files Browse the repository at this point in the history
…nt-9.0.0

Bump eslint from 8.52.0 to 9.0.0
  • Loading branch information
sr229 authored Apr 10, 2024
2 parents 8d2188a + 7e68180 commit ffd5888
Show file tree
Hide file tree
Showing 16 changed files with 60 additions and 66 deletions.
17 changes: 14 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
{
"name": "Bun",
// See complete list https://hub.docker.com/r/oven/bun
"image": "oven/bun",
"image": "oven/bun:debian",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
// Http
3000
],
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"upgradePackages": true,
"username": "bun",
"userUid": 1000,
"userGid": 1000
}
},
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
"esbenp.prettier-vscode",
"oven.bun-vscode"
]
}
}
},

"remoteUser": "bun"
}
12 changes: 0 additions & 12 deletions .eslintignore

This file was deleted.

31 changes: 0 additions & 31 deletions .eslintrc.json

This file was deleted.

7 changes: 6 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "editorconfig.editorconfig"]
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"editorconfig.editorconfig",
"oven.bun-vscode"
]
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
}
Binary file modified bun.lockb
Binary file not shown.
16 changes: 16 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";


export default [
{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
ignores: [
"*.config.*",
"tests/**"
]
}
];
6 changes: 3 additions & 3 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @typescript-eslint/no-explicit-any */


import bent from "bent";
import debug from "debug";
import FormData from "form-data";
Expand Down
2 changes: 1 addition & 1 deletion lib/response.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */
interface HeaderIndex {
id: number;
parent_id: number;
Expand Down
4 changes: 2 additions & 2 deletions lib/sites.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/naming-convention */
import { Result, ResultData } from "./response";
import { SagiriClientError } from "./errors";

Expand Down
9 changes: 5 additions & 4 deletions lib/util.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-explicit-any */

import { Result } from "./response";
import sites from "./sites";

export const generateMask = (masks: number[]): number =>
// eslint-disable-next-line prefer-template

masks.reduce((prev, curr) => {
/* SauceNao API skips index 17 as it is reserved meaning all bitshifts above 17 are off by 1 */
if (curr > 16)
Expand All @@ -15,7 +16,7 @@ export const generateMask = (masks: number[]): number =>
}, 0);

export function resolveResult(result: Result): any {
/* eslint-disable @typescript-eslint/no-unnecessary-condition */

const { data, header } = result;
const id = header.index_id;

Expand All @@ -37,5 +38,5 @@ export function resolveResult(result: Result): any {
name,
...(authorData?.(result.data) ?? { authorName: null, authorUrl: null }),
};
/* eslint-enable */

}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"scripts": {
"build": "tsc",
"coverage": "jest --coverage",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
"lint": "eslint . --fix",
"format": "prettier . --write --config .prettierrc",
"prepublishOnly": "npm run build",
"test": "jest",
Expand All @@ -53,29 +53,33 @@
"form-data": "^4.0.0"
},
"devDependencies": {
"@eslint/js": "^9.0.0",
"@types/bent": "7.3.8",
"@types/bun": "latest",
"@types/debug": "4.1.10",
"@types/jest": "29.2.5",
"@types/lodash.ismatch": "4.4.7",
"@types/node": "20.8.7",
"@typescript-eslint/eslint-plugin": "6.8.0",
"@typescript-eslint/parser": "6.21.0",
"cross-env": "7.0.3",
"eslint": "8.52.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-prettier": "5.0.1",
"eslint-plugin-react": "7.34.1",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-sift": "0.3.1",
"globals": "^15.0.0",
"jest": "29.6.2",
"lodash.ismatch": "4.4.0",
"nock": "13.5.0",
"parse-multipart": "1.0.4",
"prettier": "3.0.0",
"ts-jest": "29.1.1",
"ts-node": "10.9.2",
"typescript": "5.3.3"
"typescript": "5.3.3",
"typescript-eslint": "^7.6.0"
},
"files": [
"dist"
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */

// SauceNao output of https://owo.whats-th.is/6MtFNmm.png (upload of image.png)
export const normalData = {
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/expectations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */

export const normalExpectations = [
{
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/remoteData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */

const remoteData = {
"https://www.pixiv.net/member_illust.php?mode=medium&illust_id=41817184": `<!DOCTYPE html>
Expand Down
4 changes: 2 additions & 2 deletions tests/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/naming-convention */

import isMatch from "lodash.ismatch";
import nock from "nock";
Expand Down

0 comments on commit ffd5888

Please sign in to comment.