|
| 1 | +import js from '@eslint/js'; |
| 2 | +import typescript from '@typescript-eslint/eslint-plugin'; |
| 3 | +import typescriptParser from '@typescript-eslint/parser'; |
| 4 | +import react from 'eslint-plugin-react'; |
| 5 | +import reactHooks from 'eslint-plugin-react-hooks'; |
| 6 | +import jsxA11y from 'eslint-plugin-jsx-a11y'; |
| 7 | +import importPlugin from 'eslint-plugin-import'; |
| 8 | +import storybook from 'eslint-plugin-storybook'; |
| 9 | +import globals from 'globals'; |
| 10 | + |
| 11 | +export default [ |
| 12 | + js.configs.recommended, |
| 13 | + { |
| 14 | + files: ['src/**/*.{js,ts,tsx}', 'stories/**/*.{js,ts,tsx}'], |
| 15 | + languageOptions: { |
| 16 | + parser: typescriptParser, |
| 17 | + parserOptions: { |
| 18 | + project: './tsconfig.json', |
| 19 | + ecmaFeatures: { |
| 20 | + jsx: true, |
| 21 | + }, |
| 22 | + }, |
| 23 | + globals: { |
| 24 | + ...globals.browser, |
| 25 | + ...globals.jest, |
| 26 | + ...globals.node, |
| 27 | + }, |
| 28 | + }, |
| 29 | + plugins: { |
| 30 | + '@typescript-eslint': typescript, |
| 31 | + react, |
| 32 | + 'react-hooks': reactHooks, |
| 33 | + 'jsx-a11y': jsxA11y, |
| 34 | + import: importPlugin, |
| 35 | + storybook, |
| 36 | + }, |
| 37 | + settings: { |
| 38 | + 'import/resolver': { |
| 39 | + typescript: { |
| 40 | + project: './tsconfig.json', |
| 41 | + }, |
| 42 | + }, |
| 43 | + react: { |
| 44 | + version: 'detect', |
| 45 | + }, |
| 46 | + }, |
| 47 | + rules: { |
| 48 | + ...typescript.configs.recommended.rules, |
| 49 | + ...react.configs.recommended.rules, |
| 50 | + ...reactHooks.configs.recommended.rules, |
| 51 | + ...jsxA11y.configs.recommended.rules, |
| 52 | + 'react/prop-types': 0, |
| 53 | + 'react/react-in-jsx-scope': 0, |
| 54 | + 'jsx-a11y/anchor-has-content': 0, |
| 55 | + 'jsx-a11y/alt-text': 0, |
| 56 | + 'jsx-a11y/heading-has-content': 0, |
| 57 | + 'react-hooks/exhaustive-deps': 0, |
| 58 | + }, |
| 59 | + }, |
| 60 | + { |
| 61 | + files: ['*.stories.tsx'], |
| 62 | + rules: { |
| 63 | + '@typescript-eslint/no-unused-vars': 'off', |
| 64 | + }, |
| 65 | + }, |
| 66 | +]; |
0 commit comments