mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
build: refactor linting
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/eslintrc.json",
|
||||
"extends": "../../.eslintrc.json"
|
||||
}
|
||||
@@ -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: [],
|
||||
});
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user