Skip to content

Commit

Permalink
fix: handle auto fixable lint errors
Browse files Browse the repository at this point in the history
- No code change
  • Loading branch information
acezard committed Aug 14, 2024
1 parent 8310c02 commit 24d5571
Show file tree
Hide file tree
Showing 404 changed files with 1,335 additions and 1,452 deletions.
1 change: 1 addition & 0 deletions docs/styleguide.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path')

const webpackMerge = require('webpack-merge')

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion react/AccordionSummary/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import AccordionSummary from '@material-ui/core/AccordionSummary'
import React from 'react'

import AccordionExpandIcon from './AccordionExpandIcon'

Expand Down
6 changes: 3 additions & 3 deletions react/ActionsBar/ResponsiveAction.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { forwardRef } from 'react'

import useBreakpoints from '../providers/Breakpoints'
import { makeStyles } from '../styles'
import Button from '../Buttons'
import Typography from '../Typography'
import Icon from '../Icon'
import Typography from '../Typography'
import useBreakpoints from '../providers/Breakpoints'
import { makeStyles } from '../styles'

const useDesktopStyles = makeStyles({
root: {
Expand Down
29 changes: 14 additions & 15 deletions react/ActionsBar/index.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import React, { useRef, useState, useMemo } from 'react'
import PropTypes from 'prop-types'
import React, { useRef, useState, useMemo } from 'react'

import { makeStyles } from '../styles'
import useBreakpoints from '../providers/Breakpoints'
import ResponsiveAction from './ResponsiveAction'
import withActionsLocales from './locales/withActionsLocales'
import ActionsMenu from '../ActionsMenu'
import { makeActions, others } from '../ActionsMenu/Actions'
import { getOnlyNeededActions } from '../ActionsMenu/Actions/helpers'
import ActionsItems from '../ActionsMenu/ActionsItems'
import AppBar from '../AppBar'
import Toolbar from '../Toolbar'
import Box from '../Box'
import Icon from '../Icon'
import IconButton from '../IconButton'
import CrossIcon from '../Icons/Cross'
import CrossCircleIcon from '../Icons/CrossCircle'
import DotsIcon from '../Icons/Dots'
import ActionsMenu from '../ActionsMenu'
import ActionsItems from '../ActionsMenu/ActionsItems'
import { getOnlyNeededActions } from '../ActionsMenu/Actions/helpers'
import Toolbar from '../Toolbar'
import useBreakpoints from '../providers/Breakpoints'
import { useI18n } from '../providers/I18n'
import { makeActions, others } from '../ActionsMenu/Actions'

import ResponsiveAction from './ResponsiveAction'
import withActionsLocales from './locales/withActionsLocales'
import { makeStyles } from '../styles'

const useStyles = makeStyles({
appBar: ({ isMobile }) => ({
Expand Down Expand Up @@ -81,10 +80,10 @@ const ActionsBar = ({
const showDesktopCloseButton = !!onClose && !isMobile
const maxActionsDisplayed = isMobile ? 4 : maxDesktopActions

const cleanedActions = useMemo(() => getOnlyNeededActions(actions, docs), [
actions,
docs
])
const cleanedActions = useMemo(
() => getOnlyNeededActions(actions, docs),
[actions, docs]
)

const countActionsToDisplay =
cleanedActions.length > maxActionsDisplayed
Expand Down
3 changes: 1 addition & 2 deletions react/ActionsBar/locales/withActionsLocales.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import withOnlyLocales from '../../providers/I18n/withOnlyLocales'

import en from './en.json'
import fr from './fr.json'
import withOnlyLocales from '../../providers/I18n/withOnlyLocales'

export const locales = {
en,
Expand Down
6 changes: 3 additions & 3 deletions react/ActionsMenu/Actions/call.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { forwardRef } from 'react'

import TelephoneIcon from '../../Icons/Telephone'
import { getActionsI18n } from './locales/withActionsLocales'
import ActionsMenuItem from '../ActionsMenuItem'
import ListItemIcon from '../../ListItemIcon'
import Icon from '../../Icon'
import TelephoneIcon from '../../Icons/Telephone'
import ListItemIcon from '../../ListItemIcon'
import ListItemText from '../../ListItemText'
import ActionsMenuItem from '../ActionsMenuItem'

export const call = () => {
const { t } = getActionsI18n()
Expand Down
6 changes: 3 additions & 3 deletions react/ActionsMenu/Actions/emailTo.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { forwardRef } from 'react'

import EmailIcon from '../../Icons/Email'
import { getActionsI18n } from './locales/withActionsLocales'
import ActionsMenuItem from '../ActionsMenuItem'
import ListItemIcon from '../../ListItemIcon'
import Icon from '../../Icon'
import EmailIcon from '../../Icons/Email'
import ListItemIcon from '../../ListItemIcon'
import ListItemText from '../../ListItemText'
import ActionsMenuItem from '../ActionsMenuItem'

export const emailTo = () => {
const { t } = getActionsI18n()
Expand Down
1 change: 1 addition & 0 deletions react/ActionsMenu/Actions/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PDFDocument } from 'pdf-lib'

import { fetchBlobFileById } from 'cozy-client/dist/models/file'

// Should guarantee good resolution for different uses (printing, downloading, etc.)
Expand Down
5 changes: 2 additions & 3 deletions react/ActionsMenu/Actions/locales/withActionsLocales.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { getI18n } from '../../../providers/I18n/helpers'
import withOnlyLocales from '../../../providers/I18n/withOnlyLocales'

import en from './en.json'
import fr from './fr.json'
import { getI18n } from '../../../providers/I18n/helpers'
import withOnlyLocales from '../../../providers/I18n/withOnlyLocales'

export const locales = {
en,
Expand Down
6 changes: 3 additions & 3 deletions react/ActionsMenu/Actions/modify.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React, { forwardRef } from 'react'

import { generateWebLink } from 'cozy-client'

import ListItemIcon from '../../ListItemIcon'
import ListItemText from '../../ListItemText'
import { getActionsI18n } from './locales/withActionsLocales'
import Icon from '../../Icon'
import PenIcon from '../../Icons/Pen'
import ListItemIcon from '../../ListItemIcon'
import ListItemText from '../../ListItemText'
import ActionsMenuItem from '../ActionsMenuItem'
import { getActionsI18n } from './locales/withActionsLocales'

export const modify = () => {
const { t } = getActionsI18n()
Expand Down
3 changes: 1 addition & 2 deletions react/ActionsMenu/Actions/others.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import DotsIcon from '../../Icons/Dots'

import { getActionsI18n } from './locales/withActionsLocales'
import DotsIcon from '../../Icons/Dots'

export const others = () => {
const { t } = getActionsI18n()
Expand Down
8 changes: 4 additions & 4 deletions react/ActionsMenu/Actions/print.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, { forwardRef } from 'react'

import logger from 'cozy-logger'
import { fetchBlobFileById, isFile } from 'cozy-client/dist/models/file'
import logger from 'cozy-logger'

import { makeBase64FromFile, makePdfBlob } from './helpers'
import PrinterIcon from '../../Icons/Printer'
import { getActionsI18n } from './locales/withActionsLocales'
import ActionsMenuItem from '../ActionsMenuItem'
import ListItemIcon from '../../ListItemIcon'
import Icon from '../../Icon'
import PrinterIcon from '../../Icons/Printer'
import ListItemIcon from '../../ListItemIcon'
import ListItemText from '../../ListItemText'
import ActionsMenuItem from '../ActionsMenuItem'

export const print = () => {
const { t } = getActionsI18n()
Expand Down
6 changes: 3 additions & 3 deletions react/ActionsMenu/Actions/smsTo.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { forwardRef } from 'react'

import CommentIcon from '../../Icons/Comment'
import { getActionsI18n } from './locales/withActionsLocales'
import ActionsMenuItem from '../ActionsMenuItem'
import ListItemIcon from '../../ListItemIcon'
import Icon from '../../Icon'
import CommentIcon from '../../Icons/Comment'
import ListItemIcon from '../../ListItemIcon'
import ListItemText from '../../ListItemText'
import ActionsMenuItem from '../ActionsMenuItem'

export const smsTo = () => {
const { t } = getActionsI18n()
Expand Down
6 changes: 3 additions & 3 deletions react/ActionsMenu/Actions/viewInContacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React, { forwardRef } from 'react'

import { generateWebLink } from 'cozy-client'

import OpenappIcon from '../../Icons/Openapp'
import { getActionsI18n } from './locales/withActionsLocales'
import ActionsMenuItem from '../ActionsMenuItem'
import ListItemIcon from '../../ListItemIcon'
import Icon from '../../Icon'
import OpenappIcon from '../../Icons/Openapp'
import ListItemIcon from '../../ListItemIcon'
import ListItemText from '../../ListItemText'
import ActionsMenuItem from '../ActionsMenuItem'

export const viewInContacts = () => {
const { t } = getActionsI18n()
Expand Down
12 changes: 6 additions & 6 deletions react/ActionsMenu/ActionsItems.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { forwardRef, useMemo } from 'react'
import PropTypes from 'prop-types'
import React, { forwardRef, useMemo } from 'react'

import { useClient } from 'cozy-client'
import { useWebviewIntent } from 'cozy-intent'

import { useI18n } from '../providers/I18n'
import { getActionName, getOnlyNeededActions } from './Actions/helpers'
import { useI18n } from '../providers/I18n'

const ActionsItems = forwardRef(
(
Expand All @@ -23,10 +23,10 @@ const ActionsItems = forwardRef(
const webviewIntent = useWebviewIntent()
const { t } = useI18n()

const cleanedActions = useMemo(() => getOnlyNeededActions(actions, docs), [
actions,
docs
])
const cleanedActions = useMemo(
() => getOnlyNeededActions(actions, docs),
[actions, docs]
)

return cleanedActions.map((actionObject, idx) => {
const actionName = getActionName(actionObject)
Expand Down
8 changes: 4 additions & 4 deletions react/ActionsMenu/ActionsMenuItem.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { forwardRef } from 'react'
import PropTypes from 'prop-types'
import omit from 'lodash/omit'
import cx from 'classnames'
import omit from 'lodash/omit'
import PropTypes from 'prop-types'
import React, { forwardRef } from 'react'

import MenuItem from '../MenuItem'
import ListItem from '../ListItem'
import MenuItem from '../MenuItem'

const cleanPropsForDOM = props => {
const nonDOMProps = ['docs', 'action', 't', 'f', 'lang']
Expand Down
2 changes: 1 addition & 1 deletion react/ActionsMenu/ActionsMenuMobileHeader.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { forwardRef } from 'react'
import PropTypes from 'prop-types'
import React, { forwardRef } from 'react'

import ActionsMenuItem from './ActionsMenuItem'
import Divider from '../Divider'
Expand Down
8 changes: 4 additions & 4 deletions react/ActionsMenu/ActionsMenuWrapper.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react'
import PropTypes from 'prop-types'
import React from 'react'

import Menu from '../Menu'
import useBreakpoints from '../providers/Breakpoints'
import BottomSheet from '../BottomSheet'
import isTesting from '../helpers/isTesting'
import Menu from '../Menu'
import Paper from '../Paper'
import { useActionMenuEffects } from '../deprecated/ActionMenu/ActionMenuEffects'
import isTesting from '../helpers/isTesting'
import useBreakpoints from '../providers/Breakpoints'

const ActionsMenuWrapper = ({
children,
Expand Down
4 changes: 2 additions & 2 deletions react/ActionsMenu/index.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { forwardRef } from 'react'
import PropTypes from 'prop-types'
import React, { forwardRef } from 'react'

import ActionsMenuWrapper from './ActionsMenuWrapper'
import ActionsItems from './ActionsItems'
import ActionsMenuWrapper from './ActionsMenuWrapper'

const useTransformOrigin = ({ vertical, horizontal }) => {
const v =
Expand Down
10 changes: 5 additions & 5 deletions react/Alert/index.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, { forwardRef } from 'react'
import PropTypes from 'prop-types'
import MuiAlert from '@material-ui/lab/Alert'
import cx from 'classnames'
import merge from 'lodash/merge'
import MuiAlert from '@material-ui/lab/Alert'
import PropTypes from 'prop-types'
import React, { forwardRef } from 'react'

import { makeStyles } from '../styles'
import Icon from '../Icon'
import CheckCircleIcon from '../Icons/CheckCircle'
import InfoIcon from '../Icons/Info'
import WarningIcon from '../Icons/Warning'
import WarningCircleIcon from '../Icons/WarningCircle'
import InfoIcon from '../Icons/Info'
import { makeStyles } from '../styles'

const DEFAULT_ICON_SIZE = 16

Expand Down
9 changes: 4 additions & 5 deletions react/AppIcon/index.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import cx from 'classnames'
import PropTypes from 'prop-types'
import React, { Component } from 'react'

import { withClient } from 'cozy-client'
import styles from './styles.styl'

import styles from './styles.styl'
import Icon, { iconPropType } from '../Icon'
import CubeIcon from '../Icons/Cube'

import palette from '../palette'

import { AppDoctype } from '../proptypes'

const DONE = 'done'
Expand Down
2 changes: 1 addition & 1 deletion react/AppIcon/test/AppIcon.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'
/* eslint-env jest */

import React from 'react'
import { shallow } from 'enzyme'
import React from 'react'

import { AppIcon } from '..'

Expand Down
2 changes: 1 addition & 1 deletion react/AppLinker/expiringMemoize.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function(fn, duration, keyFn) {
export default function (fn, duration, keyFn) {
const memo = {}
return arg => {
const key = keyFn(arg)
Expand Down
4 changes: 2 additions & 2 deletions react/AppLinker/index.deprecated.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Those tests should be kept until `slug` prop is completely removed
*/

import React from 'react'
import { render } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import React from 'react'

import {
isMobileApp,
Expand All @@ -30,7 +30,7 @@ const setup = ({ app, onAppSwitch }) => {
<AppLinker
onAppSwitch={onAppSwitch}
slug={app.slug}
href={'https://fake.link'}
href="https://fake.link"
>
{({ onClick, href, name }) => (
<div>
Expand Down
6 changes: 3 additions & 3 deletions react/AppLinker/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import PropTypes from 'prop-types'
import React from 'react'

import { withClient } from 'cozy-client'
import {
Expand All @@ -14,13 +14,13 @@ import {
import { WebviewContext } from 'cozy-intent'
import logger from 'cozy-logger'

import expiringMemoize from './expiringMemoize'
import {
generateUniversalLink,
generateWebLink,
getUniversalLinkDomain
} from './native'
import { NATIVE_APP_INFOS } from './native.config'
import expiringMemoize from './expiringMemoize'

const expirationDelay = 10 * 1000
const memoizedCheckApp = expiringMemoize(
Expand Down Expand Up @@ -162,7 +162,7 @@ export class AppLinker extends React.Component {
AppLinker.onAppSwitch(onAppSwitch)
openDeeplinkOrRedirect(
appInfo.uri + (nativePath === '/' ? '' : nativePath),
function() {
function () {
window.location.href = href
}
)
Expand Down
Loading

0 comments on commit 24d5571

Please sign in to comment.