Skip to content

Commit

Permalink
fix doc lint & lock
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Oct 14, 2024
1 parent 7bb6ff8 commit 7189c1b
Show file tree
Hide file tree
Showing 16 changed files with 3,850 additions and 3,855 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ export default class BasicAdapter extends BaseObject {
/**
* Uses the current build's config module to determine
* the environment.
*
* @property environment
* @type {String}
*/
get environment() {
if (!this.__environment) {
Expand All @@ -40,7 +37,6 @@ export default class BasicAdapter extends BaseObject {
/**
* A wrapper for `console.warn`.
*
* @method warn
*/
warn(...args: any[]) {
return console.warn(...args);
Expand Down Expand Up @@ -91,8 +87,6 @@ export default class BasicAdapter extends BaseObject {
* The idea is to control errors triggered by the inspector
* and make sure that users don't get mislead by inspector-caused
* bugs.
*
* @method handleError
* @param {Error} error
*/
handleError(error: any) {
Expand All @@ -115,8 +109,6 @@ export default class BasicAdapter extends BaseObject {
A promise that resolves when the connection
with the inspector is set up and ready.
@return {Promise}
*/
connect() {
return new Promise((resolve, reject) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import BasicAdapter from './basic';
import { run } from '@ember/runloop';

export default class WebExtension extends BasicAdapter {
declare private _channel: MessageChannel;
declare private _chromePort: MessagePort;
private declare _channel: MessageChannel;
private declare _chromePort: MessagePort;
init() {
this._channel = new MessageChannel();
this._chromePort = this._channel?.port1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import type SourceMapSupport from '@ember/debug/ember-inspector-support/libs/sou

export default class DeprecationDebug extends DebugPort {
declare options: any;
declare private _warned: boolean;
private declare _warned: boolean;
declare debounce: any;
declare private _watching: any;
private declare _watching: any;
declare deprecationsToSend: {
stackStr: string;
message: string;
Expand All @@ -19,10 +19,10 @@ export default class DeprecationDebug extends DebugPort {
id: string;
sources: any[];
}[];
declare private sourceMap: SourceMapSupport;
private declare sourceMap: SourceMapSupport;
declare groupedDeprecations: any;
declare deprecations: any;
declare private __emberCliConfig: any;
private declare __emberCliConfig: any;
static {
this.prototype.portNamespace = 'deprecation';
this.prototype.sourceMap = new SourceMap();
Expand Down
10 changes: 0 additions & 10 deletions packages/@ember/debug/ember-inspector-support/general-debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ export default class GeneralDebug extends DebugPort {
* Contains ember-cli configuration info.
*
* Info used to determine the file paths of an ember-cli app.
*
* @return {Object}
* {String} environment ex: 'development'
* {String} modulePrefix ex: 'my-app'
* {String} podModulePrefix ex: 'my-app/pods'
* {Boolean} usePodsByDefault
*/
emberCliConfig = this.getAppConfig();

Expand Down Expand Up @@ -130,10 +124,6 @@ export default class GeneralDebug extends DebugPort {

/**
* Finds a meta tag by searching through a certain meta attribute.
*
* @param {String} attribute
* @param {RegExp} regExp
* @return {Element}
*/
function findMetaTag(attribute: string, regExp = /.*/) {
let metas = document.querySelectorAll(`meta[${attribute}]`);
Expand Down
16 changes: 0 additions & 16 deletions packages/@ember/debug/ember-inspector-support/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ function loadEmberDebug(
/**
* Get all the Ember.Application instances from Ember.Namespace.NAMESPACES
* and add our own applicationId and applicationName to them
* @return {*}
*/
function getApplications() {
let namespaces = A(Namespace.NAMESPACES);
Expand Down Expand Up @@ -250,10 +249,6 @@ function loadEmberDebug(
/**
* Checks if a version is between two different versions.
* version should be >= left side, < right side
*
* @param {String} version1
* @param {String} version2
* @return {Boolean}
*/
function versionTest(version: string, between: [string, string]) {
let fromVersion = between[0];
Expand All @@ -272,10 +267,6 @@ function loadEmberDebug(
* `-1` if version1 < version
* 0 if version1 == version2
* 1 if version1 > version2
*
* @param {String} version1
* @param {String} version2
* @return {Boolean} result of the comparison
*/
function compareVersion(version1: string, version2: string) {
let compared, i;
Expand All @@ -292,19 +283,12 @@ function loadEmberDebug(

/**
* Remove -alpha, -beta, etc from versions
*
* @param {String} version
* @return {String} The cleaned up version
*/
function cleanupVersion(version: string) {
return version.replace(/-.*/g, '');
}

/**
* @method compare
* @param {Number} val
* @param {Number} number
* @return {Number}
* 0: same
* -1: <
* 1: >
Expand Down
12 changes: 0 additions & 12 deletions packages/@ember/debug/ember-inspector-support/libs/render-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ export default class RenderTree {
/**
* Sets up the initial options.
*
* @method constructor
* @param {Object} options
* - {owner} owner The Ember app's owner.
* - {Function} retainObject Called to retain an object for future inspection.
Expand Down Expand Up @@ -201,9 +200,6 @@ export default class RenderTree {
* bounds: Option<'single' | 'range'>;
* children: SerializedRenderNode[];
* }
*
* @method build
* @return {Array<SerializedRenderNode>} The render nodes tree.
*/
build() {
this._reset();
Expand All @@ -218,9 +214,6 @@ export default class RenderTree {

/**
* Find a render node by id.
*
* @param {string} id A render node id.
* @return {Option<SerializedRenderNode>} A render node with the given id, if any.
*/
find(id: string): CapturedRenderNode | null {
let node = this.nodes[id];
Expand All @@ -235,7 +228,6 @@ export default class RenderTree {
/**
* Find the deepest enclosing render node for a given DOM node.
*
* @method findNearest
* @param {Node} node A DOM node.
* @param {string} hint The id of the last-matched render node (see comment below).
* @return {Option<SerializedRenderNode>} The deepest enclosing render node, if any.
Expand Down Expand Up @@ -280,7 +272,6 @@ export default class RenderTree {
/**
* Get the bounding rect for a given render node id.
*
* @method getBoundingClientRect
* @param {*} id A render node id.
* @return {Option<DOMRect>} The bounding rect, if the render node is found and has valid `bounds`.
*/
Expand Down Expand Up @@ -315,7 +306,6 @@ export default class RenderTree {
/**
* Get the DOM range for a give render node id.
*
* @method getRange
* @param {string} id A render node id.
* @return {Option<Range>} The DOM range, if the render node is found and has valid `bounds`.
*/
Expand Down Expand Up @@ -343,7 +333,6 @@ export default class RenderTree {
/**
* Scroll the given render node id into view (if the render node is found and has valid `bounds`).
*
* @method scrollIntoView
* @param {string} id A render node id.
*/
scrollIntoView(id: string) {
Expand All @@ -368,7 +357,6 @@ export default class RenderTree {
* Inspect the bounds for the given render node id in the "Elements" panel (if the render node
* is found and has valid `bounds`).
*
* @method inspectElement
* @param {string} id A render node id.
*/
inspectElement(id: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ export default class SourceMapSupport extends BaseObject {
/**
* Returns a promise that resolves to an array
* of mapped sourcew.
*
* @param {String} stack The stack trace
* @return {RSVP.Promise}
*/
map(stack: string): Promise<any> {
let parsed = fromStackProperty(stack);
Expand Down
3 changes: 0 additions & 3 deletions packages/@ember/debug/ember-inspector-support/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ class EmberDebug extends BaseObject {
/**
* We use the application's id instead of the owner's id so that we use the same inspector
* instance for the same application even if it was reset (owner changes on reset).
*
* @property applicationId
* @type {String}
*/
get applicationId() {
if (!this.isTesting) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ export default class ProfileManager {

/**
* Push a new profile into the queue
* @param info
* @return {number}
*/
addToQueue(info: Info) {
const index = this.queue.push(info);
Expand Down
7 changes: 0 additions & 7 deletions packages/@ember/debug/ember-inspector-support/port.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ export default class Port extends Evented.extend(BaseObject) {
* Unique id per application (not application instance). It's very important
* that this id doesn't change when the app is reset otherwise the inspector
* will no longer recognize the app.
*
* @property uniqueId
* @type {String}
*/
get uniqueId() {
return guidFor(this.namespace?._application, 'ember');
Expand All @@ -35,9 +32,6 @@ export default class Port extends Evented.extend(BaseObject) {
init() {
/**
* Stores the timestamp when it was first accessed.
*
* @property now
* @type {Number}
*/
this.now = Date.now();

Expand Down Expand Up @@ -93,7 +87,6 @@ export default class Port extends Evented.extend(BaseObject) {
* - Catches all errors during production
* and displays them in a user friendly manner.
*
* @method wrap
* @param {Function} fn
* @return {Mixed} The return value of the passed function
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import RSVP from 'rsvp';
import type PromiseModel from './models/promise';

export default class PromiseDebug extends DebugPort {
declare private __session: any;
private declare __session: any;
declare promiseAssembler: PromiseAssembler;
declare updatedPromises: PromiseModel[];
declare releaseMethods: (() => void)[];
Expand Down
4 changes: 2 additions & 2 deletions packages/@ember/debug/ember-inspector-support/route-debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const { hasOwnProperty } = Object.prototype;

export default class RouteDebug extends DebugPort {
_cachedRouteTree = null;
declare private __currentURL: any;
declare private __currentRouter: any;
private declare __currentURL: any;
private declare __currentRouter: any;
init() {
super.init();
this.__currentURL = this.currentURL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ function entriesFor(obj: any) {
/**
* Return `method.bind(obj)` or `obj[method].bind(obj)`. When called multiple
* times, the same bound function will be returned.
*
* @param {Object} obj
* @param {String|Symbol|Function} method
* @return {Function}
*/
export default function bound(obj: any, method: string | Function) {
let func;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* Returns a medium sized model name. Makes sure it's maximum 50 characters long.
*
* @method modelName
* @param {Any} model
* @return {String} The model name.
*/
Expand All @@ -20,7 +19,6 @@ export function modelName(model: any) {
/**
* Takes an Ember Data model and strips out the extra noise from the name.
*
* @method shortModelName
* @param {DS.Model} model
* @return {String} The concise model name.
*/
Expand All @@ -33,7 +31,6 @@ export function shortModelName(model: any) {
/**
* Returns the controller name. Strips out extra noise such as `subclass of`.
*
* @method controllerName
* @param {Controller} controller
* @return {String} The controller name
*/
Expand All @@ -44,7 +41,6 @@ export function controllerName(controller: any) {
/**
* Cleans up the controller name before returning it.
*
* @method shortControllerName
* @param {Controller} controller
* @return {String} The short controller name
*/
Expand All @@ -60,10 +56,6 @@ export function shortControllerName(controller: any) {
/**
* Cleans up an instance name to create shorter/less noisy names.
* Example: `<app@component:textarea::ember545>` becomes `textarea`.
*
* @method cleanupInstanceName
* @param {String} name
* @return {String} The short/cleaner name
*/
function cleanupInstanceName(name: string) {
let match = name.match(/^.+:(.+)::/);
Expand All @@ -81,7 +73,6 @@ function cleanupInstanceName(name: string) {
/**
* Cleans up the view name before returning it.
*
* @method shortViewName
* @param {Component} view The component.
* @return {String} The short view name.
*/
Expand All @@ -92,7 +83,6 @@ export function shortViewName(view: any) {
/**
* Returns the view name. Removes the `subclass` noise.
*
* @method viewName
* @param {Component} view The component.
* @return {String} The view name.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ export default class ViewDebug extends DebugPort {
* Opens the "Elements" tab and selects the given DOM node. Doesn't work in all
* browsers/addons (only in the Chrome and FF devtools addons at the time of writing).
*
* @method inspectNode
* @param {Node} node The DOM node to inspect
*/
inspectNode(node: Node) {
Expand Down
Loading

0 comments on commit 7189c1b

Please sign in to comment.