Merge remote-tracking branch 'origin/main' into thumbnail_sizes

This commit is contained in:
Dessalines 2024-06-15 10:46:08 -04:00
commit 933553baaa
8 changed files with 349 additions and 398 deletions

View file

@ -1,44 +0,0 @@
{
"root": true,
"env": {
"browser": true
},
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"ignorePatterns": ["putTypesInIndex.js"],
"parserOptions": {
"project": "./tsconfig.json",
"warnOnUnsupportedTypeScriptVersion": false
},
"rules": {
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"arrow-body-style": 0,
"curly": 0,
"eol-last": 0,
"eqeqeq": 0,
"func-style": 0,
"import/no-duplicates": 0,
"max-statements": 0,
"max-params": 0,
"new-cap": 0,
"no-console": 0,
"no-duplicate-imports": 0,
"no-extra-parens": 0,
"no-return-assign": 0,
"no-throw-literal": 1,
"no-trailing-spaces": 0,
"no-unused-expressions": 0,
"no-useless-constructor": 0,
"no-useless-escape": 0,
"no-var": 0,
"prefer-const": 0,
"prefer-rest-params": 0,
"quote-props": 0,
"unicorn/filename-case": 0
}
}

49
eslint.config.mjs Normal file
View file

@ -0,0 +1,49 @@
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
export default [
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
parser: tseslint.parser,
},
},
// For some reason this has to be in its own block
{
ignores: ["putTypesInIndex.js", "dist/*", "docs/*"],
},
{
files: ["src/**/*"],
rules: {
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"arrow-body-style": 0,
curly: 0,
"eol-last": 0,
eqeqeq: 0,
"func-style": 0,
"import/no-duplicates": 0,
"max-statements": 0,
"max-params": 0,
"new-cap": 0,
"no-console": 0,
"no-duplicate-imports": 0,
"no-extra-parens": 0,
"no-return-assign": 0,
"no-throw-literal": 1,
"no-trailing-spaces": 0,
"no-unused-expressions": 0,
"no-useless-constructor": 0,
"no-useless-escape": 0,
"no-var": 0,
"prefer-const": 0,
"prefer-rest-params": 0,
"quote-props": 0,
"unicorn/filename-case": 0,
},
},
];

View file

@ -1,7 +1,7 @@
{ {
"name": "lemmy-js-client", "name": "lemmy-js-client",
"description": "A javascript / typescript client for Lemmy", "description": "A javascript / typescript client for Lemmy",
"version": "0.19.4-alpha.18", "version": "0.19.4",
"author": "Dessalines <tyhou13@gmx.com>", "author": "Dessalines <tyhou13@gmx.com>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "./dist/index.js", "main": "./dist/index.js",
@ -11,19 +11,18 @@
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"docs": "typedoc src/index.ts", "docs": "typedoc src/index.ts",
"lint": "tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src && prettier --check src", "lint": "tsc --noEmit && eslint --report-unused-disable-directives && prettier --check src",
"prepare": "pnpm run build && husky" "prepare": "pnpm run build && husky"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/LemmyNet/lemmy-js-client.git" "url": "git+https://github.com/LemmyNet/lemmy-js-client.git"
}, },
"dependencies": {},
"devDependencies": { "devDependencies": {
"@types/node": "^20.11.19", "@types/node": "^20.11.19",
"@typescript-eslint/eslint-plugin": "^7.0.1", "@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1", "@typescript-eslint/parser": "^7.0.1",
"eslint": "^8.56.0", "eslint": "^9.0.0",
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.1.3",
"husky": "^9.0.11", "husky": "^9.0.11",
"lint-staged": "^15.2.2", "lint-staged": "^15.2.2",
@ -33,9 +32,10 @@
"prettier-plugin-packagejson": "^2.4.11", "prettier-plugin-packagejson": "^2.4.11",
"sortpack": "^2.4.0", "sortpack": "^2.4.0",
"typedoc": "^0.25.8", "typedoc": "^0.25.8",
"typescript": "^5.3.3" "typescript": "^5.3.3",
"typescript-eslint": "^7.9.0"
}, },
"packageManager": "pnpm@9.0.6+sha256.0624e30eff866cdeb363b15061bdb7fd9425b17bc1bb42c22f5f4efdea21f6b3", "packageManager": "pnpm@9.1.4",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"lint-staged": { "lint-staged": {
"*.{ts,tsx,js}": [ "*.{ts,tsx,js}": [

File diff suppressed because it is too large Load diff

5
renovate.json Normal file
View file

@ -0,0 +1,5 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"schedule": ["before 4am on the first day of the month"]
}

View file

@ -5,5 +5,4 @@ export interface ImageDetails {
width: number; width: number;
height: number; height: number;
content_type: string; content_type: string;
published: string;
} }

View file

@ -89,8 +89,6 @@ export type LemmyErrorType =
| { error: "person_is_banned_from_site"; message: string } | { error: "person_is_banned_from_site"; message: string }
| { error: "invalid_vote_value" } | { error: "invalid_vote_value" }
| { error: "page_does_not_specify_creator" } | { error: "page_does_not_specify_creator" }
| { error: "page_does_not_specify_group" }
| { error: "no_community_found_in_cc" }
| { error: "no_email_setup" } | { error: "no_email_setup" }
| { error: "local_site_not_setup" } | { error: "local_site_not_setup" }
| { error: "email_smtp_server_needs_a_port" } | { error: "email_smtp_server_needs_a_port" }
@ -153,7 +151,6 @@ export type LemmyErrorType =
| { error: "permissive_regex" } | { error: "permissive_regex" }
| { error: "invalid_regex" } | { error: "invalid_regex" }
| { error: "captcha_incorrect" } | { error: "captcha_incorrect" }
| { error: "password_reset_limit_reached" }
| { error: "couldnt_create_audio_captcha" } | { error: "couldnt_create_audio_captcha" }
| { error: "invalid_url_scheme" } | { error: "invalid_url_scheme" }
| { error: "couldnt_send_webmention" } | { error: "couldnt_send_webmention" }
@ -166,4 +163,5 @@ export type LemmyErrorType =
| { error: "invalid_bot_action" } | { error: "invalid_bot_action" }
| { error: "cant_block_local_instance" } | { error: "cant_block_local_instance" }
| { error: "url_without_domain" } | { error: "url_without_domain" }
| { error: "inbox_timeout" }
| { error: "unknown"; message: string }; | { error: "unknown"; message: string };

View file

@ -4,7 +4,7 @@ export interface Register {
username: string; username: string;
password: string; password: string;
password_verify: string; password_verify: string;
show_nsfw: boolean; show_nsfw?: boolean;
email?: string; email?: string;
captcha_uuid?: string; captcha_uuid?: string;
captcha_answer?: string; captcha_answer?: string;