From dce7c8fd61907faca0d2c0f9b213289ef43d244e Mon Sep 17 00:00:00 2001 From: Aman Kumar Date: Fri, 16 Jun 2023 00:36:06 +0530 Subject: [PATCH] fix: lint issues --- .eslintignore | 1 + .eslintrc | 32 ++++- README.md | 67 +++++----- src/commands/content-type/audit.ts | 82 ++++++------ src/commands/content-type/compare-remote.ts | 99 ++++++--------- src/commands/content-type/compare.ts | 131 +++++++++----------- src/commands/content-type/details.ts | 96 +++++++------- src/commands/content-type/diagram.ts | 117 ++++++++--------- src/commands/content-type/list.ts | 80 ++++++------ src/core/command.ts | 34 ++--- src/core/content-type/list.ts | 28 ++--- src/core/contentstack/client.ts | 2 +- src/types/index.ts | 8 +- src/utils/index.ts | 91 +++++--------- 14 files changed, 413 insertions(+), 455 deletions(-) diff --git a/.eslintignore b/.eslintignore index e69de29..dc55552 100644 --- a/.eslintignore +++ b/.eslintignore @@ -0,0 +1 @@ +/lib \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index c8d4a62..b90069f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,11 +1,37 @@ -{ - "extends": [ +{ + "extends": [ "oclif", "oclif-typescript" ], "rules": { "unicorn/no-abusive-eslint-disable": "off", "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/ban-ts-ignore": "off" + "@typescript-eslint/ban-ts-ignore": "off", + "object-curly-spacing": "off", + "no-useless-constructor": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "args": "none" + } + ], + "@typescript-eslint/prefer-namespace-keyword": "error", + "@typescript-eslint/quotes": [ + "error", + "single", + { + "avoidEscape": true, + "allowTemplateLiterals": true + } + ], + "semi": "off", + "indent": "off", + "comma-dangle": "off", + "unicorn/consistent-function-scoping": "off", + "max-params": "off", + "no-return-await":"off", + "no-process-exit":"off", + "no-trailing-spaces":"off", + "unicorn/no-process-exit":"off" } } \ No newline at end of file diff --git a/README.md b/README.md index 66cad63..8bb5c9c 100644 --- a/README.md +++ b/README.md @@ -68,12 +68,14 @@ Display recent changes to a Content Type ``` USAGE - $ csdx content-type:audit -c [-k | -a ] + $ csdx content-type:audit -c [-s | -a | -a ] [-k | | ] FLAGS - -a, --token-alias= Management token alias - -c, --content-type= (required) Content Type UID - -k, --stack= Stack API Key + -a, --alias= Alias of the management token + -a, --token-alias= Management token alias + -c, --content-type= (required) Content Type UID + -k, --stack-api-key= Stack API Key + -s, --stack= Stack UID DESCRIPTION Display recent changes to a Content Type @@ -92,14 +94,16 @@ Compare two Content Type versions ``` USAGE - $ csdx content-type:compare -c [-k | -a ] [-l -r ] + $ csdx content-type:compare -c [-s | -a ] [-k | ] [-a ] [-l -r ] FLAGS - -a, --token-alias= Management token alias - -c, --content-type= (required) Content Type UID - -k, --stack= Stack API Key - -l, --left= Content Type version, i.e. prev version - -r, --right= Content Type version, i.e. later version + -a, --alias= Alias of the management token + -a, --token-alias= Management token alias + -c, --content-type= (required) Content Type UID + -k, --stack-api-key= Stack API Key + -l, --left= Content Type version, i.e. prev version + -r, --right= Content Type version, i.e. later version + -s, --stack= Stack UID DESCRIPTION Compare two Content Type versions @@ -142,13 +146,15 @@ Display Content Type details ``` USAGE - $ csdx content-type:details -c [-k | -a ] [-p] + $ csdx content-type:details -c [-s | -a ] [-k | ] [-a ] [-p] FLAGS - -a, --token-alias= Management token alias - -c, --content-type= (required) Content Type UID - -k, --stack= Stack API Key - -p, --[no-]path show path column + -a, --alias= Alias of the management token + -a, --token-alias= Management token alias + -c, --content-type= (required) Content Type UID + -k, --stack-api-key= Stack API Key + -p, --[no-]path show path column + -s, --stack= Stack UID DESCRIPTION Display Content Type details @@ -169,16 +175,19 @@ Create a visual diagram of a Stack's Content Types ``` USAGE - $ csdx content-type:diagram -o -d portrait|landscape -t svg|dot [-k | -a ] + $ csdx content-type:diagram -o -d portrait|landscape -t svg|dot [-s | -a | -a ] [-k + | | ] FLAGS - -a, --token-alias= Management token alias - -d, --direction=