Skip to content

Commit 0e1e4d5

Browse files
justinmk3karanA-aws
authored andcommitted
ci: require space at start of // comment aws#6112
Problem: Inconsistent comment style. Solution: Add a lint rule.
1 parent 56ac7cc commit 0e1e4d5

File tree

86 files changed

+403
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+403
-178
lines changed

.eslintrc.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
mocha: true,
1313
es2024: true,
1414
},
15-
plugins: ['@typescript-eslint', 'unicorn', 'header', 'security-node', 'aws-toolkits'],
15+
plugins: ['@typescript-eslint', '@stylistic', 'unicorn', 'header', 'security-node', 'aws-toolkits'],
1616
extends: [
1717
'eslint:recommended',
1818
'plugin:@typescript-eslint/eslint-recommended',
@@ -113,6 +113,20 @@ module.exports = {
113113
'no-constant-condition': ['error', { checkLoops: false }],
114114
'no-empty': 'off',
115115

116+
// https://eslint.style/rules/default/spaced-comment
117+
// Require space after // comment.
118+
'@stylistic/spaced-comment': [
119+
'error',
120+
'always',
121+
{
122+
block: {
123+
markers: ['!'], // Allow the /*!…*/ license header.
124+
// exceptions: ['*'],
125+
// balanced: true
126+
},
127+
},
128+
],
129+
116130
// Rules from https://github.com/sindresorhus/eslint-plugin-unicorn
117131
// TODO: 'unicorn/no-useless-promise-resolve-reject': 'error',
118132
// TODO: 'unicorn/prefer-at': 'error',

package-lock.json

Lines changed: 212 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"devDependencies": {
4242
"@aws-toolkits/telemetry": "^1.0.287",
4343
"@playwright/browser-chromium": "^1.43.1",
44+
"@stylistic/eslint-plugin": "^2.11.0",
4445
"@types/he": "^1.2.3",
4546
"@types/vscode": "^1.68.0",
4647
"@types/vscode-webview": "^1.57.1",

packages/amazonq/src/app/amazonqScan/chat/controller/messenger/messengerUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
*/
6-
//TODO: Refactor the common functionality between Transform, FeatureDev, CWSPRChat, Scan and UTG to a new Folder.
6+
// TODO: Refactor the common functionality between Transform, FeatureDev, CWSPRChat, Scan and UTG to a new Folder.
77

88
export default class MessengerUtils {
99
static stringToEnumValue = <T extends { [key: string]: string }, K extends keyof T & string>(

packages/amazonq/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is
5353
errors.init(fs.getUsername(), env.isAutomation())
5454
await initializeComputeRegion()
5555

56-
globals.contextPrefix = 'amazonq.' //todo: disconnect from above line
56+
globals.contextPrefix = 'amazonq.' // todo: disconnect from above line
5757

5858
// Avoid activation if older toolkit is installed
5959
// Amazon Q is only compatible with AWS Toolkit >= 3.0.0

packages/core/resources/js/graphStateMachine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ zoomoutBtn.addEventListener('click', () => {
108108

109109
// Message passing from extension to webview.
110110
// Capture state machine definition
111-
window.addEventListener('message', event => {
111+
window.addEventListener('message', (event) => {
112112
// event.data is object passed in from postMessage from vscode
113113
const message = event.data
114114
switch (message.command) {

packages/core/src/amazonq/commons/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
export enum FollowUpTypes {
7-
//UnitTestGeneration
7+
// UnitTestGeneration
88
ViewDiff = 'ViewDiff',
99
AcceptCode = 'AcceptCode',
1010
RejectCode = 'RejectCode',
@@ -14,7 +14,7 @@ export enum FollowUpTypes {
1414
InstallDependenciesAndContinue = 'InstallDependenciesAndContinue',
1515
ContinueBuildAndExecute = 'ContinueBuildAndExecute',
1616
ViewCodeDiffAfterIteration = 'ViewCodeDiffAfterIteration',
17-
//FeatureDev
17+
// FeatureDev
1818
GenerateCode = 'GenerateCode',
1919
InsertCode = 'InsertCode',
2020
ProvideFeedbackAndRegenerateCode = 'ProvideFeedbackAndRegenerateCode',

packages/core/src/amazonq/lsp/lspController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ export class LspController {
360360
})
361361
}
362362
} catch (error) {
363-
//TODO: use telemetry.run()
363+
// TODO: use telemetry.run()
364364
getLogger().error(`LspController: Failed to build index of project`)
365365
telemetry.amazonq_indexWorkspace.emit({
366366
duration: performance.now() - start,

packages/core/src/amazonq/lsp/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const QueryVectorIndexRequestType: RequestType<QueryVectorIndexRequest, a
6666

6767
export type IndexConfig = 'all' | 'default'
6868

69-
//RepoMapData
69+
// RepoMapData
7070
export type QueryRepomapIndexRequestPayload = { filePaths: string[] }
7171
export type QueryRepomapIndexRequest = string
7272
export const QueryRepomapIndexRequestType: RequestType<QueryRepomapIndexRequest, any, any> = new RequestType(

packages/core/src/amazonq/webview/ui/apps/testChatConnector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface MessageData {
3333
tabID: string
3434
type: TestMessageType
3535
}
36-
//TODO: Refactor testChatConnector, scanChatConnector and other apps connector files post RIV
36+
// TODO: Refactor testChatConnector, scanChatConnector and other apps connector files post RIV
3737
export class Connector extends BaseConnector {
3838
override getTabType(): TabType {
3939
return 'testgen'

0 commit comments

Comments
 (0)