Files
blockly/core/utils/deprecation.ts
Maribeth Bottorff 88ff901a72 chore: use prettier instead of clang-format (#7014)
* chore: add and configure prettier

* chore: remove clang-format

* chore: remove clang-format config

* chore: lint additional ts files

* chore: fix lint errors in blocks

* chore: add prettier-ignore where needed

* chore: ignore js blocks when formatting

* chore: fix playground html syntax

* chore: fix yaml spacing from merge

* chore: convert text blocks to use arrow functions

* chore: format everything with prettier

* chore: fix lint unused imports in blocks
2023-05-10 16:01:39 -07:00

39 lines
1.0 KiB
TypeScript

/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import * as goog from '../../closure/goog/goog.js';
goog.declareModuleId('Blockly.utils.deprecation');
/**
* Warn developers that a function or property is deprecated.
*
* @param name The name of the function or property.
* @param deprecationDate The date of deprecation. Prefer 'version n.0.0'
* format, and fall back to 'month yyyy' or 'quarter yyyy' format.
* @param deletionDate The date of deletion. Prefer 'version n.0.0'
* format, and fall back to 'month yyyy' or 'quarter yyyy' format.
* @param opt_use The name of a function or property to use instead, if any.
* @internal
*/
export function warn(
name: string,
deprecationDate: string,
deletionDate: string,
opt_use?: string
) {
let msg =
name +
' was deprecated in ' +
deprecationDate +
' and will be deleted in ' +
deletionDate +
'.';
if (opt_use) {
msg += '\nUse ' + opt_use + ' instead.';
}
console.warn(msg);
}