Skip to content

Commit

Permalink
add eslint commands, and run format
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 committed Jun 24, 2024
1 parent b44ecc9 commit bfd2c42
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 8 deletions.
10 changes: 10 additions & 0 deletions clients/js/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.json
*.md
*.css
*.d.ts

node_modules/
dist/
main/
module/
coverage/
2 changes: 2 additions & 0 deletions clients/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"clean": "lerna run clean",
"build": "lerna run build --stream",
"symlink": "symlink-workspace --logLevel error",
"lint": "lerna run lint",
"format": "lerna run format",
"postinstall": "yarn symlink",
"publish": "yarn build; yarn lerna publish --no-private",
"publish:minor": "yarn build; yarn lerna publish minor --no-private"
Expand Down
6 changes: 6 additions & 0 deletions clients/js/packages/cli/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
dist/
main/
module/
coverage/
prompt.js
2 changes: 2 additions & 0 deletions clients/js/packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy; npm run chmod",
"chmod": "chmod +x dist/index.js",
"dev": "ts-node src/index",
"lint": "eslint .",
"format": "eslint . --fix",
"test": "jest",
"test:watch": "jest --watch"
},
Expand Down
2 changes: 1 addition & 1 deletion clients/js/packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { StarshipClient, StarshipInstaller } from '@starship-ci/client'; // Adju
import { Inquirerer, type Question } from 'inquirerer';
import minimist from 'minimist';

import { displayUsage, displayVersion, loadConfig, usageText, params } from './utils';
import { displayUsage, displayVersion, loadConfig, params,usageText } from './utils';

const argv = minimist(process.argv.slice(2), {
alias: {
Expand Down
4 changes: 1 addition & 3 deletions clients/js/packages/cli/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import {defaultStarshipContext, StarshipConfig, StarshipContext} from '@starship-ci/client'; // Adjust the import path as necessary
import { type Question } from 'inquirerer';
import chalk from 'chalk';
import {readFileSync} from 'fs';
import * as yaml from 'js-yaml';
import {dirname, resolve} from 'path';
import { resolve} from 'path';

import {readAndParsePackageJson} from './package';
import deepmerge from 'deepmerge';

// Function to display the version information
export function displayVersion() {
Expand Down
6 changes: 6 additions & 0 deletions clients/js/packages/client/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
dist/
main/
module/
coverage/
prompt.js
2 changes: 2 additions & 0 deletions clients/js/packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"clean": "del dist/**",
"prepare": "npm run build",
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
"lint": "eslint .",
"format": "eslint . --fix",
"test": "jest",
"test:watch": "jest --watch"
},
Expand Down
2 changes: 1 addition & 1 deletion clients/js/packages/client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as os from 'os';
import { dirname, resolve } from 'path';
import * as shell from 'shelljs';

import {Chain, Relayer, Script, StarshipConfig} from './config';
import {Chain, Relayer, StarshipConfig} from './config';
import { Ports } from './config';
import { dependencies as defaultDependencies, Dependency } from "./deps";
import { readAndParsePackageJson } from './package';
Expand Down
6 changes: 6 additions & 0 deletions clients/js/packages/starshipjs/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
dist/
main/
module/
coverage/
prompt.js
2 changes: 1 addition & 1 deletion clients/js/packages/starshipjs/__tests__/config.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChainRegistryFetcher } from "@chain-registry/client";
import path from "path";

import { Config, ConfigContext } from "../src/config";
import { ChainRegistryFetcher } from "@chain-registry/client";

// it's more recommended to use ConfigContext.init to set the config file and registry.
it("1. throws without init;\n 2. init the setup and gets config;\n 3. throws when double init;\n", async () => {
Expand Down
4 changes: 2 additions & 2 deletions clients/js/packages/starshipjs/__tests__/legacy.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChainRegistryFetcher } from "@chain-registry/client";
import path from "path";

import { Config, ConfigContext } from "../src/config";
import { ChainRegistryFetcher } from "@chain-registry/client";
import { ConfigContext } from "../src/config";

// people can still use legacy ConfigContext to set the config file and registry.
it("1. throws without init;\n 2. throws only init partially;\n 3. init the setup and gets config;\n 4. throws when double init;\n", async () => {
Expand Down
2 changes: 2 additions & 0 deletions clients/js/packages/starshipjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"clean": "del dist/**",
"prepare": "npm run build",
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
"lint": "eslint .",
"format": "eslint . --fix",
"test": "jest",
"test:watch": "jest --watch"
},
Expand Down

0 comments on commit bfd2c42

Please sign in to comment.