mirror of
https://github.com/coder/code-server.git
synced 2024-12-05 07:13:06 +08:00
eae5d8c807
These conflicts will be resolved in the following commits. We do it this way so that PR review is possible.
31 lines
1.1 KiB
JavaScript
31 lines
1.1 KiB
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.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
var _a;
|
|
module.exports = new (_a = class ApiInterfaceNaming {
|
|
constructor() {
|
|
this.meta = {
|
|
messages: {
|
|
naming: 'Interfaces must not be prefixed with uppercase `I`',
|
|
}
|
|
};
|
|
}
|
|
create(context) {
|
|
return {
|
|
['TSInterfaceDeclaration Identifier']: (node) => {
|
|
const name = node.name;
|
|
if (ApiInterfaceNaming._nameRegExp.test(name)) {
|
|
context.report({
|
|
node,
|
|
messageId: 'naming'
|
|
});
|
|
}
|
|
}
|
|
};
|
|
}
|
|
},
|
|
_a._nameRegExp = /I[A-Z]/,
|
|
_a);
|