|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + browser: true, |
| 4 | + es2020: true, |
| 5 | + serviceworker: true, |
| 6 | + }, |
| 7 | + globals: { |
| 8 | + HTMLButtonElement: 'readonly', |
| 9 | + JSX: true, |
| 10 | + }, |
| 11 | + root: true, |
| 12 | + extends: [ |
| 13 | + 'eslint:recommended', |
| 14 | + 'plugin:react/recommended', |
| 15 | + 'plugin:react-hooks/recommended', |
| 16 | + 'plugin:import/recommended', |
| 17 | + 'plugin:@typescript-eslint/recommended', |
| 18 | + 'plugin:storybook/recommended', |
| 19 | + 'eslint-config-prettier', |
| 20 | + ], |
| 21 | + parser: '@typescript-eslint/parser', |
| 22 | + parserOptions: { |
| 23 | + project: 'tsconfig.json', |
| 24 | + ecmaVersion: 'latest', |
| 25 | + sourceType: 'module', |
| 26 | + }, |
| 27 | + ignorePatterns: ['.eslintrc.cjs'], |
| 28 | + plugins: ['react', '@typescript-eslint', 'react-refresh', 'prettier', 'import', 'string-to-lingui'], |
| 29 | + settings: { |
| 30 | + 'import/parsers': { |
| 31 | + '@typescript-eslint/parser': ['.ts', '.tsx'], |
| 32 | + }, |
| 33 | + 'import/resolver': { |
| 34 | + typescript: { |
| 35 | + project: 'src', |
| 36 | + |
| 37 | + project: 'tsconfig.json', |
| 38 | + }, |
| 39 | + }, |
| 40 | + }, |
| 41 | + rules: { |
| 42 | + 'react-refresh/only-export-components': 'warn', |
| 43 | + '@typescript-eslint/no-explicit-any': 'warn', |
| 44 | + 'react/jsx-uses-react': 'off', |
| 45 | + 'react/react-in-jsx-scope': 'off', |
| 46 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 47 | + '@typescript-eslint/no-non-null-asserted-optional-chain': 'off', |
| 48 | + '@typescript-eslint/ban-ts-comment': 'off', |
| 49 | + 'string-to-lingui/t-call-in-function': 2, |
| 50 | + 'import/default': 'off', |
| 51 | + 'import/named': 'off', |
| 52 | + 'import/no-named-as-default': 'off', |
| 53 | + 'import/no-named-as-default-member': 'off', |
| 54 | + 'import/no-unresolved': [ |
| 55 | + 2, |
| 56 | + { |
| 57 | + ignore: ['fhir/r4b'], // Fixes error: Unable to resolve path to module 'fhir/r4b'. |
| 58 | + }, |
| 59 | + ], |
| 60 | + 'no-restricted-imports': [ |
| 61 | + 'error', |
| 62 | + { |
| 63 | + patterns: [ |
| 64 | + { |
| 65 | + group: ['**/contrib/aidbox-types'], |
| 66 | + message: 'Please use @beda.software/aidbox-types', |
| 67 | + }, |
| 68 | + { |
| 69 | + group: ['**/contrib/fhir-emr'], |
| 70 | + message: 'Please use @beda.software/emr', |
| 71 | + }, |
| 72 | + { |
| 73 | + group: ['**/contrib/emr-config'], |
| 74 | + message: 'Please use @beda.software/emr-config', |
| 75 | + }, |
| 76 | + ], |
| 77 | + }, |
| 78 | + ], |
| 79 | + 'import/order': [ |
| 80 | + 'error', |
| 81 | + { |
| 82 | + groups: ['builtin', 'external', 'internal', ['index', 'sibling', 'parent']], |
| 83 | + 'newlines-between': 'always', |
| 84 | + pathGroupsExcludedImportTypes: ['builtin'], |
| 85 | + pathGroups: [ |
| 86 | + { |
| 87 | + pattern: 'aidbox-react/**', |
| 88 | + group: 'external', |
| 89 | + position: 'after', |
| 90 | + }, |
| 91 | + { |
| 92 | + pattern: '@beda.software/**', |
| 93 | + group: 'external', |
| 94 | + position: 'after', |
| 95 | + }, |
| 96 | + { |
| 97 | + pattern: 'src/**', |
| 98 | + group: 'internal', |
| 99 | + position: 'after', |
| 100 | + }, |
| 101 | + ], |
| 102 | + alphabetize: { order: 'asc', caseInsensitive: true }, |
| 103 | + }, |
| 104 | + ], |
| 105 | + } |
| 106 | +}; |
0 commit comments