eslint.config.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
  2. import storybook from "eslint-plugin-storybook";
  3. import js from '@eslint/js'
  4. import globals from 'globals'
  5. import react from 'eslint-plugin-react'
  6. import reactHooks from 'eslint-plugin-react-hooks'
  7. import reactRefresh from 'eslint-plugin-react-refresh'
  8. export default [{ ignores: ['dist'] }, {
  9. files: ['**/*.{js,jsx}'],
  10. languageOptions: {
  11. ecmaVersion: 2020,
  12. globals: globals.browser,
  13. parserOptions: {
  14. ecmaVersion: 'latest',
  15. ecmaFeatures: { jsx: true },
  16. sourceType: 'module',
  17. },
  18. },
  19. settings: { react: { version: '18.3' } },
  20. plugins: {
  21. react,
  22. 'react-hooks': reactHooks,
  23. 'react-refresh': reactRefresh,
  24. },
  25. rules: {
  26. ...js.configs.recommended.rules,
  27. ...react.configs.recommended.rules,
  28. ...react.configs['jsx-runtime'].rules,
  29. ...reactHooks.configs.recommended.rules,
  30. 'react/jsx-no-target-blank': 'off',
  31. 'react-refresh/only-export-components': [
  32. 'warn',
  33. { allowConstantExport: true },
  34. ],
  35. },
  36. }, ...storybook.configs["flat/recommended"]];