diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index b76124ae..00000000 --- a/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -dist/ -tmp/ -coverage/ diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index 446a9be0..00000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,330 +0,0 @@ ---- -root: true - -env: - node: true - es6: true - -parserOptions: - parser: 'babel-eslint' - sourceType: 'script' - allowImportExportEverywhere: true - -globals: - # Allow the Intl global but don't allow it to be overwritten - Intl: false - -plugins: - - promise - - unicorn - - n - -extends: - - 'eslint:recommended' - - 'plugin:promise/recommended' - - 'plugin:unicorn/recommended' - - 'plugin:n/recommended' - - 'prettier' - -rules: - -### POSSIBLE ERRORS - getter-return: error - no-await-in-loop: error - # This seems like a good idea, but questionable value? - no-prototype-builtins: off - no-template-curly-in-string: error - no-misleading-character-class: error - valid-jsdoc: - - error - - - prefer: - return: returns - arg: param - class: constructor - preferType: - object: Object - bool: boolean - -### BEST PRACTICES - accessor-pairs: error - array-callback-return: error - block-scoped-var: error - class-methods-use-this: warn - consistent-return: error - curly: - - error - - all - default-case: error - dot-location: - - error - - property - dot-notation: error - eqeqeq: error - guard-for-in: error - max-classes-per-file: - - error - - 1 - no-alert: error - no-async-promise-executor: error - no-caller: error - no-div-regex: warn - no-else-return: error - no-empty-function: warn - no-eval: error - no-extend-native: error - no-extra-bind: error - no-floating-decimal: error - no-global-assign: error - no-implicit-coercion: warn - no-implicit-globals: error - no-implied-eval: error - no-invalid-this: error - no-iterator: error - no-labels: error - no-lone-blocks: error - no-loop-func: error - no-multi-spaces: error - no-multi-str: error - no-new: error - no-new-func: error - no-new-wrappers: error - no-octal-escape: error - no-proto: error - no-return-assign: error - no-return-await: error - no-script-url: error - no-self-compare: error - no-sequences: error - no-throw-literal: error - no-unmodified-loop-condition: error - no-unused-expressions: error - no-useless-call: error - no-useless-concat: error - no-useless-return: error - no-void: error - no-with: error - prefer-promise-reject-errors: error - radix: error - require-await: warn - require-unicode-regexp: error - wrap-iife: error - yoda: - - error - - never - # no-restricted-properties - -### STRICT MODE - strict: - - error - - safe - -### VARIABLES - no-catch-shadow: error - no-delete-var: error - no-shadow: error - no-shadow-restricted-names: error - # Turn on someday, just use null everywhere if we can - no-undefined: off - no-unused-vars: error - no-use-before-define: error - -### NODE AND COMMONJS - callback-return: error - global-require: error - handle-callback-err: - - error - - '^.*(e|E)rr' - no-buffer-constructor: error - no-mixed-requires: error - no-new-require: error - no-path-concat: error - no-process-exit: error - no-sync: error - -### STYLISTIC ISSUES - array-bracket-newline: off # prettier - array-element-newline: off # prettier - block-spacing: error - brace-style: - - error - - 1tbs - - - allowSingleLine: true - camelcase: - - error - - - properties: never - comma-dangle: - - error - - only-multiline - comma-spacing: error - comma-style: - - error - - last - consistent-this: - - error - - self - eol-last: error - func-call-spacing: error - func-name-matching: error - func-style: - - error - - declaration - - - allowArrowFunctions: true - implicit-arrow-linebreak: off # prettier - # This rule can be customized for switch/case etc. - indent: off # prettier - key-spacing: error - keyword-spacing: - - error - - - before: true - after: true - linebreak-style: - - error - - unix - lines-between-class-members: error - max-depth: error - # We should turn this on to enforce readable line lengths - max-len: - - off - - 120 - max-params: - - error - - 6 - max-statements-per-line: - - error - - - max: 1 - multiline-ternary: off # prettier - new-cap: error - new-parens: error - newline-per-chained-call: - - error - - - ignoreChainWithDepth: 2 - no-array-constructor: error - no-bitwise: warn - no-continue: error - no-lonely-if: error - no-mixed-operators: error - no-multi-assign: error - no-multiple-empty-lines: error - no-negated-condition: error - no-nested-ternary: error - no-new-object: error - no-plusplus: - - error - - - allowForLoopAfterthoughts: true - no-trailing-spaces: error - no-unneeded-ternary: error - no-whitespace-before-property: error - one-var-declaration-per-line: error - operator-assignment: error - quote-props: - - error - - as-needed - quotes: - - error - - single - - avoid-escape - require-jsdoc: - - error - - - require: - FunctionDeclaration: true - MethodDefinition: true - ClassDeclaration: true - semi: - - error - - always - semi-spacing: error - semi-style: - - error - - last - space-before-blocks: error - space-infix-ops: error - space-unary-ops: - - error - - - words: true - nonwords: false - spaced-comment: - - error - - always - switch-colon-spacing: error - template-tag-spacing: - - error - - never - unicode-bom: error - -### ES6 - arrow-body-style: - - error - - as-needed - arrow-parens: off # prettier - arrow-spacing: error - generator-star-spacing: - - error - - after - no-confusing-arrow: off # prettier - no-duplicate-imports: - - error - - - includeExports: true - no-useless-computed-key: error - no-useless-constructor: error - no-useless-rename: error - no-var: error - object-shorthand: - - warn - - always - - - avoidQuotes: true - avoidExplicitReturnArrows: true - prefer-arrow-callback: - - error - - - allowNamedFunctions: true - # Turn on when we don't support older Node.js versions - prefer-destructuring: off - prefer-numeric-literals: error - prefer-rest-params: error - prefer-spread: error - prefer-object-spread: error - prefer-template: error - rest-spread-spacing: - - error - - never - symbol-description: error - template-curly-spacing: - - error - - never - yield-star-spacing: - - error - - after -### PROMISES - promise/no-nesting: off - # We do not need to use bluebird; all promises should be native - promise/no-native: off - promise/no-promise-in-callback: error - promise/no-callback-in-promise: error - promise/avoid-new: error - promise/no-return-in-finally: error - promise/prefer-await-to-callbacks: error - promise/prefer-await-to-then: error - -### UNICORN - unicorn/custom-error-definition: error - unicorn/no-fn-reference-in-iterator: error - unicorn/no-new-buffer: error - -### NODE - n/no-deprecated-api: error - n/exports-style: - - error - - module.exports - diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..f6770e17 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +test/fixtures/** +package.json +package-lock.json \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js index be65cfc4..2eefd03f 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,6 +1,22 @@ -module.exports = { +// prettier.config.js, .prettierrc.js, prettier.config.cjs, or .prettierrc.cjs + +/** + * @see https://prettier.io/docs/configuration + * @type {import("prettier").Config} + */ +const config = { + trailingComma: 'es5', + tabWidth: 4, semi: true, singleQuote: true, - bracketSpacing: true, - trailingComma: 'all', + overrides: [ + { + files: '*.json', + options: { + useTabs: false, + }, + }, + ], }; + +module.exports = config; diff --git a/docs/autocomplete.md b/docs/autocomplete.md index 53edbb38..ae8dc7d5 100644 --- a/docs/autocomplete.md +++ b/docs/autocomplete.md @@ -14,7 +14,7 @@ USAGE $ box autocomplete [SHELL] [-r] ARGUMENTS - SHELL (zsh|bash|powershell) Shell type + [SHELL] (zsh|bash|powershell) Shell type FLAGS -r, --refresh-cache Refresh cache (ignores displaying instructions) @@ -34,4 +34,4 @@ EXAMPLES $ box autocomplete --refresh-cache ``` -_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.2.18/src/commands/autocomplete/index.js)_ +_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.2.38/src/commands/autocomplete/index.js)_ diff --git a/docs/configure.md b/docs/configure.md index c79f8325..b6c1c0e4 100644 --- a/docs/configure.md +++ b/docs/configure.md @@ -71,7 +71,7 @@ USAGE $ box configure:environments:delete [NAME] [--no-color] [-h] [-v] [-q] ARGUMENTS - NAME Name of the environment + [NAME] Name of the environment FLAGS -h, --help Show CLI help @@ -116,7 +116,7 @@ USAGE $ box configure:environments:select [ID] [--no-color] [-h] [-v] [-q] ARGUMENTS - ID Name of the environment + [ID] Name of the environment FLAGS -h, --help Show CLI help @@ -140,7 +140,7 @@ USAGE $ box configure:environments:set-current [ID] [--no-color] [-h] [-v] [-q] ARGUMENTS - ID Name of the environment + [ID] Name of the environment FLAGS -h, --help Show CLI help @@ -167,7 +167,7 @@ USAGE --save-to-file-path ] [--fields ] [--bulk-file-path ] [-h] [-v] [-y] [-q] [--default] ARGUMENTS - USERID The user ID to switch to + [USERID] The user ID to switch to FLAGS -h, --help Show CLI help @@ -201,7 +201,7 @@ USAGE [--private-key-path ] [--user-id ] [--cache-tokens] ARGUMENTS - NAME The name of the environment + [NAME] The name of the environment FLAGS -h, --help Show CLI help diff --git a/docs/help.md b/docs/help.md index e0840cfa..73d44239 100644 --- a/docs/help.md +++ b/docs/help.md @@ -14,7 +14,7 @@ USAGE $ box help [COMMAND...] [-n] ARGUMENTS - COMMAND... Command to show help for. + [COMMAND...] Command to show help for. FLAGS -n, --nested-commands Include all nested commands in the output. @@ -23,4 +23,4 @@ DESCRIPTION Display help for box. ``` -_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.23/src/commands/help.js)_ +_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.34/src/commands/help.js)_ diff --git a/docs/search.md b/docs/search.md index b9267d31..ca0219ed 100644 --- a/docs/search.md +++ b/docs/search.md @@ -20,7 +20,7 @@ USAGE [--limit ] [--all] [--include-recent-shared-links] ARGUMENTS - QUERY The search term + [QUERY] The search term FLAGS -h, --help Show CLI help diff --git a/docs/users.md b/docs/users.md index b22cab20..956829a0 100644 --- a/docs/users.md +++ b/docs/users.md @@ -124,8 +124,8 @@ USAGE [--timezone ] [--tracking-codes ] ARGUMENTS - NAME The user's name - LOGIN The user's email address, not required when creating app users + NAME The user's name + [LOGIN] The user's email address, not required when creating app users FLAGS -S, --status=