Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cli.md 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. # Command Line Interface (CLI)
  2. You can use stylelint on the command line. For example:
  3. ```shell
  4. npx stylelint "**/*.css"
  5. ```
  6. Use `npx stylelint --help` to print the CLI documentation.
  7. ## Options
  8. In addition to the [standard options](options.md), the CLI accepts:
  9. ### `--allow-empty-input, --aei`
  10. The process exits without throwing an error when glob pattern matches no files.
  11. ### `--cache-location`
  12. Path to a file or directory for the cache location. More info about this option in [standard options](options.md#cacheLocation).
  13. ### `--cache`
  14. Store the results of processed files so that stylelint only operates on the changed ones. By default, the cache is stored in `./.stylelintcache` in `process.cwd()`. More info about this option in [standard options](options.md#cache).
  15. ### `--color, --no-color`
  16. Force enabling/disabling of color.
  17. ### `--config-basedir`
  18. Absolute path to the directory that relative paths defining "extends" and "plugins" are _relative to_. Only necessary if these values are relative paths. More info about this option in [standard options](options.md#configBasedir).
  19. ### `--config`
  20. Path to a JSON, YAML, or JS file that contains your [configuration object](../configure.md). More info about this option in [standard options](options.md#configFile).
  21. ### `--custom-syntax`
  22. Specify a custom syntax to use on your code. Use this option if you want to force a specific syntax that's not already built into stylelint. More info about this option in [standard options](options.md#customSyntax).
  23. ### `--disable-default-ignores, --di`
  24. Disable the default ignores. stylelint will not automatically ignore the contents of `node_modules`. More info about this option in [standard options](options.md#disableDefaultIgnores).
  25. ### `--fix`
  26. Automatically fix, where possible, violations reported by rules. More info about this option in [standard options](options.md#fix).
  27. ### `--formatter, -f` | `--custom-formatter`
  28. Specify the formatter to format your results. More info about this option in [standard options](options.md#formatter).
  29. ### `--ignore-disables, --id`
  30. Ignore `styleline-disable` (e.g. `/* stylelint-disable block-no-empty */`) comments. More info about this option in [standard options](options.md#ignoreDisables).
  31. ### `--ignore-path, -i`
  32. A path to a file containing patterns describing files to ignore. The path can be absolute or relative to `process.cwd()`. By default, stylelint looks for `.stylelintignore` in `process.cwd()`. More info about this option in [standard options](options.md#ignorePath).
  33. ### `--ignore-pattern, --ip`
  34. Pattern of files to ignore (in addition to those in `.stylelintignore`).
  35. ### `--max-warnings, --mw`
  36. Set a limit to the number of warnings accepted. More info about this option in [standard options](options.md#maxWarnings).
  37. ### `--output-file, -o`
  38. Path of file to write a report. stylelint outputs the report to the specified `filename` in addition to the standard output.
  39. ### `--print-config`
  40. Print the configuration for the given path. stylelint outputs the configuration used for the file passed.
  41. ### `--quiet, -q`
  42. Only register violations for rules with an "error"-level severity (ignore "warning"-level).
  43. ### `--report-descriptionless-disables, --rdd`
  44. Produce a report of the `stylelint-disable` comments without a description. More info about this option in [standard options](options.md#reportDescriptionlessDisables).
  45. ### `--report-invalid-scope-disables, --risd`
  46. Produce a report of the `stylelint-disable` comments that used for rules that don't exist within the configuration object. More info about this option in [standard options](options.md#reportInvalidScopeDisables).
  47. ### `--report-needless-disables, --rd`
  48. Produce a report to clean up your codebase, keeping only the `stylelint-disable` comments that serve a purpose. More info about this option in [standard options](options.md#reportNeedlessDisables).
  49. ### `--stdin-filename`
  50. A filename to assign the input. More info about this option in [standard options](options.md#codeFilename).
  51. ### `--stdin`
  52. Accept stdin input even if it is empty.
  53. ### `--syntax, -s`
  54. Specify a syntax. More info about this option in [standard options](options.md#syntax).
  55. ### `--version, -v`
  56. Show the currently installed version of stylelint.
  57. ## Usage examples
  58. The CLI expects input as either a [file glob](https://github.com/sindresorhus/globby) or `process.stdin`. It outputs formatted results into `process.stdout`.
  59. _Be sure to include quotation marks around file globs._
  60. ### Example A - recursive
  61. Recursively linting all `.css` files in the `foo` directory:
  62. ```shell
  63. stylelint "foo/**/*.css"
  64. ```
  65. ### Example B - multiple file extensions
  66. Linting all `.css`, `.scss`, and `.sass` files:
  67. ```shell
  68. stylelint "**/*.{css,scss,sass}"
  69. ```
  70. ### Example C - stdin
  71. Linting `stdin`:
  72. ```shell
  73. echo "a { color: pink; }" | stylelint
  74. ```
  75. ### Example D - negation
  76. Linting all `.css` files except those within `docker` subfolders, using negation in the input glob:
  77. ```shell
  78. stylelint "**/*.css" "!**/docker/**"
  79. ```
  80. ### Example E - caching
  81. Caching processed `.scss` files `foo` directory:
  82. ```shell
  83. stylelint "foo/**/*.scss" --cache --cache-location "/Users/user/.stylelintcache/"
  84. ```
  85. ### Example F - writing a report
  86. Linting all `.css` files in the `foo` directory, then writing the output to `myTestReport.txt`:
  87. ```shell
  88. stylelint "foo/*.css" --output-file myTestReport.txt
  89. ```
  90. ### Example G - specifying a config
  91. Using `bar/mySpecialConfig.json` as config to lint all `.css` files in the `foo` directory and any of its subdirectories:
  92. ```shell
  93. stylelint "foo/**/*.css" --config bar/mySpecialConfig.json
  94. ```
  95. ### Example H - using a custom syntax
  96. Recursively linting all `.css` files in the `foo` directory using a custom syntax:
  97. ```shell
  98. stylelint "foo/**/*.css" --customSyntax path/to/my-custom-syntax.js
  99. ```
  100. ### Example I - print on success
  101. Ensure output on successful runs:
  102. ```shell
  103. stylelint -f verbose "foo/**/*.css"
  104. ```
  105. ## Exit codes
  106. The CLI can exit the process with the following exit codes:
  107. - `1` - something unknown went wrong
  108. - `2` - there was at least one rule violation or CLI flag error
  109. - `78` - there was some problem with the configuration file