eslint.config.mjs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. import { defineConfig, globalIgnores } from 'eslint/config'
  2. import cypress from 'eslint-plugin-cypress/flat'
  3. import path from 'node:path'
  4. import baseConfig from '../eslint.config.mjs'
  5. const ROOT_DIR = path.resolve(import.meta.dirname, '..')
  6. export default defineConfig([
  7. globalIgnores(['**/hotfix/', '**/develop/']),
  8. {
  9. basePath: ROOT_DIR,
  10. extends: baseConfig,
  11. languageOptions: {
  12. ecmaVersion: 2020,
  13. },
  14. },
  15. {
  16. // The cypress block in baseConfig has patterns rooted at the
  17. // monorepo root (`server-ce/test/helpers/*.ts`). When ESLint loads
  18. // this file (server-ce/eslint.config.mjs) as the closest config --
  19. // which happens when running `yarn run lint` from
  20. // /overleaf/server-ce/test/ -- patterns from baseConfig are
  21. // resolved relative to /overleaf/server-ce/, so those cross-dir
  22. // patterns don't match. Re-declare with paths relative to this
  23. // config file.
  24. files: [
  25. 'test/helpers/*.ts',
  26. 'test/cypress/support/*.{js,jsx,mjs,cjs,ts,tsx}',
  27. '**/*.spec.ts',
  28. ],
  29. ...cypress.configs.recommended,
  30. },
  31. ])