eslint.format.config.mjs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import stylistic from '@stylistic/eslint-plugin'
  2. import parser from '@typescript-eslint/parser'
  3. // Oxlint's JavaScript-plugin compatibility layer reports these rules but does
  4. // not execute their fixers. Keep this config formatting-only: Oxlint remains
  5. // the authoritative repository linter after this pass applies safe fixes.
  6. export default [
  7. {
  8. ignores: [
  9. '**/lib/**',
  10. '**/node_modules/**',
  11. '**/.sessions/**',
  12. '.claude/**',
  13. '**/.doc-typecheck-*/**',
  14. '**/.node-next-types-*/**',
  15. // Do not mirror Oxlint's contract-fixture ignore: those files must reach this formatter.
  16. 'website/.generated/**',
  17. 'vendor/**',
  18. 'native/**',
  19. '**/*.js',
  20. '**/*.mjs',
  21. '**/*.config.ts',
  22. 'packages/client/tsdown.client.ts',
  23. ],
  24. },
  25. {
  26. files: ['**/*.{ts,tsx,mts,cts}'],
  27. languageOptions: {
  28. parser,
  29. parserOptions: {
  30. sourceType: 'module',
  31. },
  32. },
  33. plugins: {
  34. '@stylistic': stylistic,
  35. },
  36. rules: {
  37. '@stylistic/indent': ['error', 2],
  38. '@stylistic/semi': ['error', 'never'],
  39. '@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
  40. '@stylistic/comma-dangle': ['error', 'always-multiline'],
  41. '@stylistic/eol-last': ['error', 'always'],
  42. '@stylistic/no-trailing-spaces': 'error',
  43. '@stylistic/object-curly-spacing': ['error', 'always'],
  44. '@stylistic/arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
  45. '@stylistic/member-delimiter-style': ['error', {
  46. multiline: { delimiter: 'none' },
  47. singleline: { delimiter: 'semi', requireLast: false },
  48. }],
  49. },
  50. },
  51. {
  52. // TypeGraph coverage must retain source-authored syntax that the normal quote rule forbids.
  53. files: ['packages/typert/generator/tests/fixtures/type-model/packages/host/src/models.ts'],
  54. rules: {
  55. '@stylistic/quotes': 'off',
  56. },
  57. },
  58. ]