Skip to content

Commit 358fb76

Browse files
committed
chore: lint
1 parent eba8aea commit 358fb76

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ Now that you have the perfect Codama IDL for your Solana program, you can benefi
6262
_Note that some features such as rendering CLIs are not yet available. However, because the Codama IDL is designed as a tree of nodes, these features are only a visitor away from being ready. Feel free to reach out if youd like to contribute to this Codama ecosystem._
6363

6464
- **Rendering client code**. Want people to start interacting with your Solana program? You can use special visitors that go through your Codama IDL and generate client code that you can then publish for your end-users. Currently, we have the following renderers available:
65-
6665
- `@codama/renderers-js`: Renders a JavaScript client compatible with [`@solana/kit`](https://github.com/anza-xyz/kit).
6766
- `@codama/renderers-js-umi`: Renders a JavaScript client compatible with Metaplexs [Umi](https://github.com/metaplex-foundation/umi) framework.
6867
- `@codama/renderers-rust`: Renders a Rust client that removes the need for publishing the program crate and offers a better developer experience.

packages/cli/src/commands/init.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ type InitOptions = {
2020
gill?: boolean;
2121
};
2222

23-
type ConfigFileType = "json" | "js" | "gill";
23+
type ConfigFileType = 'gill' | 'js' | 'json';
2424

2525
async function doInit(explicitOutput: string | undefined, options: InitOptions) {
2626
const output = getOutputPath(explicitOutput, options);
27-
let configFileType : ConfigFileType = output.endsWith(".json") ? "json" : "js";
28-
if (options.gill) configFileType = "gill"
29-
else if (options.js) configFileType = "js"
27+
let configFileType: ConfigFileType = output.endsWith('.json') ? 'json' : 'js';
28+
if (options.gill) configFileType = 'gill';
29+
else if (options.js) configFileType = 'js';
3030

3131
if (await canRead(output)) {
3232
throw new Error(`Configuration file already exists at "${output}".`);
@@ -39,7 +39,7 @@ async function doInit(explicitOutput: string | undefined, options: InitOptions)
3939
logSuccess(`Configuration file created at "${output}".`);
4040
}
4141

42-
function getOutputPath(explicitOutput: string | undefined, options: Pick<InitOptions, 'js' | 'gill'>): string {
42+
function getOutputPath(explicitOutput: string | undefined, options: Pick<InitOptions, 'gill' | 'js'>): string {
4343
if (explicitOutput) {
4444
return resolveRelativePath(explicitOutput);
4545
}
@@ -137,15 +137,16 @@ function getContentFromPromptResult(result: PromptResult, configFileType: Config
137137
}
138138
const content: Config = { idl: result.idlPath, before: [], scripts };
139139

140-
if (configFileType == "json") {
140+
if (configFileType == 'json') {
141141
return JSON.stringify(content, null, 4);
142-
}
143-
else if (configFileType == "gill"){
144-
return `import { createCodamaConfig } from "gill";\n\n` +
142+
} else if (configFileType == 'gill') {
143+
return (
144+
`import { createCodamaConfig } from "gill";\n\n` +
145145
`export default createCodamaConfig({ \n\t` +
146146
`idl: "${result.idlPath}", \n\t` +
147147
`clientJs: "${result.jsPath}", \n` +
148-
`});`
148+
`});`
149+
);
149150
}
150151

151152
return (

0 commit comments

Comments
 (0)