Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Feb 23, 2024
    • Kamil Mielnik's avatar
      Backport - RFC 70 - Automate sorting imports (#39096) · c18c3f0d
      Kamil Mielnik authored
      * Include e2e directory in prettier scripts
      
      * Align ESLint & prettier paths in "lint-stage" & "scripts" in package.json
      
      * Handle ts files in e2e tests
      
      * Format "lint-prettier-pure" script the same way as "prettier"
      
      * Ignore database files in ESLint as they reference a file that is git-ignored but does exist locally
      
      * Remove duplicated eslint call
      
      * Manually fix ESLint-reported issues
      
      * Upgrade eslint-plugin-import
      
      * Configure import/order rule for consistent, predictable imports
      
      * Change "eslint-disable-next-line no-restricted-imports" into "eslint-disable-line"
      
      * Ensure imports are in a single block
      
      * Move or remove informative comments between import statements
      
      * Remove imports-grouping comments
      
      * Configure groups
      - the difference between the default setting is the presence of "internal" group
      
      * Manually fix imports order and disable "import/order" rule in files with possible circular dependencies
      
      * Move comment to the same line as import
      
      * Run "yarn eslint-fix" 5 times
      
      * Manually fix imports order in remaining files
      
      * Run "yarn prettier"
      
      * Fix import
      
      * Fix circular dependency
      
      * Fix circular dependency
      
      * ESLint
      Unverified
      c18c3f0d
  2. Feb 07, 2024
  3. Jan 26, 2024
    • Mahatthana (Kelvin) Nomsawadi's avatar
      ESLint for detecting the use of Metabase links (#37738) · 13e6ebe9
      Mahatthana (Kelvin) Nomsawadi authored
      * [WIP] ESLint for detecting the use of Metabase links
      
      * Add a rule to detect the use of Metabase links
      
      * Add tests to the new eslint lint rule that detect Metabase links
      
      * Fix all places where errors are caused by the new ESLint rule
      
      * Review: Disable rule for admin folder
      
      * Review: Remove rule disable reason from files under admin folder
      Unverified
      13e6ebe9
  4. Dec 18, 2023
  5. Dec 04, 2023
  6. Oct 25, 2023
  7. Oct 24, 2023
  8. Aug 24, 2023
  9. Aug 22, 2023
  10. Aug 02, 2023
  11. Jul 11, 2023
  12. Jun 26, 2023
  13. May 31, 2023
  14. May 13, 2023
  15. Apr 20, 2023
  16. Feb 28, 2023
  17. Feb 06, 2023
  18. Jan 10, 2023
    • Anton Kulyk's avatar
      Add jest-dom and testing-library eslint plugins (#27577) · 6d3f5925
      Anton Kulyk authored
      * Install and enable plugins
      
      * Run eslint auto fix
      
      * Fix linter issues (part 1)
      
      * Fix Visualization test
      
      * Fix Pie Visualization test
      
      * Add `getIcon` and `queryIcon` helpers
      
      * Fix `VisibilityToggler` tests
      
      * Fix `QuestionActivityTimeline` tests
      
      * Fix formatting tests
      
      * Fix `EntityMenuItem` tests
      
      * Fix `ClampedText` tests
      
      * Fix `ObjectRelationships` tests
      
      * Fix `EmailAttachmentPicker` tests
      
      * Fix `SavedQuestionHeaderButton` tests
      
      * Fix `DatabaseEngineWarning` tests
      
      * Fix `Tooltip` tests
      
      * Fix `TippyPopoverWithTrigger` tests
      
      * Fix `TippyPopover` tests
      
      * Fix `TableLabel` tests
      
      * Fix `TableInfo` tests
      
      * Fix `ModerationStatusIcon` tests
      
      * Fix `Sidebar` tests
      
      * Fix `PermissionSelect` tests
      
      * Fix `PinnedItemCard` tests
      
      * Fix widget tests
      
      * Fix `DimensionSemanticTypeLabel` tests
      
      * Fix `ListSearchField` tests
      
      * Fix `ControlledPopoverWithTrigger` tests
      
      * Fix `FieldFingerprintInfo` tests
      
      * Fix `ErrorActionButton` tests
      
      * Fix `QueryValidationError` tests
      
      * Fix `LineAreaBarRenderer` tests
      
      * Fix `DataSelector` tests
      
      * Fix `PivotTable` tests
      
      * Fix `ItemPicker` tests
      
      * Fix `TokenField` tests
      
      * Fix `TagEditorParam` tests
      
      * Fix tests
      
      * Fix tests
      
      * Run prettier
      
      * Fix tests
      Unverified
      6d3f5925
  19. Jan 09, 2023
    • Anton Kulyk's avatar
      Add `eslint-plugin-jest` (#27574) · fb88dbef
      Anton Kulyk authored
      * Install `eslint-plugin-jest`
      
      * Enable `eslint-plugin-jest`
      
      * Run eslint auto fix
      
      * Fix linter issues
      
      * Fix get-column-key
      
      * Fix extra space
      
      * Fix ChartSettingFieldPicker
      
      * Fix eslint issues
      
      * Remove redundant describe
      Unverified
      fb88dbef
  20. Oct 03, 2022
  21. Sep 12, 2022
  22. May 19, 2022
  23. Dec 13, 2021
  24. Dec 07, 2021
  25. Nov 02, 2021
    • Dalton's avatar
      Refactor the Parameters component and rename it to SyncedParametersList (#18683) · f121d4d8
      Dalton authored
      * move querystring-syncing logic to new hook
      
      * rename <Parameters> to <SyncedParametersList>
      
      * Remove syncQueryString prop
      
      * remove unused 'query' prop
      
      * remove 'isQB' prop
      
      * remove ParametersWidget in favor of ParametersList handling empty parameters list
      
      * Rely on value-populated parameters objects over parameterValues map
      
      * remove unused pass-through prop 'vertical'
      
      * make props passed from Dashboard to SyncedParametersList explicit
      
      * Update name of component
      
      * create a more generic hook for syncing the url query string
      Unverified
      f121d4d8
    • Anton Kulyk's avatar
      Fix linter warning about not used variable in the Icon component (#18805) · b663c235
      Anton Kulyk authored
      * Fix typo
      
      * Don't warn about unused variables prefixed with _
      
      * Fix unused var warning for Icon component
      
      * Add `varsIgnorePattern` for JS files too
      Unverified
      b663c235
  26. Oct 07, 2021
    • Alexander Lesnenko's avatar
      add basic typescript configuration (#18284) · 8114af48
      Alexander Lesnenko authored
      
      * add basic typescript configuration
      
      * convert a tiny hook use-debounced-value to typescript
      
      * allow any for now?
      
      * update terser and static viz configs
      
      * adjust config
      
      * change extension of QuestionActivityTimeline from jsx to js to match jest config
      
      * adjust config
      
      * skip failing tests
      
      * Fix missing question method in unit tests (#18314)
      
      * review fix
      
      * fix
      
      Co-authored-by: default avatarAnton Kulyk <kuliks.anton@gmail.com>
      Unverified
      8114af48
  27. Aug 30, 2021
  28. Jul 30, 2021
    • Dalton's avatar
      Upgrade babel to 7.x.x and jest to 27.x.x (#17137) · 3a7c3987
      Dalton authored
      * Update babel dependencies to latest
      
      * Remove some old babel dependencies
      
      The dependencies in this commit include dependencies that have been
      renamed, such as babel-cli which is now @babel/cli. It also includes
      dependencies that have been replaced, such as babel-preset-stage-0 and
      its ilk, which have been replaced with @babel/preset-env.
      
      * Remove babel-register dependency
      
      This is referenced in our webpack.config.js file. I don't think we need
      Babel in our Node envionment, but I could be wrong, so leaving this as a
      separate commit.
      
      * Remove @babel/standalone and dependent code
      
      We're using @babel/standalone to support the writing of JSX in our
      internal-only ScratchApp editor. Unfortunately, this dependency is
      large--1.5mb not gzipped--and our current build does not intelligently
      split bundles, meaning our users our burdened by the size of this
      dependency whenever they must redownload the Metabase JS bundle.
      
      I'm removing it. We should still be able to write JS in the ScratchApp,
      but JSX no longer.
      
      * Add @babel/node to dev deps
      
      Needed by a cypress command
      
      * Add browserslist config
      
      Babel's preset-env dep needs this config to determine how to transform
      our JavaScript. By default I believe it ends up defaulting to
      "defaults."
      
      "defaults" is equivalent to the following rules:
      > 0.5%, last 2 versions, Firefox ESR, not dead
      
      A comma between rules represents a UNION operator.
      
      Per
      https://www.metabase.com/docs/latest/faq/general/supported-browsers.html
      
      
      we have deprecated IE 11 so I am including that explicitly in our
      browserslist.
      
      * Update babelrc plugins and presets
      
      - Replaced presets with preset-env and preset-react
      - Updated the names of some plugins, like transform-decorators-legacy,
        which is now @babel/plugin-proposal-decorators with an explicit
        "legacy: true" passed in the config.
      - Removed add-react-displayname because it is included in preset-react
      - Removed transform-builtin-extend because it is included in preset-env*
      - Removed syntax-trailing-function-commas because it is supported by
        all browsers we support
      
      * note: There is a "loose" config option for handling the extension of builtin
      classes. We may need it, but I am not sure.
      
      * Update babel cli args
      
      Replace -q with --quiet because -q no longer exists
      
      * Fix circular dep in auth.js by making it async
      
      Our app unfortunately contains MANY circular dependencies. Some, like
      this one, caused problems when the app instantiates because the
      "refreshCurrentUser" method is undefined when auth.js is initially run.
      
      While we should in the future avoid having circular deps in the first
      place, making them run async by requiring the dep and function run-time
      fixes this particular issue.
      
      * Fix circular dependency in metabase/redux/requests.js
      
      The handleActions and createAction methods imported from
      "metabase/lib/redux" are actually just methods from the "redux-actions"
      dependency... so importing those methods directly from that dep fixes
      this circular dependency problem.
      
      * Remove references to global.services and exports in metabase/services
      
      This line breaks the build. Git blame says the line is 5 years old, and
      I wouldn't expect such code to be used with how our app now requires
      deps.
      
      * Fix MBQLArrayClause problem caused by Array extension
      
      * Explicitly pass args from flatMap to function via anonymous cb
      
      I think the old Array.prototype.flatMap prototype must've had different
      args. They are now "currentValue, index, array" so when we passed it
      "enumeratePaths" as a callback, the second arg of enumeratePaths gets
      set to a number. This breaks the logic of enumeratePaths because it is a
      recursive function that depends on that second arg getting initialized
      as an empty array by default.
      
      * Remove code that spreads non-iterable value in array
      
      New Babel is stricter about handling this sort of code that doesn't
      match the JS spec. You can't spread an undefined value inside of an
      iterator.
      
      * Update jest and babel-jest to latest
      
      Updating Babel breaks our unit tests. Updating nothing causes every test
      to fail due to a Babel version mismatch. Updating only babel-jest causes
      the following error:
      
      TypeError: Jest: a transform must export a `process` function
      
      There may be a way around updating Jest, but updating it does not appear
      to be too difficult.
      
      * Set the testEnvironment to jsdom
      
      This was the default testEnvironment in our old version of jest. At some
      point the default was changed to node.
      
      * Remove unfinished "pending" unit tests
      
      I'm unfamiliar with this pending function, but the function no longer
      exists, causing the tests to fail.
      
      * don't pass async callback to describe
      
      * Update name of runTimersToTime to advanceTimersByTime
      
      * Fix incorrectly nested unit test
      
      * mock SVGElement.prototype.getBBox method
      
      * Don't return values in describe callback
      
      * Move variable declaration to above usage
      
      * Fix prettier error
      
      * Upgrade `documentation` library to the latest version (13.x.x)
      
      This library was the only one left that was still using Babel 6.
      
      * Return an MBQLClause instance after using Array methods
      
      * remove 'not IE 11' from browserslist
      
      * Remove mock that breaks unit test
      
      Co-authored-by: default avatarNemanja <31325167+nemanjaglumac@users.noreply.github.com>
      Unverified
      3a7c3987
  29. May 05, 2021
  30. Apr 30, 2021
  31. Apr 26, 2021
    • Nemanja Glumac's avatar
      [SCHEDULED, Week 19] Fix `react/no-string-refs` errors (#15547) · 8888de33
      Nemanja Glumac authored
      
      * Fix `eslint-react/no-string-refs` errors (#15427)
      
      * Handle errors in `AdminLayout.jsx`
      
      * Rmove unused ref from `MetadataEditorApp.jsx`
      
      * Remove unused ref from `EditBar.jsx`
      
      * Handle errors in `Confirm.jsx`
      
      * Handle errors in `Header.jsx`
      
      * Handle errors in `NewsletterForm.jsx`
      
      * Handle errors in `ColorPicker.jsx`
      
      * Remove unused ref from `PasswordReveal.jsx`
      
      * Handle errors in `Triggerable.jsx`
      
      * Handle errors in `TokenField.jsx`
      
      * Handle errors in `DashboardHeader.jsx`
      
      * Handle errors in `RefreshWidget.jsx`
      
      * Handle errors in `DatabaseEditApp.jsx`
      
      * Handle errors in `FieldRemapping.jsx`
      
      * Handle errors in `ObjectActionsSelect.jsx`
      
      * Handle errors in `ObjectRetireModal.jsx`
      
      * Remove unused ref from `UserGroupSelect.jsx`
      
      * Handle errors in `PermissionsGrid.jsx`
      
      * Handle errors in `ParameterTargetWidget.jsx`
      
      * Handle errors in `ParameterValueWidget.jsx`
      
      * Handle errors in `PulseEdit.jsx`
      
      * Handle errors in `PulseEditName.jsx`
      
      * Handle errors in `DataSelector.jsx`
      
      * Remove unused ref from `FieldWidget.jsx`
      
      * Handle errors in `NativeQueryEditor.jsx`
      
      * Handle errors in `SearchBar.jsx`
      
      * Handle errors in `ExpressionEditorTextfield.jsx`
      
      * Remove unused ref from `FieldWidget.jsx`
      
      * Remove unused ref from `SpecificDatePicker.jsx`
      
      * Handle errors in `RevisionMessageModal.jsx`
      
      * Handle errors in `Setup.jsx`
      
      * Handle errors in `LeafletMap.jsx`
      
      * Handle errors in `TableSimple.jsx`
      
      * Handle errors in `PieChart.jsx`
      
      * Handle errors in `Progress.jsx`
      
      * Remove unused refs from `QueryBuilder.jsx`
      
      * Remove unused ref and methods from `MetadataHeader.jsx`
      
      * Remove unused ref from `DashboardActions.jsx`
      
      * Handle errors in `DatabaseListApp.jsx`
      
      Note: dynamic refs
      
      * Handle errors in `LegendHorizontal.jsx`
      
      Note: dynamic refs
      
      * Disable linting rule `react/no-string-refs` in `LegendVertical.jsx`
      
      Note: dynamic refs
      
      * Partially handle errors in `GuiQueryEditor.jsx`
      
      * Disable linting rule `react/no-string-refs` in `GuiQueryEditor.jsx`
      
      Note: dynamic refs
      
      * Revert "Remove unused ref from `DashboardActions.jsx`"
      
      This reverts commit 5facb9d60ecb561093af15efcfc99b29ff96980e.
      
      * Handle errors in `DashboardActions.jsx`
      
      * Remove redundant `ReactDOM.findDOMNode` from `Setup.jsx`
      
      * Revert "Handle errors in `DashboardActions.jsx`"
      
      This reverts commit b3d64b8f7a982e0371d225d0d624ecbeaf776b76.
      
      * Disable linting for `DashboardActions.jsx`
      
      * Fix prettier error
      
      * Delete non-existing prop `getTarget`
      
      * Fix typo
      
      * Fix typos in more places
      
      * Fix `footerRef` check
      
      * Turn on `react/no-string-refs` lint rule
      
      * Disable `react/prop-types` in files that are breaking the build
      
      * Fix broken refs
      
      Co-authored-by: default avataralxnddr <alxnddr@gmail.com>
      Unverified
      8888de33
  32. Apr 19, 2021
  33. Apr 09, 2021
  34. Apr 08, 2021
    • Nemanja Glumac's avatar
      Fix `jsx/no-target-blank` React errors (#15532) · 919530a8
      Nemanja Glumac authored
      * Fix `react/jsx-no-target-blank` error (#15110)
      
      * Fix `react/jsx-no-target-blank` error
      
      * Handle untranslated string
      
      * Add `dataMetabaseEvent` prop to `ExternalLink`
      
      * Update missed `ExternalLink` component in `frontend/src/metabase/query_builder/components/template_tags/TagEditorHelp.jsx` with `dataMetabaseEvent`
      
      * Turn on `react/jsx-no-target-blank` lint rule
      Unverified
      919530a8
    • Nemanja Glumac's avatar
      Upgrade `eslint-plugin-react` (#15529) · c29b44b9
      Nemanja Glumac authored
      * Upgrade `eslint-plugin-react` 
      
      * Disable `react/prop-types` warning in stray files
      
      * Register breaking rules and turn off warnings
      
      * Fix wrong `eslint-disable` comment
      
      * Fix `react/display-name` error in `NotebookCell.jsx`
      Unverified
      c29b44b9
  35. Apr 02, 2021
  36. Mar 24, 2021
  37. Mar 04, 2021
    • Ariya Hidayat's avatar
      Remove type-checking with Flow (#14236) · f4d90f68
      Ariya Hidayat authored
      * yarn remove flow-bin eslint-plugin-flowtype
      
      * CI: remove fe-linter-flow
      
      * Remove Flow from ESLint config
      
      * Remove Flow type annotations and directives
      
      * Simplify Flow types for React elements and components
      
      * Import missing Flow types
      
      * Remove lint-flow from package.json
      Unverified
      f4d90f68
  38. Mar 02, 2021
Loading