eslint.config.js 713 B

1234567891011121314151617181920212223242526
  1. import prettier from 'eslint-config-prettier';
  2. import js from '@eslint/js';
  3. import { includeIgnoreFile } from '@eslint/compat';
  4. import svelte from 'eslint-plugin-svelte';
  5. import globals from 'globals';
  6. import { fileURLToPath } from 'node:url';
  7. import svelteConfig from './svelte.config.js';
  8. const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
  9. export default [
  10. includeIgnoreFile(gitignorePath),
  11. js.configs.recommended,
  12. ...svelte.configs.recommended,
  13. prettier,
  14. ...svelte.configs.prettier,
  15. {
  16. languageOptions: {
  17. globals: { ...globals.browser, ...globals.node }
  18. }
  19. },
  20. {
  21. files: ['**/*.svelte', '**/*.svelte.js'],
  22. languageOptions: { parserOptions: { svelteConfig } }
  23. }
  24. ];