Skip to content

Commit fe622cf

Browse files
committed
1 parent 952c465 commit fe622cf

File tree

522 files changed

+2100
-1981
lines changed

Some content is hidden

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

522 files changed

+2100
-1981
lines changed

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ module.exports = {
1818
'plugin:@typescript-eslint/eslint-recommended',
1919
'plugin:@typescript-eslint/recommended-requiring-type-checking',
2020
'plugin:@typescript-eslint/recommended',
21-
'prettier',
21+
// "Add this as the _last_ item in the extends array, so that eslint-config-prettier has the
22+
// opportunity to override other configs." https://github.com/prettier/eslint-plugin-prettier
23+
'plugin:prettier/recommended',
2224
],
2325
rules: {
2426
curly: 2, // Enforce braces on "if"/"for"/etc.

package-lock.json

Lines changed: 77 additions & 0 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
@@ -55,6 +55,7 @@
5555
"eslint-config-prettier": "^9.1.0",
5656
"eslint-plugin-aws-toolkits": "file:plugins/eslint-plugin-aws-toolkits",
5757
"eslint-plugin-header": "^3.1.1",
58+
"eslint-plugin-prettier": "^5.1.3",
5859
"eslint-plugin-security-node": "^1.1.4",
5960
"eslint-plugin-unicorn": "^54.0.0",
6061
"husky": "^9.0.7",

packages/core/resources/js/vsCodeExtensionInterface.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function updateContent(/** @type {string} */ text) {
7171

7272
async function checkThreatComposerAPI() {
7373
while (!window.threatcomposer || !window.threatcomposer.setCurrentWorkspaceData) {
74-
await new Promise(r => setTimeout(r, checkThreatComposerAPITimeout))
74+
await new Promise((r) => setTimeout(r, checkThreatComposerAPITimeout))
7575
}
7676
}
7777

@@ -110,7 +110,7 @@ async function render(/** @type {string} */ text) {
110110
defaultTemplate = window.threatcomposer.stringifyWorkspaceData(initialState)
111111
}
112112

113-
window.threatcomposer.addEventListener('save', e => {
113+
window.threatcomposer.addEventListener('save', (e) => {
114114
const stringyfiedData = window.threatcomposer.stringifyWorkspaceData(e.detail)
115115
const currentState = vscode.getState()
116116
currentState.fileContents = stringyfiedData

packages/core/scripts/build/generateConfigurationAttributes.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function addBaseClass(generated: string, topLevelClass: string): string {
4343

4444
async function generateConfigurationAttributes(): Promise<void> {
4545
for (const debugConfiguration of packageJson.contributes.debuggers) {
46-
const debuggerConfig = config.find(cfg => {
46+
const debuggerConfig = config.find((cfg) => {
4747
return cfg.debugger === debugConfiguration.type
4848
})
4949
if (debuggerConfig === undefined) {
@@ -52,9 +52,9 @@ async function generateConfigurationAttributes(): Promise<void> {
5252
// JSONSchema4 impl doesn't like properties with type undefined, but the compilation works correctly
5353
const schema = debugConfiguration.configurationAttributes[debuggerConfig.requestType] as any as JSONSchema4
5454
await compile(schema, 'DirectInvoke', { bannerComment: header })
55-
.then(ts => addBaseClass(ts, debuggerConfig.topLevelClass))
56-
.then(ts => ts.replace(docRegex, replacer))
57-
.then(ts => fs.writeFileSync(debuggerConfig.outputFile, ts))
55+
.then((ts) => addBaseClass(ts, debuggerConfig.topLevelClass))
56+
.then((ts) => ts.replace(docRegex, replacer))
57+
.then((ts) => fs.writeFileSync(debuggerConfig.outputFile, ts))
5858
}
5959
}
6060

packages/core/scripts/build/generateIcons.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async function generateCloud9Icons(targets: { name: string; path: string }[], de
9090
for (const [theme, color] of Object.entries(themes)) {
9191
const themeDest = path.join(destination, theme)
9292
await fs.mkdirp(themeDest)
93-
await Promise.all(targets.map(t => replaceColor(t.path, color, path.join(themeDest, `${t.name}.svg`))))
93+
await Promise.all(targets.map((t) => replaceColor(t.path, color, path.join(themeDest, `${t.name}.svg`))))
9494
}
9595
}
9696

@@ -113,7 +113,7 @@ async function generate(mappings: Record<string, number | undefined> = {}) {
113113
templateClassName: 'icon',
114114
descent: 200, // Icons were negatively offset on the y-axes, this fixes it
115115
templateFontPath: path.relative(stylesheetsDir, fontsDir).replace(/\\/g, '/'),
116-
glyphTransformFn: obj => {
116+
glyphTransformFn: (obj) => {
117117
const filePath = (obj as { path?: string }).path
118118

119119
if (!filePath) {
@@ -174,7 +174,7 @@ ${result.template}
174174
await fs.writeFile(stylesheetPath, template)
175175
await updatePackage(
176176
`./${relativeDest}`,
177-
icons.filter(isValidIcon).map(i => [i.name, i.data])
177+
icons.filter(isValidIcon).map((i) => [i.name, i.data])
178178
)
179179
await generateCloud9Icons(icons, cloud9Dest)
180180

packages/core/scripts/build/generateServiceClient.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface ServiceClientDefinition {
2121
async function generateServiceClients(serviceClientDefinitions: ServiceClientDefinition[]): Promise<void> {
2222
const tempJsSdkPath = path.join(repoRoot, 'node_modules', '.zzz-awssdk2')
2323
console.log(`Temp JS SDK Repo location: ${tempJsSdkPath}`)
24-
console.log('Service Clients to Generate: ', serviceClientDefinitions.map(x => x.serviceName).join(', '))
24+
console.log('Service Clients to Generate: ', serviceClientDefinitions.map((x) => x.serviceName).join(', '))
2525

2626
await cloneJsSdk(tempJsSdkPath)
2727
await insertServiceClientsIntoJsSdk(tempJsSdkPath, serviceClientDefinitions)
@@ -106,7 +106,7 @@ async function insertServiceClientsIntoJsSdk(
106106
jsSdkPath: string,
107107
serviceClientDefinitions: ServiceClientDefinition[]
108108
): Promise<void> {
109-
serviceClientDefinitions.forEach(serviceClientDefinition => {
109+
serviceClientDefinitions.forEach((serviceClientDefinition) => {
110110
const apiVersion = getApiVersion(serviceClientDefinition.serviceJsonPath)
111111

112112
// Copy the Service Json into the JS SDK for generation
@@ -121,7 +121,7 @@ async function insertServiceClientsIntoJsSdk(
121121
const apiMetadataPath = path.join(jsSdkPath, 'apis', 'metadata.json')
122122
await patchServicesIntoApiMetadata(
123123
apiMetadataPath,
124-
serviceClientDefinitions.map(x => x.serviceName)
124+
serviceClientDefinitions.map((x) => x.serviceName)
125125
)
126126
}
127127

@@ -151,7 +151,7 @@ async function patchServicesIntoApiMetadata(apiMetadataPath: string, serviceName
151151
const apiMetadataJson = fs.readFileSync(apiMetadataPath).toString()
152152
const apiMetadata = JSON.parse(apiMetadataJson) as ApiMetadata
153153

154-
serviceNames.forEach(serviceName => {
154+
serviceNames.forEach((serviceName) => {
155155
apiMetadata[serviceName.toLowerCase()] = { name: serviceName }
156156
})
157157

packages/core/scripts/lint/testLint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ void (async () => {
1212
const mocha = new Mocha()
1313

1414
const testFiles = await glob('dist/src/testLint/**/*.test.js')
15-
testFiles.forEach(file => {
15+
testFiles.forEach((file) => {
1616
mocha.addFile(file)
1717
})
1818

19-
mocha.run(failures => {
19+
mocha.run((failures) => {
2020
const exitCode = failures ? 1 : 0
2121
console.log(`Finished running Main test suite with result code: ${exitCode}`)
2222
process.exit(exitCode)

packages/core/scripts/test/launchTestUtilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ async function invokeVSCodeCli(vsCodeExecutablePath: string, args: string[]): Pr
173173
// Workaround: set --user-data-dir to avoid this error in CI:
174174
// "You are trying to start Visual Studio Code as a super user …"
175175
if (process.env.AWS_TOOLKIT_TEST_USER_DIR) {
176-
cmdArgs = cmdArgs.filter(a => !a.startsWith('--user-data-dir='))
176+
cmdArgs = cmdArgs.filter((a) => !a.startsWith('--user-data-dir='))
177177
cmdArgs.push(`--user-data-dir=${process.env.AWS_TOOLKIT_TEST_USER_DIR}`)
178178
}
179179

packages/core/src/amazonq/activation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function activate(context: ExtensionContext) {
6060
focusAmazonQPanel.register(),
6161
focusAmazonQPanelKeybinding.register(),
6262
tryChatCodeLensCommand.register(),
63-
vscode.workspace.onDidChangeConfiguration(async configurationChangeEvent => {
63+
vscode.workspace.onDidChangeConfiguration(async (configurationChangeEvent) => {
6464
if (configurationChangeEvent.affectsConfiguration('amazonQ.workspaceIndex')) {
6565
if (CodeWhispererSettings.instance.isLocalIndexEnabled()) {
6666
void setupLsp()

0 commit comments

Comments
 (0)