build: refactor linting

This commit is contained in:
iCrawl
2023-08-22 09:40:11 +02:00
parent 2e40a05adf
commit d37632da05
72 changed files with 427 additions and 530 deletions

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -7,8 +7,8 @@
"scripts": {
"test": "vitest run",
"build": "tsup",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
"fmt": "yarn format"
},
"type": "module",
@@ -51,7 +51,7 @@
"@vitest/coverage-v8": "^0.34.2",
"cross-env": "^7.0.3",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"tsup": "^7.2.0",

View File

@@ -1,5 +1,4 @@
export function formatTag(tag: string) {
// eslint-disable-next-line unicorn/no-unsafe-regex
const parsed = /(?:^@.*\/(?<package>.*)@v?)?(?<semver>\d+.\d+.\d+)-?.*/.exec(tag);
const parsedPackage = /(?<package>.*)@v?-?.*/.exec(tag);

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -6,8 +6,8 @@
"private": true,
"scripts": {
"build": "tsup",
"lint": "prettier --check . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
"fmt": "yarn format"
},
"exports": {
@@ -52,7 +52,7 @@
"@types/node": "16.18.41",
"cross-env": "^7.0.3",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"tsup": "^7.2.0",

View File

@@ -54,7 +54,7 @@ export function generatePath(items: readonly ApiItem[], version: string) {
}
}
// eslint-disable-next-line prefer-named-capture-group, unicorn/no-unsafe-regex
// eslint-disable-next-line prefer-named-capture-group
return path.replace(/@discordjs\/(.*)\/(.*)?/, `$1/${version}/$2`);
}

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -15,7 +15,6 @@ const mockRedisClient = {
} as unknown as Redis;
test('pubsub with custom encoding', async () => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
const encode = vi.fn((data) => data);
const broker = new PubSubRedisBroker({ redisClient: mockRedisClient, encode });

View File

@@ -7,8 +7,8 @@
"test": "vitest run",
"build": "tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
@@ -77,7 +77,7 @@
"@vitest/coverage-v8": "^0.34.2",
"cross-env": "^7.0.3",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"tsup": "^7.2.0",

View File

@@ -113,7 +113,7 @@ export abstract class BaseRedisBroker<TEvents extends Record<string, any>>
}
this.listening = true;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
while (true) {
try {
const data = await this.streamReadClient.xreadgroupBuffer(

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -102,7 +102,6 @@ describe('Application Command toJSON() results', () => {
min_value: -1,
autocomplete: true,
// TODO
// @ts-expect-error You *can* send an empty array with autocomplete: true, should correct that in types
choices: [],
});
@@ -147,7 +146,6 @@ describe('Application Command toJSON() results', () => {
min_value: -1.23,
autocomplete: true,
// TODO
// @ts-expect-error You *can* send an empty array with autocomplete: true, should correct that in types
choices: [],
});
@@ -190,7 +188,6 @@ describe('Application Command toJSON() results', () => {
required: true,
autocomplete: true,
// TODO
// @ts-expect-error you *can* send an empty array with autocomplete: true, should correct that in types
choices: [],
});

View File

@@ -7,8 +7,8 @@
"test": "vitest run",
"build": "tsup",
"build:docs": "tsc -p tsconfig.docs.json && yarn downlevel-dts ./dist-docs ./dist-docs",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
@@ -81,7 +81,7 @@
"downlevel-dts": "^0.11.0",
"esbuild-plugin-version-injector": "^1.2.0",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"tsup": "^7.2.0",

View File

@@ -59,7 +59,7 @@ export interface MappedComponentTypes {
* @param data - The API data to transform to a component class
*/
export function createComponentBuilder<T extends keyof MappedComponentTypes>(
// eslint-disable-next-line @typescript-eslint/sort-type-union-intersection-members
// eslint-disable-next-line @typescript-eslint/sort-type-constituents
data: (APIModalComponent | APIMessageComponent) & { type: T },
): MappedComponentTypes[T];

View File

@@ -6,7 +6,7 @@ import type { ContextMenuCommandType } from './ContextMenuCommandBuilder.js';
const namePredicate = s.string
.lengthGreaterThanOrEqual(1)
.lengthLessThanOrEqual(32)
// eslint-disable-next-line prefer-named-capture-group, unicorn/no-unsafe-regex
// eslint-disable-next-line prefer-named-capture-group
.regex(/^( *[\p{P}\p{L}\p{N}\p{sc=Devanagari}\p{sc=Thai}]+ *)+$/u)
.setValidationEnabled(isValidationEnabled);
const typePredicate = s

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -7,8 +7,8 @@
"test": "vitest run",
"build": "tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
@@ -67,7 +67,7 @@
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.0",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"tsup": "^7.2.0",

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -7,8 +7,8 @@
"test": "vitest run",
"build": "tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn build && yarn lint",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/core/*'",
@@ -80,7 +80,7 @@
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.0",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"tsup": "^7.2.0",

View File

@@ -1 +0,0 @@
dist

View File

@@ -1,5 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json",
"ignorePatterns": ["**/template/Deno/*"]
}

View File

@@ -5,8 +5,8 @@
"description": "A simple way to create a startup Discord bot.",
"scripts": {
"build": "tsup",
"lint": "prettier --check . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
"prepack": "yarn build && yarn lint",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/create-discord-bot/*'",
"release": "cliff-jumper"
@@ -62,7 +62,7 @@
"@vitest/coverage-v8": "^0.34.2",
"cross-env": "^7.0.3",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"terser": "^5.19.2",

View File

@@ -5,9 +5,9 @@
"private": true,
"type": "module",
"scripts": {
"lint": "prettier --check . && eslint ./src --ext .[REPLACE_IMPORT_EXT] --format=pretty",
"lint": "prettier --check . && eslint --ext .[REPLACE_IMPORT_EXT] --format=pretty src",
"deploy": "bun run src/util/deploy.[REPLACE_IMPORT_EXT]",
"format": "prettier --write . && eslint ./src --ext .[REPLACE_IMPORT_EXT] --fix --format=pretty",
"format": "prettier --write . && eslint --ext .[REPLACE_IMPORT_EXT] --fix --format=pretty src",
"start": "bun run src/index.[REPLACE_IMPORT_EXT]"
},
"dependencies": {

View File

@@ -5,9 +5,9 @@
"private": true,
"type": "module",
"scripts": {
"lint": "tsc && prettier --check . && eslint ./src --ext .[REPLACE_IMPORT_EXT] --format=pretty",
"lint": "tsc && prettier --check . && eslint --ext .[REPLACE_IMPORT_EXT] --format=pretty src",
"deploy": "bun run src/util/deploy.[REPLACE_IMPORT_EXT]",
"format": "prettier --write . && eslint ./src --ext .[REPLACE_IMPORT_EXT] --fix --format=pretty",
"format": "prettier --write . && eslint --ext .[REPLACE_IMPORT_EXT] --fix --format=pretty src",
"start": "bun run src/index.[REPLACE_IMPORT_EXT]"
},
"dependencies": {

View File

@@ -5,8 +5,8 @@
"private": true,
"type": "module",
"scripts": {
"lint": "prettier --check . && eslint src --ext .js,.cjs --format=pretty",
"format": "prettier --write . && eslint src --ext .js,.cjs --fix --format=pretty",
"lint": "prettier --check . && eslint --ext .js,.mjs,.cjs --format=pretty src",
"format": "prettier --write . && eslint --ext .js,.mjs,.cjs --fix --format=pretty src",
"start": "node --require dotenv/config src/index.js",
"deploy": "node --require dotenv/config src/util/deploy.js"
},

View File

@@ -5,5 +5,5 @@
"parserOptions": {
"project": ["./tsconfig.eslint.json"]
},
"ignorePatterns": ["dist/*"]
"ignorePatterns": ["**/dist/*"]
}

View File

@@ -6,9 +6,9 @@
"type": "module",
"scripts": {
"build": "tsc",
"lint": "prettier --check . && eslint ./src --ext .ts --format=pretty",
"lint": "prettier --check . && eslint --ext .ts --format=pretty src",
"deploy": "node --require dotenv/config dist/util/deploy.js",
"format": "prettier --write . && eslint ./src --ext .ts --fix --format=pretty",
"format": "prettier --write . && eslint --ext .ts --fix --format=pretty src",
"start": "node --require dotenv/config dist/index.js"
},
"dependencies": {

View File

@@ -6,8 +6,8 @@
"scripts": {
"test": "yarn docs:test && yarn test:typescript",
"test:typescript": "tsc --noEmit && tsd",
"lint": "prettier --check . && tslint typings/index.d.ts && eslint src --format=pretty",
"format": "prettier --write . && eslint src --fix --format=pretty",
"lint": "prettier --check . && tslint typings/index.d.ts && cross-env ESLINT_USE_FLAT_CONFIG=false eslint --format=pretty src",
"format": "prettier --write . && cross-env ESLINT_USE_FLAT_CONFIG=false eslint --fix --format=pretty src",
"fmt": "yarn format",
"docs": "docgen -i './src/*.js' './src/**/*.js' -c ./docs/index.json -r ../../ -o ./docs/docs.json",
"docs:test": "docgen -i './src/*.js' './src/**/*.js' -c ./docs/index.json -r ../../",
@@ -70,6 +70,7 @@
"@discordjs/docgen": "workspace:^",
"@favware/cliff-jumper": "2.1.1",
"@types/node": "16.18.41",
"cross-env": "^7.0.3",
"dtslint": "4.2.1",
"eslint": "8.47.0",
"eslint-formatter-pretty": "5.0.0",

View File

@@ -1,7 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../.eslintrc.json",
"parserOptions": {
"sourceType": "module"
}
}

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -1,2 +1,3 @@
.turbo
dist
coverage

View File

@@ -5,8 +5,8 @@
"description": "The docs.json generator for discord.js and its related projects",
"scripts": {
"build": "tsup",
"lint": "prettier --check . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
"fmt": "yarn format",
"prepack": "yarn format && yarn build"
},
@@ -68,7 +68,7 @@
"@types/node": "16.18.41",
"cross-env": "^7.0.3",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"tsup": "^7.2.0",

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -226,11 +226,9 @@ describe('Markdown escapers', () => {
});
test('neither inline code or code block content', () => {
expect(escapeMarkdown(testString, { inlineCodeContent: false, codeBlockContent: false }))
// eslint-disable-next-line max-len
.toEqual(
"\\`_Behold!_\\`\n\\|\\|\\_\\_\\_\\~\\~\\*\\*\\*\\`\\`\\`js\n`use strict`;\nrequire('discord.js');\\`\\`\\`\\*\\*\\*\\~\\~\\_\\_\\_\\|\\|",
);
expect(escapeMarkdown(testString, { inlineCodeContent: false, codeBlockContent: false })).toEqual(
"\\`_Behold!_\\`\n\\|\\|\\_\\_\\_\\~\\~\\*\\*\\*\\`\\`\\`js\n`use strict`;\nrequire('discord.js');\\`\\`\\`\\*\\*\\*\\~\\~\\_\\_\\_\\|\\|",
);
});
test('neither code blocks or code block content', () => {

View File

@@ -7,8 +7,8 @@
"test": "vitest run",
"build": "tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn build && yarn lint",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/formatters/*'",
@@ -63,7 +63,7 @@
"@vitest/coverage-v8": "^0.34.2",
"cross-env": "^7.0.3",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"tsup": "^7.2.0",

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -7,8 +7,8 @@
"test": "vitest run",
"build": "tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn build && yarn lint",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/next/*'",
@@ -81,7 +81,7 @@
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.0",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"tsup": "^7.2.0",

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -5,8 +5,8 @@
"description": "Lightweight HTTP proxy for Discord's API, brought to you as a container 📦",
"scripts": {
"build": "tsup",
"lint": "prettier --check . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
"fmt": "yarn format",
"prepack": "yarn lint && yarn build"
},
@@ -52,7 +52,7 @@
"@types/node": "18.17.6",
"cross-env": "^7.0.3",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"tsup": "^7.2.0",

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -7,8 +7,8 @@
"test": "vitest run",
"build": "tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
@@ -77,7 +77,7 @@
"@vitest/coverage-v8": "^0.34.2",
"cross-env": "^7.0.3",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"supertest": "^6.3.3",

View File

@@ -21,7 +21,7 @@ export function proxyRequests(rest: REST): RequestHandler {
// The 2nd parameter is here so the URL constructor doesn't complain about an "invalid url" when the origin is missing
// we don't actually care about the origin and the value passed is irrelevant
const parsedUrl = new URL(url, 'http://noop');
// eslint-disable-next-line unicorn/no-unsafe-regex, prefer-named-capture-group
// eslint-disable-next-line prefer-named-capture-group
const fullRoute = parsedUrl.pathname.replace(/^\/api(\/v\d+)?/, '') as RouteLike;
const headers: Record<string, string> = {

View File

@@ -1,12 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json",
"rules": {
"n/prefer-global/url": 0,
"n/prefer-global/url-search-params": 0,
"n/prefer-global/buffer": 0,
"n/prefer-global/process": 0,
"no-restricted-globals": 0,
"unicorn/prefer-node-protocol": 0
}
}

View File

@@ -7,8 +7,8 @@
"test": "vitest run",
"build": "tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
@@ -100,7 +100,7 @@
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.0",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"tsup": "^7.2.0",

View File

@@ -1 +0,0 @@
src/template

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -6,8 +6,8 @@
"private": true,
"scripts": {
"build": "tsup",
"lint": "prettier --check . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
"fmt": "yarn format"
},
"exports": {
@@ -68,7 +68,7 @@
"@vitest/coverage-v8": "^0.34.2",
"cross-env": "^7.0.3",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"tsup": "^7.2.0",

View File

@@ -6,8 +6,8 @@
"test": "vitest run",
"build": "tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn build && yarn lint",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/{name}/*'",

View File

@@ -1,18 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": ["../../.eslintrc.json", "neon/react", "plugin:storybook/recommended", "@unocss", "neon/prettier"],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"react/react-in-jsx-scope": 0,
"react/jsx-filename-extension": [
1,
{
"extensions": [".tsx"]
}
]
}
}

View File

@@ -6,8 +6,8 @@
"scripts": {
"test": "vitest run --config ../../vitest.config.ts",
"build": "vite build",
"lint": "prettier --check . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts,.tsx --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src --ext .mjs,.js,.ts,.tsx --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
"prepack": "yarn build && yarn lint",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/ui/*'",
"release": "cliff-jumper",
@@ -70,16 +70,15 @@
"@types/node": "16.18.41",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@unocss/eslint-config": "^0.55.2",
"@unocss/eslint-plugin": "^0.55.2",
"@unocss/reset": "^0.55.2",
"@vitejs/plugin-react": "^4.0.4",
"@vitest/coverage-c8": "^0.33.0",
"chromatic": "^6.22.0",
"chromatic": "^6.23.0",
"cross-env": "^7.0.3",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"eslint-plugin-storybook": "^0.6.13",
"prettier": "^3.0.2",
"prop-types": "^15.8.1",
"storybook": "^7.3.2",

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -7,8 +7,8 @@
"build": "tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"test": "vitest run && tsd",
"lint": "prettier --check . && TIMING=1 eslint src --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && TIMING=1 eslint src --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && TIMING=1 eslint --format=pretty src",
"format": "prettier --write . && TIMING=1 eslint --fix --format=pretty src",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
@@ -67,7 +67,7 @@
"@vitest/coverage-v8": "^0.34.2",
"cross-env": "^7.0.3",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.0.2",
"tsd": "^0.28.1",

View File

@@ -1,3 +1,5 @@
/* eslint-disable n/prefer-global/process */
export function shouldUseGlobalFetchAndWebSocket() {
// Browser env and deno when ran directly
if (typeof globalThis.process === 'undefined') {

View File

@@ -1,5 +1,4 @@
/* eslint-disable n/prefer-global/process */
/* eslint-disable no-restricted-globals */
/**
* Resolves the user agent appendix string for the current environment.

View File

@@ -1,8 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json",
"rules": {
"import/extensions": 0,
"no-restricted-globals": 0
}
}

View File

@@ -7,8 +7,8 @@
"build": "tsup && node scripts/postbuild.mjs",
"build:docs": "tsc -p tsconfig.docs.json",
"test": "jest --coverage",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
"fmt": "yarn format",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn lint && yarn test && yarn build",
@@ -79,7 +79,7 @@
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.0",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"jest": "^29.6.3",
"jest-websocket-mock": "^2.4.1",

View File

@@ -17,7 +17,6 @@ const libs = {
return null;
},
close: (opusPacket: Buffer, nonce: Buffer, secretKey: Uint8Array) => {
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
const output = Buffer.allocUnsafe(opusPacket.length + sodium.crypto_box_MACBYTES);
sodium.crypto_secretbox_easy(output, opusPacket, nonce, secretKey);
return output;

View File

@@ -1,4 +0,0 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": "../../.eslintrc.json"
}

View File

@@ -7,8 +7,8 @@
"test": "vitest run",
"build": "tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --format=pretty",
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
"docs": "yarn build:docs && api-extractor run --local && api-extractor run --local --config ./api-extractor-docs.json",
"prepack": "yarn build && yarn lint",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/ws/*'",
@@ -90,7 +90,7 @@
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.0",
"eslint": "^8.47.0",
"eslint-config-neon": "^0.1.47",
"eslint-config-neon": "^0.1.54",
"eslint-formatter-pretty": "^5.0.0",
"mock-socket": "^9.2.1",
"prettier": "^3.0.2",