This repository has been archived on 2024-09-09 . You can view files and clone it, but cannot push or open issues or pull requests.
37f98d9b5e
25 lines
864 B
JavaScript
25 lines
864 B
JavaScript
"use strict";
|
|||
/*---------------------------------------------------------------------------------------------
|
|||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|||
*--------------------------------------------------------------------------------------------*/
|
|||
module.exports = new class ApiEventNaming {
|
|||
constructor() {
|
|||
this.meta = {
|
|||
messages: {
|
|||
usage: 'Use the Thenable-type instead of the Promise type',
|
|||
}
|
|||
};
|
|||
}
|
|||
create(context) {
|
|||
return {
|
|||
['TSTypeAnnotation TSTypeReference Identifier[name="Promise"]']: (node) => {
|
|||
context.report({
|
|||
node,
|
|||
messageId: 'usage',
|
|||
});
|
|||
}
|
|||
};
|
|||
}
|
|||
};
|