Skip to content

Commit aa10617

Browse files
committed
fix: Lint issue
1 parent 6dae942 commit aa10617

File tree

32 files changed

+71
-71
lines changed

32 files changed

+71
-71
lines changed

packages/browserslist-config-cozy/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/***
1+
/** *
22
* We need to target Android 5 and at least iOS 10 for our mobile apps.
33
* We have to target Android 4.4 since Android 5 doesn't exist because Webview and OS
44
* version are different since Android 5.

packages/cozy-authentication/src/MobileRouter.jsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,10 @@ export class MobileRouter extends Component {
287287
}
288288

289289
await credentials.saveFromClient(this.props.client)
290-
//We need to set the state after all the previous actions
291-
//since we can have async task in `onAuthenticated`. Setting
292-
//isLoggingIn to true before result in displaying `appRoutes`
293-
//too soon in this case
290+
// We need to set the state after all the previous actions
291+
// since we can have async task in `onAuthenticated`. Setting
292+
// isLoggingIn to true before result in displaying `appRoutes`
293+
// too soon in this case
294294
this.setState({ isLoggingIn: false })
295295
}
296296

@@ -315,7 +315,7 @@ export class MobileRouter extends Component {
315315

316316
MobileRouter.defaultProps = {
317317
onException: e => {
318-
console.error('Exception', e) //eslint-disable-line no-console
318+
console.error('Exception', e) // eslint-disable-line no-console
319319
},
320320

321321
logoutPath: '/',

packages/cozy-authentication/src/steps/SelectServer.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class SelectServer extends Component {
5353
}
5454

5555
componentDidMount() {
56-
//if the cordova plugin is here, then shrink the view on iOS
56+
// if the cordova plugin is here, then shrink the view on iOS
5757
if (window.Keyboard && window.Keyboard.shrinkView) {
5858
window.Keyboard.shrinkView(true)
5959
} else {

packages/cozy-device-helper/src/deeplink.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const openUriWithTimeoutHack = (uri, failCb) => {
4848
target.removeEventListener('blur', onBlur)
4949
}, 500)
5050

51-
//handle page running in an iframe (blur must be registered with top level window)
51+
// handle page running in an iframe (blur must be registered with top level window)
5252
let target = window
5353
while (target != target.parent) {
5454
target = target.parent
@@ -94,7 +94,7 @@ const checkBrowser = () => {
9494
*/
9595
export const openDeeplinkOrRedirect = (deeplink, failCb) => {
9696
if (navigator.msLaunchUri) {
97-
//for IE and Edge in Win 8 and Win 10
97+
// for IE and Edge in Win 8 and Win 10
9898
openUriWithMsLaunchUri(deeplink, failCb)
9999
} else {
100100
const browser = checkBrowser()

packages/cozy-device-helper/src/platform.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ export const isAndroidApp = () => isPlatform(ANDROID_PLATFORM)
1212
export const isWebApp = () => isPlatform(WEB_PLATFORM)
1313
export const isMobileApp = () => isCordova()
1414

15-
//return if is on an Android Device (native or browser)
15+
// return if is on an Android Device (native or browser)
1616
export const isAndroid = () =>
1717
window.navigator.userAgent &&
1818
window.navigator.userAgent.indexOf('Android') >= 0
19-
//return if is on an iOS Device (native or browser)
19+
// return if is on an iOS Device (native or browser)
2020
export const isIOS = () =>
2121
window.navigator.userAgent &&
2222
/iPad|iPhone|iPod/.test(window.navigator.userAgent)
2323

24-
//isMobile checks if the user is on a smartphone : native app or browser
24+
// isMobile checks if the user is on a smartphone : native app or browser
2525
export const isMobile = () => isAndroid() || isIOS()

packages/cozy-doctypes/src/File.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ class CozyFile extends Document {
132132
* @return {String} A filename with the right suffix
133133
*/
134134
static generateNewFileNameOnConflict(filenameWithoutExtension) {
135-
//Check if the string ends by _1
135+
// Check if the string ends by _1
136136
const regex = new RegExp('(_)([0-9]+)$')
137137
const matches = filenameWithoutExtension.match(regex)
138138
if (matches) {
139139
let versionNumber = parseInt(matches[2])
140-
//increment versionNumber
140+
// increment versionNumber
141141
versionNumber++
142142
const newFilenameWithoutExtension = filenameWithoutExtension.replace(
143143
new RegExp('(_)([0-9]+)$'),
@@ -190,7 +190,7 @@ class CozyFile extends Document {
190190
const existingFile = await filesCollection.statByPath(path)
191191
const { id: fileId } = existingFile.data
192192
if (conflictStrategy === 'erase') {
193-
//!TODO Bug Fix. Seems we have to pass a name attribute ?!
193+
// !TODO Bug Fix. Seems we have to pass a name attribute ?!
194194
const resp = await filesCollection.updateFile(file, {
195195
dirId,
196196
fileId,
@@ -206,7 +206,7 @@ class CozyFile extends Document {
206206
})
207207
const newFileName =
208208
CozyFile.generateNewFileNameOnConflict(filename) + extension
209-
//recall itself with the newFilename.
209+
// recall itself with the newFilename.
210210
return CozyFile.uploadFileWithConflictStrategy(
211211
newFileName,
212212
file,

packages/cozy-doctypes/src/File.spec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ describe('File model', () => {
336336

337337
it('should rename the file if there is a conflict', async () => {
338338
const dirId = 'toto'
339-
//first call we return an existing file => conflict
340-
//second call, we reject as not found
339+
// first call we return an existing file => conflict
340+
// second call, we reject as not found
341341
statByPathSpy
342342
.mockReturnValueOnce({
343343
data: {
@@ -364,8 +364,8 @@ describe('File model', () => {
364364

365365
it('should erase the file if there is a conflict', async () => {
366366
const dirId = 'toto'
367-
//first call we return an existing file => conflict
368-
//second call, we reject as not found
367+
// first call we return an existing file => conflict
368+
// second call, we reject as not found
369369
statByPathSpy.mockReturnValueOnce({
370370
data: {
371371
id: 'file_id'

packages/cozy-doctypes/src/administrativeProcedures/AdministrativeProcedure.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ class AdministrativeProcedure extends Document {
6161
type: 'file',
6262
...rules
6363
}
64-
//Create an index in order to query and sort
64+
// Create an index in order to query and sort
6565
await this.cozyClient
6666
.collection('io.cozy.files')
6767
.createIndex(['metadata.datetime', 'metadata.classification'])
68-
//Use the index
68+
// Use the index
6969
const files = await this.cozyClient
7070
.collection('io.cozy.files')
7171
.find(cozyRules, {
@@ -95,7 +95,7 @@ class AdministrativeProcedure extends Document {
9595
const { documentsData, personalData, procedureData } = data
9696
const files = Object.keys(documentsData).map(identifier => {
9797
return documentsData[identifier].files.map(file => {
98-
//TODO Remove this check. it has to be done before
98+
// TODO Remove this check. it has to be done before
9999
if (file)
100100
return {
101101
_id: file.id,

packages/cozy-harvest-lib/src/components/KonnectorConfiguration/KonnectorAccountTabs.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const KonnectorAccountTabs = ({
2828
onAccountDeleted,
2929
initialActiveTab,
3030

31-
//TODO rename to onAddAccount
31+
// TODO rename to onAddAccount
3232
addAccount,
3333
showNewAccountButton
3434
}) => {

packages/cozy-harvest-lib/src/components/OAuthWindow.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
terminateOAuth,
1212
OAUTH_REALTIME_CHANNEL
1313
} from '../helpers/oauth'
14-
//TODO use PopUp from cozy-ui
14+
// TODO use PopUp from cozy-ui
1515
import Popup from './Popup'
1616

1717
const OAUTH_POPUP_HEIGHT = 800

packages/cozy-harvest-lib/src/helpers/konnectors.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ export const buildFolderPath = (konnector, account, folders = {}) => {
273273
)
274274
// Trim `/` and avoid multiple `/` characters with regexp
275275
let sanitizedPath = trim(fullPath.replace(/(\/+)/g, '/'), '/')
276-
//If the konnector doesn't have any of our base dir, we set it to $administrative
276+
// If the konnector doesn't have any of our base dir, we set it to $administrative
277277
if (!hasBaseDir(sanitizedPath)) {
278278
sanitizedPath = '$administrative/' + sanitizedPath
279279
}

packages/cozy-interapp/src/listener.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*eslint no-console: ["error", { allow: ["warn", "error"] }] */
1+
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
22

33
const intentTypeRx = /intent-(.*):(.*)/
44

packages/cozy-procedures/src/Procedure.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Procedure extends React.Component {
1717
initializationSuccess,
1818
fetchBankAccountsStats
1919
} = this.props
20-
//We init our Document model here to be able to use CozyFile or AdministrativeProcedure models where we want
20+
// We init our Document model here to be able to use CozyFile or AdministrativeProcedure models where we want
2121
if (!Document.cozyClient) {
2222
Document.registerClient(client)
2323
}
@@ -26,7 +26,7 @@ class Procedure extends React.Component {
2626
)
2727

2828
initDocuments(get(creditApplicationTemplate, 'documents'))
29-
//Since init is done, we tell the app we can start to render thing
29+
// Since init is done, we tell the app we can start to render thing
3030
initializationSuccess()
3131
fetchMyself(client)
3232

packages/cozy-procedures/src/components/documents/DocumentHolder.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class DocumentHolder extends Component {
9292
DocumentHolder.propTypes = {
9393
unlinkDocument: PropTypes.func.isRequired,
9494
categoryId: PropTypes.string.isRequired,
95-
//io.cozy.files
95+
// io.cozy.files
9696
document: PropTypes.object.isRequired,
9797
t: PropTypes.func.isRequired,
9898
index: PropTypes.number.isRequired

packages/cozy-procedures/src/components/form/getInputProps.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*eslint no-unused-vars: off*/
1+
/* eslint no-unused-vars: off*/
22
const getInputProps = (
33
{
44
readonly,

packages/cozy-procedures/src/components/overview/Overview.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class Overview extends React.Component {
142142
Object.keys(documentsData).forEach(categoryName => {
143143
const documentCategory = documentsData[categoryName]
144144
documentCategory.files.forEach(f => {
145-
//!TODO Remove this check. We need to clean datas structure before
145+
// !TODO Remove this check. We need to clean datas structure before
146146
if (f) {
147147
const identifier = `documents/${f.name}`
148148
files[identifier] = f.id

packages/cozy-procedures/src/redux/documentsDataSlice.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const documentsSlice = createSlice({
2828
return {
2929
completedFromDrive: 0,
3030
data: Object.keys(action.payload).reduce((acc, fieldId) => {
31-
//init files with undefined value
31+
// init files with undefined value
3232
acc[fieldId] = {
3333
files: Array.from(Array(action.payload[fieldId].count))
3434
}
@@ -167,7 +167,7 @@ export function fetchDocumentsByCategory(documentTemplate) {
167167
}
168168
} catch (error) {
169169
const docWithRules = creditApplicationTemplate.documents[documentTemplate]
170-
//If we had a global error for a category, let's set the error everywhere
170+
// If we had a global error for a category, let's set the error everywhere
171171
for (let i = 0; i < docWithRules.count; i++) {
172172
dispatch(
173173
fetchDocumentError({

packages/cozy-realtime/src/CozyRealtime.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function createSocketServer({
142142

143143
const sleep = time => new Promise(resolve => setTimeout(resolve, time))
144144

145-
/*** TEST ***/
145+
/** * TEST ***/
146146

147147
describe('CozyRealtime', () => {
148148
afterEach(async () => {

packages/cozy-scanner/src/DocumentCategory.spec.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ describe('DocumentCategory', () => {
4040
</MuiCozyTheme>
4141
)
4242
expect(asFragment()).toMatchSnapshot()
43-
//Click on the item
43+
// Click on the item
4444
fireEvent.click(getByText('Scan.items.test'))
4545
expect(asFragment()).toMatchSnapshot()
46-
//Check if the second item is displayed in the ActionMenu
46+
// Check if the second item is displayed in the ActionMenu
4747
expect(() => getByText('Scan.items.Label2')).not.toThrow()
4848
await wait(() => getByText('Scan.items.Label2'))
4949

5050
fireEvent.click(getByText('Scan.items.Label2'))
51-
//Menu should not be there anymore
51+
// Menu should not be there anymore
5252
expect(queryByText('Scan.items.Label2')).toBeNull()
5353
fireEvent.click(getByText('Scan.items.test'))
5454
await wait(() => getByText('Scan.items.Label2'))

packages/cozy-scanner/src/DocumentQualification.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ export class DocumentQualification extends Component {
112112
placeholder={t('Scan.filename')}
113113
value={filename}
114114
onChange={event => {
115-
//console.log('event', event)
116-
//If the user write something once, we don't want to rename the file automatically anymore
115+
// console.log('event', event)
116+
// If the user write something once, we don't want to rename the file automatically anymore
117117
if (!hasUserWrittenFileName) {
118118
this.setState({ hasUserWrittenFileName: true })
119119
}
120-
//If we left an empty value, then we reset the behavior
120+
// If we left an empty value, then we reset the behavior
121121
if (event.target.value === '') {
122122
this.setState({ hasUserWrittenFileName: false })
123123
}

packages/cozy-scanner/src/DocumentQualification.spec.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('DocumentQualification', () => {
3232
onDescribed={onDescribed}
3333
onFileNameChanged={onFileNameChanged}
3434
title={'Edit'}
35-
//initialSelected={{ itemId: 1, categoryLabel: 'Label1' }}
35+
// initialSelected={{ itemId: 1, categoryLabel: 'Label1' }}
3636
t={text => text}
3737
/>
3838
</MuiCozyTheme>

packages/cozy-scanner/src/ModalScannerQualification.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Alerter from 'cozy-ui/transpiled/react/Alerter'
66

77
import DocumentQualification from './DocumentQualification'
88

9-
//import ExperimentalModal from 'cozy-ui/transpiled/react/Labs/ExperimentalModal'
9+
// import ExperimentalModal from 'cozy-ui/transpiled/react/Labs/ExperimentalModal'
1010
import DialogContent from '@material-ui/core/DialogContent'
1111

1212
import ExperimentalDialog, {

packages/cozy-scanner/src/Scanner.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Scanner extends React.Component {
5959
*/
6060
onFail = message => {
6161
this.setState({ loadingScreen: false })
62-
console.log('failed', message) //eslint-disable-line no-console
62+
console.log('failed', message) // eslint-disable-line no-console
6363
}
6464

6565
onUpload = async (imageURI, qualification, filename = '') => {
@@ -100,7 +100,7 @@ class Scanner extends React.Component {
100100
...this.props.pluginConfig
101101
})
102102
} catch (e) {
103-
console.error('You have to install cordova camera plugin', e) //eslint-disable-line no-console
103+
console.error('You have to install cordova camera plugin', e) // eslint-disable-line no-console
104104
}
105105
}
106106

packages/cozy-scanner/src/ScannerUpload.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const doUpload = async (
2626
async file => {
2727
const reader = new FileReader()
2828
reader.onloadend = async () => {
29-
//we get the result of the readAsBuffer in the `result` attr
29+
// we get the result of the readAsBuffer in the `result` attr
3030
try {
3131
const newFile = await CozyFile.uploadFileWithConflictStrategy(
3232
name,
@@ -38,16 +38,16 @@ export const doUpload = async (
3838
)
3939
resolve(newFile)
4040
} catch (error) {
41-
console.log('error', error) //eslint-disable-line no-console
41+
console.log('error', error) // eslint-disable-line no-console
4242
reject(error)
4343
}
4444
}
4545
// Read the file as an ArrayBuffer
4646
reader.readAsArrayBuffer(file)
4747
},
4848
err => {
49-
//Since this module is pretty recent, let's have this info in sentry if needed
50-
console.error('error getting fileentry file!' + err) //eslint-disable-line no-console
49+
// Since this module is pretty recent, let's have this info in sentry if needed
50+
console.error('error getting fileentry file!' + err) // eslint-disable-line no-console
5151
reject(err)
5252
}
5353
)

packages/cozy-sharing/src/components/ShareAutosuggest.spec.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('ShareAutosuggest', () => {
2020
const inputNode = getByPlaceholderText('myPlaceHolder')
2121
inputNode.focus()
2222
expect(onFocus).toHaveBeenCalled()
23-
//It should not call onPick if the value is not an email
23+
// It should not call onPick if the value is not an email
2424
fireEvent.change(inputNode, { target: { value: 'quentin@qq' } })
2525
fireEvent.keyPress(inputNode, { key: 'Enter', keyCode: 13, charCode: 13 })
2626
expect(onPick).not.toHaveBeenCalled()

packages/cozy-sharing/src/components/useFetchDocumentPath.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const useFetchDocumentPath = (client, document) => {
1010
try {
1111
const path = await fetchFilesPaths(client, document._type, [document])
1212
setDocumentPath(path[0])
13-
//eslint-disable-next-line
13+
// eslint-disable-next-line
1414
} catch {}
1515
})()
1616
}, [client, document])

packages/cozy-sharing/src/helpers/contacts.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export const getOrCreateFromArray = async (client, contacts, createContact) => {
2626
)
2727

2828
if (matchedContact.data.length > 0) {
29-
//We take the shortcut that if we have sevaral contacts
30-
//with the same address, we take the first one for now
29+
// We take the shortcut that if we have sevaral contacts
30+
// with the same address, we take the first one for now
3131
return matchedContact.data[0]
3232
} else {
3333
const resp = await createContact({

packages/cozy-sharing/src/helpers/sharings.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const createSharingInStore = (
2121
docsId,
2222
sharing
2323
) => {
24-
//TODO Check if we can getByIds to avoid query in map
24+
// TODO Check if we can getByIds to avoid query in map
2525
docsId.map(async id => {
2626
const file = await client.query(client.get('io.cozy.files', id))
2727
dispatch(

0 commit comments

Comments
 (0)