租房小程序前端代码
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.

57 lines
1.4 KiB

6 months ago
  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