eslint.config.js 604 B

123456789101112131415161718192021222324252627
  1. import js from "@eslint/js";
  2. import tseslint from "typescript-eslint";
  3. export default [
  4. js.configs.recommended,
  5. ...tseslint.configs.recommended,
  6. {
  7. files: ["**/*.ts"],
  8. languageOptions: {
  9. parserOptions: {
  10. ecmaVersion: "latest",
  11. sourceType: "module"
  12. }
  13. },
  14. rules: {
  15. "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
  16. // 风格:单引号、无分号、Tab 缩进
  17. quotes: ["error", "single", { avoidEscape: true }],
  18. semi: ["error", "never"],
  19. indent: ["error", "tab", { SwitchCase: 1 }]
  20. }
  21. }
  22. ];