版博士V2.0程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1 год назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. [![npm version](https://img.shields.io/npm/v/@eslint/js.svg)](https://www.npmjs.com/package/@eslint/js)
  2. # ESLint JavaScript Plugin
  3. [Website](https://eslint.org) | [Configure ESLint](https://eslint.org/docs/latest/use/configure) | [Rules](https://eslint.org/docs/rules/) | [Contributing](https://eslint.org/docs/latest/contribute) | [Twitter](https://twitter.com/geteslint) | [Chatroom](https://eslint.org/chat)
  4. The beginnings of separating out JavaScript-specific functionality from ESLint.
  5. Right now, this plugin contains two configurations:
  6. * `recommended` - enables the rules recommended by the ESLint team (the replacement for `"eslint:recommended"`)
  7. * `all` - enables all ESLint rules (the replacement for `"eslint:all"`)
  8. ## Installation
  9. ```shell
  10. npm install @eslint/js -D
  11. ```
  12. ## Usage
  13. Use in your `eslint.config.js` file anytime you want to extend one of the configs:
  14. ```js
  15. import js from "@eslint/js";
  16. export default [
  17. // apply recommended rules to JS files
  18. {
  19. files: ["**/*.js"],
  20. rules: js.configs.recommended.rules
  21. },
  22. // apply recommended rules to JS files with an override
  23. {
  24. files: ["**/*.js"],
  25. rules: {
  26. ...js.configs.recommended.rules,
  27. "no-unused-vars": "warn"
  28. }
  29. },
  30. // apply all rules to JS files
  31. {
  32. files: ["**/*.js"],
  33. rules: {
  34. ...js.configs.all.rules,
  35. "no-unused-vars": "warn"
  36. }
  37. }
  38. ]
  39. ```
  40. ## License
  41. MIT