Skip to content
Snippets Groups Projects
Commit 53cb38fa authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

Merge branch 'fix-no-unused-vars' into 'main'

fix(eslint): upgrade packages & no unused vars

See merge request !41
parents e9a92bfe 7bcc8f34
No related branches found
No related tags found
1 merge request!41fix(eslint): upgrade packages & no unused vars
Pipeline #60183 passed
module.exports = {
extends: ['cozy-app', 'plugin:prettier/recommended'],
plugins: ['prettier'],
rules: {
'prettier/prettier': [
'error',
{ trailingComma: 'es5', arrowParens: 'avoid' },
],
},
}
......@@ -5,6 +5,7 @@ konnector-dev-config.json*
fixtures/*
data/*
.importedData.json
importedData.json
# NPM
node_modules/
......
......@@ -3,5 +3,6 @@
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
"trailingComma": "es5",
"arrowParens": "avoid"
}
......@@ -9,7 +9,7 @@ describe('buildAggregatedData', () => {
it('should return year value', async () => {
const reply = await buildAggregatedData(
{
'2022': 36,
2022: 36,
},
'com.grandlyon.enedis.year'
)
......@@ -29,7 +29,7 @@ describe('buildAggregatedData', () => {
spy.mockResolvedValueOnce([{ year: 2022, month: 8, day: 1, load: 1 }])
const reply = await buildAggregatedData(
{
'2022': 36,
2022: 36,
},
'com.grandlyon.enedis.year'
)
......
......@@ -68,9 +68,9 @@ async function activateContract(
`Enedis issue ${parsedReply.Envelope.Body.Fault.detail.erreur.resultat.$.code}: ${parsedReply.Envelope.Body.Fault.faultstring}`
)
}
//TODO: handle SGT4B8: Il existe déjà plusieurs demandes en cours sur le point ?
//TODO: handle SGT4H9: La demande ne porte pas sur un point équipé d'un compteur communicant ouvert aux services niveau 2.
//TODO: handle SGT589: La demande ne peut pas aboutir car le compteur n'est actuellement pas téléopérable.
// TODO: handle SGT4B8: Il existe déjà plusieurs demandes en cours sur le point ?
// TODO: handle SGT4H9: La demande ne porte pas sur un point équipé d'un compteur communicant ouvert aux services niveau 2.
// TODO: handle SGT589: La demande ne peut pas aboutir car le compteur n'est actuellement pas téléopérable.
throw errors.CAPTCHA_RESOLUTION_FAILED
}
}
......
......@@ -62,9 +62,10 @@ async function verifyUserIdentity(
fields.pointId
)
const escalierEtEtageEtAppartement = userAddress.escalierEtEtageEtAppartement
? removeMultipleSpaces(userAddress.escalierEtEtageEtAppartement)
: ''
const escalierEtEtageEtAppartement =
userAddress.escalierEtEtageEtAppartement
? removeMultipleSpaces(userAddress.escalierEtEtageEtAppartement)
: ''
pdl = await findUserPdl(
`${baseUrl}/enedis_SDE_recherche-point/1.0`,
......
......@@ -7,7 +7,6 @@ const { log, cozyClient } = require('cozy-konnector-libs')
*/
async function buildAggregatedData(data, doctype) {
let aggregatedData = []
// eslint-disable-next-line no-unused-vars
for (let [key, value] of Object.entries(data)) {
const data = buildDataFromKey(doctype, key, value)
const oldValue = await resetInProgressAggregatedData(data, doctype)
......@@ -69,17 +68,17 @@ async function resetInProgressAggregatedData(data, doctype) {
var filtered = []
if (doctype === 'com.grandlyon.enedis.year') {
// Yearly case
filtered = result.filter(function(el) {
filtered = result.filter(function (el) {
return el.year == data.year
})
} else if (doctype === 'com.grandlyon.enedis.month') {
// Monthly case
filtered = result.filter(function(el) {
filtered = result.filter(function (el) {
return el.year == data.year && el.month == data.month
})
} else {
// Hourly case
filtered = result.filter(function(el) {
filtered = result.filter(function (el) {
return (
el.year == data.year &&
el.month == data.month &&
......@@ -90,7 +89,6 @@ async function resetInProgressAggregatedData(data, doctype) {
}
// Remove data
let sum = 0.0
// eslint-disable-next-line no-unused-vars
for (const doc of filtered) {
sum += doc.load
log('debug', doc, 'Removing this entry for ' + doctype)
......
......@@ -45,7 +45,7 @@ const { version } = require('../package.json')
moment.locale('fr') // set the language
moment.tz.setDefault('Europe/Paris') // set the timezone
/*** Connector Constants ***/
/** Connector Constants **/
const manualExecution =
process.env.COZY_JOB_MANUAL_EXECUTION === 'true' ? true : false
let startDailyDate = manualExecution
......@@ -64,8 +64,7 @@ module.exports = new BaseKonnector(start)
* Sentry
*/
Sentry.init({
dsn:
'https://18747a93401447f2a81b83cd8c4bbbdf@grandlyon.errors.cozycloud.cc/5',
dsn: 'https://18747a93401447f2a81b83cd8c4bbbdf@grandlyon.errors.cozycloud.cc/5',
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
......
......@@ -89,7 +89,9 @@ async function onDeleteAccount() {
}
}
// eslint-disable-next-line promise/catch-or-return
onDeleteAccount().then(
// eslint-disable-next-line promise/always-return
() => {
log('info', `onDeleteAccount: Successfully delete consent and account.`)
},
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment