.oxlintrc.json 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. {
  2. "$schema": "./node_modules/oxlint/configuration_schema.json",
  3. "plugins": [],
  4. "categories": {
  5. "correctness": "off"
  6. },
  7. "env": {
  8. "builtin": true
  9. },
  10. "ignorePatterns": [
  11. "**/dist/",
  12. "**/temp/",
  13. "**/coverage/",
  14. "dts-build/packages"
  15. ],
  16. "overrides": [
  17. {
  18. "files": ["**/*.js", "**/*.ts", "**/*.tsx"],
  19. "rules": {
  20. "no-debugger": "error",
  21. "no-console": [
  22. "error",
  23. {
  24. "allow": ["warn", "error", "info"]
  25. }
  26. ],
  27. "no-restricted-globals": [
  28. "error",
  29. "window",
  30. "document",
  31. "module",
  32. "require"
  33. ],
  34. "oxc/no-const-enum": "error",
  35. "oxc/no-rest-spread-properties": "error",
  36. "oxc/no-async-await": "error",
  37. "oxc/no-optional-chaining": "error",
  38. "sort-imports": [
  39. "error",
  40. {
  41. "ignoreDeclarationSort": true
  42. }
  43. ],
  44. "@typescript-eslint/prefer-ts-expect-error": "error",
  45. "@typescript-eslint/consistent-type-imports": [
  46. "error",
  47. {
  48. "fixStyle": "inline-type-imports",
  49. "disallowTypeAnnotations": false
  50. }
  51. ],
  52. "@typescript-eslint/no-import-type-side-effects": "error"
  53. },
  54. "plugins": ["typescript"]
  55. },
  56. {
  57. "files": [
  58. "**/__tests__/**",
  59. "packages-private/dts-test/**",
  60. "packages-private/dts-build-test/**"
  61. ],
  62. "rules": {
  63. "no-console": "off",
  64. "no-restricted-globals": "off",
  65. "no-unused-expressions": "off",
  66. "no-unused-vars": "off",
  67. "no-unsafe-optional-chaining": "off",
  68. "no-constant-condition": "off",
  69. "vitest/no-conditional-tests": "off",
  70. "typescript/no-this-alias": "off",
  71. "vitest/warn-todo": "off",
  72. "typescript/no-non-null-asserted-optional-chain": "off"
  73. },
  74. "globals": {
  75. "suite": "writable",
  76. "test": "writable",
  77. "describe": "writable",
  78. "it": "writable",
  79. "expectTypeOf": "writable",
  80. "assertType": "writable",
  81. "expect": "writable",
  82. "assert": "writable",
  83. "chai": "writable",
  84. "vitest": "writable",
  85. "vi": "writable",
  86. "beforeAll": "writable",
  87. "afterAll": "writable",
  88. "beforeEach": "writable",
  89. "afterEach": "writable",
  90. "onTestFailed": "writable",
  91. "onTestFinished": "writable"
  92. },
  93. "plugins": ["vitest", "typescript"]
  94. },
  95. {
  96. "files": ["packages/shared/**"],
  97. "rules": {
  98. "no-restricted-globals": "off"
  99. }
  100. },
  101. {
  102. "files": ["packages/{vue,vue-compat,runtime-dom,runtime-vapor}/**"],
  103. "rules": {
  104. "no-restricted-globals": ["error", "module", "require"]
  105. }
  106. },
  107. {
  108. "files": ["packages/{compiler-sfc,compiler-ssr,server-renderer}/**"],
  109. "rules": {
  110. "no-restricted-globals": ["error", "window", "document"],
  111. "oxc/no-const-enum": "error"
  112. }
  113. },
  114. {
  115. "files": [
  116. "packages-private/template-explorer/**",
  117. "packages-private/sfc-playground/**"
  118. ],
  119. "rules": {
  120. "no-restricted-globals": ["error", "module", "require"],
  121. "oxc/no-const-enum": "error",
  122. "no-console": "off"
  123. }
  124. },
  125. {
  126. "files": ["*.js"],
  127. "rules": {
  128. "no-unused-vars": [
  129. "error",
  130. {
  131. "vars": "all",
  132. "args": "none"
  133. }
  134. ]
  135. }
  136. },
  137. {
  138. "files": [
  139. "scripts/**",
  140. "./*.{js,ts}",
  141. "packages/*/*.js",
  142. "packages/vue/*/*.js",
  143. "packages-private/benchmark/*",
  144. "packages-private/e2e-utils/*"
  145. ],
  146. "rules": {
  147. "no-restricted-globals": "off",
  148. "oxc/no-const-enum": "error",
  149. "no-console": "off"
  150. }
  151. }
  152. ]
  153. }