Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editorconfig, and loglevel are rejected as CLI args #479

Closed
Ryan-McLemon opened this issue Jan 11, 2021 · 4 comments
Closed

editorconfig, and loglevel are rejected as CLI args #479

Ryan-McLemon opened this issue Jan 11, 2021 · 4 comments

Comments

@Ryan-McLemon
Copy link

Versions:

  • prettier-eslint version: 5.0.0
  • node version: 10.23.1
  • npm (or yarn) version: 1.22.10

Have you followed the debugging tips?

No, because loglevel is rejected as an argument.

Relevant code or config

var foo =1;

What I did:

Ran prettier-eslint with --editorconfig options and this was rejected as a CLI argument.

/usr/local/bin/prettier-eslint --no-config --print-width 80 --tab-width 2 --single-quote false --trailing-comma es5 --bracket-spacing true --jsx-bracket-same-line false --parser json --semi true --require-pragma false --prose-wrap preserve --arrow-parens always --html-whitespace-sensitivity css --quote-props as-needed --vue-indent-script-and-style false --embedded-language-formatting auto --jsx-single-quote false --editorconfig true --use-tabs false --loglevel debug

Usage: prettier-eslint <globs>... [--option-1 option-1-value --option-2]

Prefix an option with "no-" to set it to false, such as --no-semi to
disable semicolons and --no-eslint-ignore to disable default ignores.

Options:
  -h, --help               Show help                                   [boolean]
  --version                Show version number                         [boolean]
  --write                  Edit the file in-place (beware!)
                                                      [boolean] [default: false]
  --stdin                  Read input via stdin       [boolean] [default: false]
  --stdin-filepath         Path to the file to pretend that stdin comes from.
  --eslint-ignore          Only format matching files even if they are not
                           ignored by .eslintignore. (can use --no-eslint-ignore
                           to disable this)            [boolean] [default: true]
  --prettier-ignore        Only format matching files even if they are not
                           ignored by .prettierignore. (can use
                           --no-prettier-ignore to disable this)
                                                       [boolean] [default: true]
  --list-different         Print filenames of files that are different from
                           Prettier + Eslint formatting.
                                                      [boolean] [default: false]
  --eslint-path            The path to the eslint module to use
  --eslint-config-path     Path to the eslint config to use for eslint --fix
  --prettier-path          The path to the prettier module to use
  --config                 Path to the prettier config
  --ignore                 pattern(s) you wish to ignore (can be used multiple
                           times and includes **/node_modules/** automatically)
  --log-level, -l          The log level to use
        [choices: "silent", "error", "warn", "info", "debug", "trace"] [default:
                                                                         "warn"]
  --prettier-last          Run prettier last          [boolean] [default: false]
  --use-tabs               Indent lines with tabs instead of spaces.   [boolean]
  --print-width            Specify the length of line that the printer will wrap
                           on.                                          [number]
  --tab-width              Specify the number of spaces per indentation-level.
                                                                        [number]
  --trailing-comma         Print trailing commas wherever possible.

                           Valid options:
                           - "none" - no trailing commas
                           - "es5" - trailing commas where valid in ES5
                           (objects, arrays, etc)
                           - "all" - trailing commas wherever possible (function
                           arguments)   [string] [choices: "none", "es5", "all"]
  --bracket-spacing        Print spaces between brackets in object literals.
                           Can use --no-bracket-spacing for "false" to disable
                           it.

                           Valid options:
                           - true - Example: { foo: bar }
                           - false - Example: {foo: bar}               [boolean]
  --jsx-bracket-same-line  Put the > of a multi-line JSX element at the end of
                           the last line instead of being alone on the next line
                                                                       [boolean]
  --parser                 Specify which parser to use.                 [string]
  --semi                   Print semicolons at the ends of statements.
                           Can use --no-semi.

                           Valid options:
                           - true - add a semicolon at the end of every
                           statement
                           - false - only add semicolons at the beginning of
                           lines that may introduce ASI failures       [boolean]
  --single-quote           Use single quotes instead of double quotes. [boolean]
  --arrow-parens           Include parentheses around a sole arrow function
                           parameter.

                           Valid options:
                           - "avoid" - Omit parens when possible. Example: x =>
                           x
                           - "always" - Always include parens. Example: (x) => x
                                                                        [string]
  --require-pragma         Prettier can restrict itself to only format files
                           that contain a special comment, called a pragma,
                           at the top of the file.
                           This is very useful when gradually transitioning
                           large, unformatted codebases to prettier.   [boolean]
  --insert-pragma          Prettier can insert a special @format marker at the
                           top of files specifying that the file has been
                           formatted with prettier. This works well when used in
                           tandem with the --require-pragma option.
                           If there is already a docblock at the top of the file
                           then this option will add a newline to it with the
                           @format marker.                             [boolean]
  --prose-wrap             By default, Prettier will wrap markdown text as-is
                           since some services use a linebreak-sensitive
                           renderer, e.g. GitHub comment and BitBucket.
                           In some cases you may want to rely on
                           editor/viewer soft wrapping instead, so this
                           option allows you to opt out with "never".

                           Valid options:

                           "always" - Wrap prose if it exceeds the print width.
                           "never" - Do not wrap prose.
                           "preserve" - Wrap prose as-is. available in v1.9.0+
                                                                       [boolean]

Unknown arguments: editorconfig, loglevel

What happened:

Unknown arguments: editorconfig, loglevel

Reproduction repository:

Don't have one, just using this on a single file.

Problem description:

prettier-eslint should either ignore or accept these arguments.

Suggested solution:

Accept the same CLI options as prettier?

Related ticket:
jonlabelle/SublimeJsPrettier#235

@chrisbobbe
Copy link
Contributor

I think this might belong in the prettier-eslint-cli repo? https://github.com/prettier/prettier-eslint-cli

I'd love to see prettier/prettier-eslint-cli#304 in that repo reopened, if a maintainer sees this. 🙂

@JounQin
Copy link
Member

JounQin commented Aug 15, 2022

@JounQin JounQin closed this as completed Aug 15, 2022
@sHtev
Copy link

sHtev commented Mar 5, 2024

I believe the relevant issue in the CLI repo is actually prettier/prettier-eslint-cli#134 and that refers back to a possible setting in this repo - I have used the Prettier ESLint VS Code extension, and would like it if it respected .editorconfig there (so not using the CLI).

@JounQin
Copy link
Member

JounQin commented Mar 6, 2024

@sHtev Feel free to raise a PR instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants