Ohm-Management - Projektarbeit B-ME
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.

README.md 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. [![NPM version][npm-image]][npm-url]
  2. [![build status][travis-image]][travis-url]
  3. [![Build status][appveyor-image]][appveyor-url]
  4. [![Downloads][downloads-image]][downloads-url]
  5. [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=282608)](https://www.bountysource.com/trackers/282608-eslint?utm_source=282608&utm_medium=shield&utm_campaign=TRACKER_BADGE)
  6. [![Join the chat at https://gitter.im/eslint/eslint](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/eslint/eslint?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
  7. [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint?ref=badge_shield)
  8. # ESLint
  9. [Website](https://eslint.org) |
  10. [Configuring](https://eslint.org/docs/user-guide/configuring) |
  11. [Rules](https://eslint.org/docs/rules/) |
  12. [Contributing](https://eslint.org/docs/developer-guide/contributing) |
  13. [Reporting Bugs](https://eslint.org/docs/developer-guide/contributing/reporting-bugs) |
  14. [Code of Conduct](https://js.foundation/community/code-of-conduct) |
  15. [Twitter](https://twitter.com/geteslint) |
  16. [Mailing List](https://groups.google.com/group/eslint) |
  17. [Chat Room](https://gitter.im/eslint/eslint)
  18. ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions:
  19. * ESLint uses [Espree](https://github.com/eslint/espree) for JavaScript parsing.
  20. * ESLint uses an AST to evaluate patterns in code.
  21. * ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime.
  22. ## Installation and Usage
  23. Prerequisites: [Node.js](https://nodejs.org/en/) (>=6.14), npm version 3+.
  24. There are two ways to install ESLint: globally and locally.
  25. ### Local Installation and Usage
  26. If you want to include ESLint as part of your project's build system, we recommend installing it locally. You can do so using npm:
  27. ```
  28. $ npm install eslint --save-dev
  29. ```
  30. You should then setup a configuration file:
  31. ```
  32. $ ./node_modules/.bin/eslint --init
  33. ```
  34. After that, you can run ESLint on any file or directory like this:
  35. ```
  36. $ ./node_modules/.bin/eslint yourfile.js
  37. ```
  38. Any plugins or shareable configs that you use must also be installed locally to work with a locally-installed ESLint.
  39. ### Global Installation and Usage
  40. If you want to make ESLint available to tools that run across all of your projects, we recommend installing ESLint globally. You can do so using npm:
  41. ```
  42. $ npm install -g eslint
  43. ```
  44. You should then setup a configuration file:
  45. ```
  46. $ eslint --init
  47. ```
  48. After that, you can run ESLint on any file or directory like this:
  49. ```
  50. $ eslint yourfile.js
  51. ```
  52. Any plugins or shareable configs that you use must also be installed globally to work with a globally-installed ESLint.
  53. **Note:** `eslint --init` is intended for setting up and configuring ESLint on a per-project basis and will perform a local installation of ESLint and its plugins in the directory in which it is run. If you prefer using a global installation of ESLint, any plugins used in your configuration must also be installed globally.
  54. ## Configuration
  55. After running `eslint --init`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
  56. ```json
  57. {
  58. "rules": {
  59. "semi": ["error", "always"],
  60. "quotes": ["error", "double"]
  61. }
  62. }
  63. ```
  64. The names `"semi"` and `"quotes"` are the names of [rules](https://eslint.org/docs/rules) in ESLint. The first value is the error level of the rule and can be one of these values:
  65. * `"off"` or `0` - turn the rule off
  66. * `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
  67. * `"error"` or `2` - turn the rule on as an error (exit code will be 1)
  68. The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](https://eslint.org/docs/user-guide/configuring)).
  69. ## Code of Conduct
  70. ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct).
  71. ## Filing Issues
  72. Before filing an issue, please be sure to read the guidelines for what you're reporting:
  73. * [Bug Report](https://eslint.org/docs/developer-guide/contributing/reporting-bugs)
  74. * [Propose a New Rule](https://eslint.org/docs/developer-guide/contributing/new-rules)
  75. * [Proposing a Rule Change](https://eslint.org/docs/developer-guide/contributing/rule-changes)
  76. * [Request a Change](https://eslint.org/docs/developer-guide/contributing/changes)
  77. ## Frequently Asked Questions
  78. ### I'm using JSCS, should I migrate to ESLint?
  79. Maybe, depending on how much you need it. [JSCS has reached end of life](https://eslint.org/blog/2016/07/jscs-end-of-life), but if it is working for you then there is no reason to move yet. There are still [a few issues](https://github.com/eslint/eslint/milestones/JSCS%20Compatibility) pending. We’ll announce when all of the changes necessary to support JSCS users in ESLint are complete and will start encouraging JSCS users to switch to ESLint at that time.
  80. If you are having issues with JSCS, you can try to move to ESLint. Have a look at our [migration guide](https://eslint.org/docs/user-guide/migrating-from-jscs).
  81. ### Does Prettier replace ESLint?
  82. No, ESLint does both traditional linting (looking for problematic patterns) and style checking (enforcement of conventions). You can use ESLint for everything, or you can combine both using Prettier to format your code and ESLint to catch possible errors.
  83. ### Why can't ESLint find my plugins?
  84. ESLint can be [globally or locally installed](#installation-and-usage). If you install ESLint globally, your plugins must also be installed globally; if you install ESLint locally, your plugins must also be installed locally.
  85. If you are trying to run globally, make sure your plugins are installed globally (use `npm ls -g`).
  86. If you are trying to run locally:
  87. * Make sure your plugins (and ESLint) are both in your project's `package.json` as devDependencies (or dependencies, if your project uses ESLint at runtime).
  88. * Make sure you have run `npm install` and all your dependencies are installed.
  89. In all cases, make sure your plugins' peerDependencies have been installed as well. You can use `npm view eslint-plugin-myplugin peerDepencies` to see what peer dependencies `eslint-plugin-myplugin` has.
  90. ### Does ESLint support JSX?
  91. Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/user-guide/configuring)). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics.
  92. ### What ECMAScript versions does ESLint support?
  93. ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, and 2018. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/user-guide/configuring).
  94. ### What about experimental features?
  95. ESLint's parser only officially supports the latest final ECMAScript standard. We will make changes to core rules in order to avoid crashes on stage 3 ECMAScript syntax proposals (as long as they are implemented using the correct experimental ESTree syntax). We may make changes to core rules to better work with language extensions (such as JSX, Flow, and TypeScript) on a case-by-case basis.
  96. In other cases (including if rules need to warn on more or fewer cases due to new syntax, rather than just not crashing), we recommend you use other parsers and/or rule plugins. If you are using Babel, you can use the [babel-eslint](https://github.com/babel/babel-eslint) parser and [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) to use any option available in Babel.
  97. Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](https://eslint.org/docs/developer-guide/contributing). Until then, please use the appropriate parser and plugin(s) for your experimental feature.
  98. ### Where to ask for help?
  99. Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](https://gitter.im/eslint/eslint).
  100. ## Releases
  101. We have scheduled releases every two weeks on Friday or Saturday. You can follow a [release issue](https://github.com/eslint/eslint/issues?q=is%3Aopen+is%3Aissue+label%3Arelease) for updates about the scheduling of any particular release.
  102. ## Semantic Versioning Policy
  103. ESLint follows [semantic versioning](https://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy for ESLint:
  104. * Patch release (intended to not break your lint build)
  105. * A bug fix in a rule that results in ESLint reporting fewer errors.
  106. * A bug fix to the CLI or core (including formatters).
  107. * Improvements to documentation.
  108. * Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage.
  109. * Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone).
  110. * Minor release (might break your lint build)
  111. * A bug fix in a rule that results in ESLint reporting more errors.
  112. * A new rule is created.
  113. * A new option to an existing rule that does not result in ESLint reporting more errors by default.
  114. * An existing rule is deprecated.
  115. * A new CLI capability is created.
  116. * New capabilities to the public API are added (new classes, new methods, new arguments to existing methods, etc.).
  117. * A new formatter is created.
  118. * Major release (likely to break your lint build)
  119. * `eslint:recommended` is updated.
  120. * A new option to an existing rule that results in ESLint reporting more errors by default.
  121. * An existing formatter is removed.
  122. * Part of the public API is removed or changed in an incompatible way.
  123. According to our policy, any minor update may report more errors than the previous release (ex: from a bug fix). As such, we recommend using the tilde (`~`) in `package.json` e.g. `"eslint": "~3.1.0"` to guarantee the results of your builds.
  124. ## License
  125. [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Feslint%2Feslint?ref=badge_large)
  126. ## Team
  127. These folks keep the project moving and are resources for help.
  128. ### Technical Steering Committee (TSC)
  129. <table>
  130. <tbody>
  131. <tr>
  132. <td align="center" valign="top" width="11%">
  133. <a href="https://github.com/nzakas">
  134. <img src="https://github.com/nzakas.png?s=75" width="75px" height="75px"><br/>
  135. <sub>Nicholas C. Zakas</sub></a>
  136. </td>
  137. <td align="center" valign="top" width="11%">
  138. <a href="https://github.com/ilyavolodin">
  139. <img src="https://github.com/ilyavolodin.png?s=75" width="75px" height="75px"><br/>
  140. <sub>Ilya Volodin</sub></a>
  141. </td>
  142. <td align="center" valign="top" width="11%">
  143. <a href="https://github.com/btmills">
  144. <img src="https://github.com/btmills.png?s=75" width="75px" height="75px"><br/>
  145. <sub>Brandon Mills</sub></a>
  146. </td>
  147. <td align="center" valign="top" width="11%">
  148. <a href="https://github.com/gyandeeps">
  149. <img src="https://github.com/gyandeeps.png?s=75" width="75px" height="75px"><br/>
  150. <sub>Gyandeep Singh</sub></a>
  151. </td>
  152. <td align="center" valign="top" width="11%">
  153. <a href="https://github.com/mysticatea">
  154. <img src="https://github.com/mysticatea.png?s=75" width="75px" height="75px"><br/>
  155. <sub>Toru Nagashima</sub></a>
  156. </td>
  157. <td align="center" valign="top" width="11%">
  158. <a href="https://github.com/alberto">
  159. <img src="https://github.com/alberto.png?s=75" width="75px" height="75px"><br/>
  160. <sub>Alberto Rodríguez</sub></a>
  161. </td>
  162. <td align="center" valign="top" width="11%">
  163. <a href="https://github.com/kaicataldo">
  164. <img src="https://github.com/kaicataldo.png?s=75" width="75px" height="75px"><br/>
  165. <sub>Kai Cataldo</sub></a>
  166. </td>
  167. <td align="center" valign="top" width="11%">
  168. <a href="https://github.com/not-an-aardvark">
  169. <img src="https://github.com/not-an-aardvark.png?s=75" width="75px" height="75px"><br/>
  170. <sub>Teddy Katz</sub></a>
  171. </td>
  172. <td align="center" valign="top" width="11%">
  173. <a href="https://github.com/platinumazure">
  174. <img src="https://github.com/platinumazure.png?s=75" width="75px" height="75px"><br/>
  175. <sub>Kevin Partington</sub></a>
  176. </td>
  177. </tr>
  178. </tbody>
  179. </table>
  180. ### Development Team
  181. <table>
  182. <tbody>
  183. <tr>
  184. <td align="center" valign="top" width="11%">
  185. <a href="https://github.com/lo1tuma">
  186. <img src="https://github.com/lo1tuma.png?s=75" width="75px" height="75px"><br/>
  187. <sub>Mathias Schreck</sub></a>
  188. </td>
  189. <td align="center" valign="top" width="11%">
  190. <a href="https://github.com/xjamundx">
  191. <img src="https://github.com/xjamundx.png?s=75" width="75px" height="75px"><br/>
  192. <sub>Jamund Ferguson</sub></a>
  193. </td>
  194. <td align="center" valign="top" width="11%">
  195. <a href="https://github.com/ianvs">
  196. <img src="https://github.com/ianvs.png?s=75" width="75px" height="75px"><br/>
  197. <sub>Ian VanSchooten</sub></a>
  198. </td>
  199. <td align="center" valign="top" width="11%">
  200. <a href="https://github.com/byk">
  201. <img src="https://github.com/byk.png?s=75" width="75px" height="75px"><br/>
  202. <sub>Burak Yiğit Kaya</sub></a>
  203. </td>
  204. <td align="center" valign="top" width="11%">
  205. <a href="https://github.com/michaelficarra">
  206. <img src="https://github.com/michaelficarra.png?s=75" width="75px" height="75px"><br/>
  207. <sub>Michael Ficarra</sub></a>
  208. </td>
  209. <td align="center" valign="top" width="11%">
  210. <a href="https://github.com/pedrottimark">
  211. <img src="https://github.com/pedrottimark.png?s=75" width="75px" height="75px"><br/>
  212. <sub>Mark Pedrotti</sub></a>
  213. </td>
  214. <td align="center" valign="top" width="11%">
  215. <a href="https://github.com/markelog">
  216. <img src="https://github.com/markelog.png?s=75" width="75px" height="75px"><br/>
  217. <sub>Oleg Gaidarenko</sub></a>
  218. </td>
  219. <td align="center" valign="top" width="11%">
  220. <a href="https://github.com/mikesherov">
  221. <img src="https://github.com/mikesherov.png?s=75" width="75px" height="75px"><br/>
  222. <sub>Mike Sherov</sub></a>
  223. </td>
  224. </tr>
  225. <tr>
  226. <td align="center" valign="top" width="11%">
  227. <a href="https://github.com/hzoo">
  228. <img src="https://github.com/hzoo.png?s=75" width="75px" height="75px"><br/>
  229. <sub>Henry Zhu</sub></a>
  230. </td>
  231. <td align="center" valign="top" width="11%">
  232. <a href="https://github.com/mdevils">
  233. <img src="https://github.com/mdevils.png?s=75" width="75px" height="75px"><br/>
  234. <sub>Marat Dulin</sub></a>
  235. </td>
  236. <td align="center" valign="top" width="11%">
  237. <a href="https://github.com/zxqfox">
  238. <img src="https://github.com/zxqfox.png?s=75" width="75px" height="75px"><br/>
  239. <sub>Alexej Yaroshevich</sub></a>
  240. </td>
  241. <td align="center" valign="top" width="11%">
  242. <a href="https://github.com/vitorbal">
  243. <img src="https://github.com/vitorbal.png?s=75" width="75px" height="75px"><br/>
  244. <sub>Vitor Balocco</sub></a>
  245. </td>
  246. <td align="center" valign="top" width="11%">
  247. <a href="https://github.com/JamesHenry">
  248. <img src="https://github.com/JamesHenry.png?s=75" width="75px" height="75px"><br/>
  249. <sub>James Henry</sub></a>
  250. </td>
  251. <td align="center" valign="top" width="11%">
  252. <a href="https://github.com/soda0289">
  253. <img src="https://github.com/soda0289.png?s=75" width="75px" height="75px"><br/>
  254. <sub>Reyad Attiyat</sub></a>
  255. </td>
  256. <td align="center" valign="top" width="11%">
  257. <a href="https://github.com/Aladdin-ADD">
  258. <img src="https://github.com/Aladdin-ADD.png?s=75" width="75px" height="75px"><br/>
  259. <sub>薛定谔的猫</sub></a>
  260. </td>
  261. <td align="center" valign="top" width="11%">
  262. <a href="https://github.com/VictorHom">
  263. <img src="https://github.com/VictorHom.png?s=75" width="75px" height="75px"><br/>
  264. <sub>Victor Hom</sub></a>
  265. </td>
  266. </tr>
  267. </tbody>
  268. </table>
  269. ## Sponsors
  270. * Site search ([eslint.org](https://eslint.org)) is sponsored by [Algolia](https://www.algolia.com)
  271. [npm-image]: https://img.shields.io/npm/v/eslint.svg?style=flat-square
  272. [npm-url]: https://www.npmjs.com/package/eslint
  273. [travis-image]: https://img.shields.io/travis/eslint/eslint/master.svg?style=flat-square
  274. [travis-url]: https://travis-ci.org/eslint/eslint
  275. [appveyor-image]: https://ci.appveyor.com/api/projects/status/iwxmiobcvbw3b0av/branch/master?svg=true
  276. [appveyor-url]: https://ci.appveyor.com/project/nzakas/eslint/branch/master
  277. [coveralls-image]: https://img.shields.io/coveralls/eslint/eslint/master.svg?style=flat-square
  278. [coveralls-url]: https://coveralls.io/r/eslint/eslint?branch=master
  279. [downloads-image]: https://img.shields.io/npm/dm/eslint.svg?style=flat-square
  280. [downloads-url]: https://www.npmjs.com/package/eslint