|
| 1 | +// @flow |
| 2 | + |
| 3 | +import js from '@eslint/js'; |
| 4 | +import babelParser from '@babel/eslint-parser'; |
| 5 | +import flowtype from 'eslint-plugin-flowtype'; |
| 6 | +import importPlugin from 'eslint-plugin-import'; |
| 7 | +import jest from 'eslint-plugin-jest'; |
| 8 | +import jsxA11y from 'eslint-plugin-jsx-a11y'; |
| 9 | +import react from 'eslint-plugin-react'; |
| 10 | +import globals from 'globals'; |
| 11 | + |
| 12 | +export default [ |
| 13 | + importPlugin.flatConfigs.recommended, |
| 14 | + js.configs.recommended, |
| 15 | + react.configs.flat.recommended, |
| 16 | + { |
| 17 | + files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'], |
| 18 | + languageOptions: { |
| 19 | + ecmaVersion: 'latest', |
| 20 | + globals: { |
| 21 | + ...globals.browser, |
| 22 | + ...jest.environments.globals.globals, |
| 23 | + __dirname: 'readonly', |
| 24 | + Atomics: 'readonly', |
| 25 | + JSX: 'readonly', |
| 26 | + SharedArrayBuffer: 'readonly', |
| 27 | + TimeoutID: 'readonly', |
| 28 | + process: 'readonly' |
| 29 | + }, |
| 30 | + parser: babelParser, |
| 31 | + parserOptions: { |
| 32 | + ecmaFeatures: { |
| 33 | + jsx: true |
| 34 | + }, |
| 35 | + requireConfigFile: true, |
| 36 | + babelOptions: { |
| 37 | + parserOpts: { |
| 38 | + plugins: ['jsx'] |
| 39 | + } |
| 40 | + } |
| 41 | + }, |
| 42 | + sourceType: 'module' |
| 43 | + }, |
| 44 | + plugins: { |
| 45 | + react, |
| 46 | + flowtype, |
| 47 | + // import: importPlugin, |
| 48 | + jest, |
| 49 | + 'jsx-a11y': jsxA11y |
| 50 | + }, |
| 51 | + rules: { |
| 52 | + 'class-methods-use-this': 'off', |
| 53 | + 'comma-dangle': ['error', 'never'], |
| 54 | + "import/no-named-as-default": "off", |
| 55 | + 'import/no-unresolved': ['error', { |
| 56 | + ignore: [ |
| 57 | + '@samvera/clover-iiif.*', |
| 58 | + '@tailwindcss/vite', |
| 59 | + 'react-map-gl/maplibre' |
| 60 | + ] |
| 61 | + }], |
| 62 | + 'import/prefer-default-export': 'off', |
| 63 | + 'jsx-a11y/media-has-caption': 'off', |
| 64 | + 'jsx-quotes': ['error', 'prefer-single'], |
| 65 | + 'lines-between-class-members': 'off', |
| 66 | + 'max-len': ['error', { |
| 67 | + code: 120, |
| 68 | + ignoreStrings: true |
| 69 | + }], |
| 70 | + 'no-underscore-dangle': 'off', |
| 71 | + 'no-use-before-define': 'off', |
| 72 | + 'quote-props': ['error', 'as-needed', { |
| 73 | + keywords: false, |
| 74 | + unnecessary: true, |
| 75 | + numbers: true |
| 76 | + }], |
| 77 | + 'react/display-name': 'off', |
| 78 | + 'react/default-props-match-prop-types': 'off', |
| 79 | + 'react/destructuring-assignment': 'off', |
| 80 | + 'react/jsx-filename-extension': [1, { |
| 81 | + extensions: ['.js', '.jsx'] |
| 82 | + }], |
| 83 | + 'react/jsx-no-bind': 'off', |
| 84 | + 'react/jsx-props-no-spreading': 'off', |
| 85 | + 'react/no-array-index-key': 'off', |
| 86 | + 'react/no-did-update-set-state': 'off', |
| 87 | + 'react/prefer-stateless-function': 'off', |
| 88 | + 'react/require-default-props': 'off', |
| 89 | + 'react/sort-comp': 'off', |
| 90 | + 'react/static-property-placement': 'off', |
| 91 | + 'semi-style': ['error', 'last'] |
| 92 | + }, |
| 93 | + settings: { |
| 94 | + react: { |
| 95 | + version: 'detect' |
| 96 | + } |
| 97 | + } |
| 98 | + }, { |
| 99 | + ignores: [ |
| 100 | + '**/dist/*' |
| 101 | + ] |
| 102 | + } |
| 103 | +]; |
0 commit comments