Begin work on typings! Change workspace and eslint settings.

pull/2/head
BakedPVP 4 years ago
parent 495ef5a10e
commit 61395b1c24

@ -239,9 +239,9 @@
"jsdoc/check-tag-names": [ "warn" ],
"jsdoc/check-types": [ "warn" ],
"jsdoc/implements-on-classes": [ "warn" ],
"jsdoc/newline-after-description": [ "warn"],
"jsdoc/newline-after-description": [ "warn", "never" ],
"jsdoc/no-undefined-types": [ "warn" ],
"jsdoc/require-hyphen-before-param-description": [ "warn" ],
"jsdoc/require-hyphen-before-param-description": [ "warn", "never" ],
"jsdoc/require-jsdoc": [ "warn" ],
"jsdoc/require-param": [ "warn" ],
"jsdoc/require-param-description": [ "warn" ],
@ -254,6 +254,33 @@
},
"settings": {
"jsdoc": {
"preferredTypes": {
"object": "Object",
"key": "key",
"value": "value",
"snowflake": "snowflake",
"Collection": "Collection",
"Activity": "Activity",
"Attachment": "Attachment",
"AuditLog": "AuditLog",
"Channel": "Channel",
"DeconstructedSnowflake": "DeconstructedSnowflake",
"DMChannel": "DMChannel",
"Embed": "Embed",
"Emoji": "Emoji",
"GroupDMChannel": "GroupDMChannel",
"Guild": "Guild",
"GuildPreview": "GuildPreview",
"Integration": "Integration",
"Member": "Member",
"Mention": "Mention",
"Message": "Message",
"Reaction": "Reaction",
"Role": "Role",
"User": "User",
"Voice": "Voice",
"WebpackModule": "WebpackModule"
},
"tagNamePreference": {
"warn": "warn",
"bug": "bug",

@ -6,10 +6,12 @@
"todo-tree.general.tags": [
"@bug",
"@deprecated",
"@hack",
"@docs",
"@experimental",
"@i18n",
"@note",
"@powercord",
"@test",
"@todo",
"@warning"
],
@ -19,8 +21,8 @@
"todo-tree.highlights.customHighlight": {
"@bug": {
"icon": "bug",
"foreground": "#daaa4e",
"background": "#daaa4e",
"foreground": "#e87000",
"background": "#e87000",
"opacity": 0
},
"@deprecated": {
@ -29,10 +31,16 @@
"background": "#dad24e",
"opacity": 0
},
"@hack": {
"@docs": {
"icon": "book",
"foreground": "#00d5ff",
"background": "#00d5ff",
"opacity": 0
},
"@experimental": {
"icon": "beaker",
"foreground": "#4ea4da",
"background": "#4ea4da",
"foreground": "#456aff",
"background": "#456aff",
"opacity": 0
},
"@i18n": {
@ -43,20 +51,26 @@
},
"@note": {
"icon": "pencil",
"foreground": "#a868f7",
"background": "#a868f7",
"foreground": "#7842ff",
"background": "#7842ff",
"opacity": 0
},
"@powercord": {
"icon": "zap",
"foreground": "#889c54",
"background": "#889c54",
"opacity": 0
},
"@test": {
"icon": "gear",
"foreground": "#ec0ddf",
"background": "#ec0ddf",
"opacity": 0
},
"@todo": {
"icon": "checklist",
"foreground": "#89da4e",
"background": "#89da4e",
"foreground": "#34eb52",
"background": "#34eb52",
"opacity": 0
},
"@warning": {
@ -66,8 +80,12 @@
"opacity": 0
}
},
"eslint.alwaysShowStatus": true,
"eslint.debug": true,
"eslint.format.enable": true,
"eslint.lintTask.enable": true
"eslint.codeActionsOnSave.mode": "problems",
"debug.showBreakpointsInOverviewRuler": true,
"editor.rulers": [
{
"column": 90,
"color": "rgb(255 255 255 / .03)"
}
]
}

@ -0,0 +1,196 @@
/* eslint-disable spaced-comment */ /* eslint-disable multiline-comment-style */
/**
* All of the custom typings used throughout the project. I'm keeping them all stored in a
* single file, because it seems I have to keep this file opened while working on the
* project in order to get proper intellisense for custom types in VSCode. I have spent
* hours trying various way to import the typings and have had no luck, so this is my
* solution. In order for it to work, I also had to add the path of the typings file
* to jsconfig.json.
* @namespace typings
* @module typings
* @version 0.0.1
*/
//==============================================================================
// Discord Module
//==============================================================================
//--------------
// Misc
//--------------
/**
* An object with key value pairs where the key is usually a string (snowflake) and the
* value is usually an object.
* @typedef {Object<key, value>} Collection
*/
//--------------
// Emoji
//--------------
/**
* @typedef {CustomEmoji|DefaultEmoji} Emoji
* @see {@link discord.emoji}
*/
/**
* Emoji that have been uploaded to a guild.
* @typedef {Object} CustomEmoji
* @property {?string} allNameString Emoji name with colons included (can be null only in
* reaction emoji objects)
* @property {?string|Array} [name] Emoji name (can be null only in reaction emoji objects).
* Non-custom (guild) emoji have array names, because they may have more than one name (aliases).
* @property {snowflake} guildId Guild ID where the emoji was created
* @property {snowflake} [id] Emoji ID. Non-custom (guild) emoji do not have an ID.
* @property {boolean} managed Whether the emoji is managed
* @property {boolean} available Whether the emoji is available
* @property {boolean} animated Whether the emoji is animated
* @see {@link discord.emoji.guild}
*/
/**
* "Default" emoji that are inherent to Discord. There are 1741 at the time of writing this.
* @typedef {Object} DefaultEmoji
* @property {}
* @see {@link discord.emoji.default}
*/
//--------------
// User
//--------------
/**
*
* @typedef {Object} User
* @property {}
* @see {@link discord.user}
*/
//--------------
// Message
//--------------
/**
*
* @typedef {Object} Message
* @property {}
* @see {@link discord.message}
*/
/**
*
* @typedef {Object} Attachment
* @property {}
* @see {@link discord.message.attachment}
*/
/**
*
* @typedef {Object} Embed
* @property {}
* @see {@link discord.message.embed}
*/
//--------------
// Settings
//--------------
/**
*
* @typedef {Object} UserSetting
* @property {}
* @see {@link discord.settings.user}
*/
//--------------
// Guild
//--------------
/**
* Guilds in Discord represent an isolated collection of users and channels, and are often
* referred to as "servers" in the Discord UI.
* <info>It's recommended to see if a guild is available before performing operations or
* reading data from it. You can check this with @see {@link discord.guild#isAvailable}.
* Reasons it may be unavailable are an outage or not currently cached.</info>
* @typedef {Object} Guild
*/
/**
*
* @typedef {Object} Member
*/
/**
*
* @typedef {Object} Role
* @property {}
* @see {@link discord.guild.role}
*/
//--------------
// Channel
//--------------
/**
*
* @typedef {Object} Channel
*/
//--------------
// Activity
//--------------
/**
*
* @typedef {Object} Activity
*/
//--------------
// Snowflake
//--------------
/**
* A Twitter snowflake, except the epoch is 2015-01-01T00:00:00.000Z
* ```
* If we have a snowflake '266241948824764416' we can represent it as binary:
*
* 64 22 17 12 0
* 000000111011000111100001101001000101000000 00001 00000 000000000000
* number of ms since Discord epoch worker pid increment
* ```
* Sourced from @see {@link https://discord.js.org|discord.js}
* @typedef {string} snowflake
*/
/**
* A deconstructed snowflake.
* Sourced from @see {@link https://discord.js.org|discord.js}
* @typedef {Object} DeconstructedSnowflake
* @property {number} timestamp Timestamp the snowflake was created
* @property {Date} date Date the snowflake was created
* @property {number} workerID Worker ID in the snowflake
* @property {number} processID Process ID in the snowflake
* @property {number} increment Increment in the snowflake
* @property {string} binary Binary representation of the snowflake
*/
//==============================================================================
// Webpack Module
//==============================================================================
/**
* @typedef {Object} WebpackModule
* @property {string} test
*/
Loading…
Cancel
Save