Skip to content

Commit

Permalink
chore: align code formatting configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <[email protected]>
  • Loading branch information
jerome-benoit committed Jul 19, 2024
1 parent 1293099 commit b015f77
Show file tree
Hide file tree
Showing 19 changed files with 83 additions and 83 deletions.
16 changes: 8 additions & 8 deletions ui/web/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = defineConfig({
root: true,

env: {
node: true
node: true,
},

plugins: ['simple-import-sort'],
Expand All @@ -17,27 +17,27 @@ module.exports = defineConfig({
'plugin:import/typescript',
'plugin:vue/vue3-recommended',
'@vue/eslint-config-typescript/recommended',
'@vue/eslint-config-prettier'
'@vue/eslint-config-prettier',
],

settings: {
'import/resolver': {
typescript: {
project: './tsconfig.json'
}
}
project: './tsconfig.json',
},
},
},

parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest'
ecmaVersion: 'latest',
},

rules: {
'no-console': env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': env.NODE_ENV === 'production' ? 'warn' : 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'vue/multi-word-component-names': 'off'
}
'vue/multi-word-component-names': 'off',
},
})
4 changes: 2 additions & 2 deletions ui/web/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
'*.{.css,json,md,yml,yaml,html,js,jsx,cjs,mjs,ts,tsx,cts,mts}': 'prettier --cache --write',
'*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}':
'eslint . --cache --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore'
// '*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}':
// 'eslint . --cache --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore',
}
2 changes: 1 addition & 1 deletion ui/web/.prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"arrowParens": "avoid",
"singleQuote": true,
"semi": false,
"trailingComma": "none"
"trailingComma": "es5"
}
4 changes: 2 additions & 2 deletions ui/web/src/components/actions/AddChargingStations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
autoStart: convertToBoolean(state.autoStart),
persistentConfiguration: convertToBoolean(state.persistentConfiguration),
ocppStrictCompliance: convertToBoolean(state.ocppStrictCompliance),
enableStatistics: convertToBoolean(state.enableStatistics)
enableStatistics: convertToBoolean(state.enableStatistics),
})
.then(() => {
$toast.success('Charging stations successfully added')
Expand Down Expand Up @@ -117,7 +117,7 @@ const state = ref<{
autoStart: false,
persistentConfiguration: true,
ocppStrictCompliance: true,
enableStatistics: false
enableStatistics: false,
})
watch(getCurrentInstance()!.appContext.config.globalProperties.$templates, () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/web/src/components/actions/SetSupervisionUrl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ defineProps<{
}>()
const state = ref<{ supervisionUrl: string }>({
supervisionUrl: ''
supervisionUrl: '',
})
</script>

Expand Down
2 changes: 1 addition & 1 deletion ui/web/src/components/actions/StartTransaction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ defineProps<{
}>()
const state = ref<{ idTag: string }>({
idTag: ''
idTag: '',
})
</script>

Expand Down
2 changes: 1 addition & 1 deletion ui/web/src/components/buttons/ToggleButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const $emit = defineEmits(['clicked'])
const id = props.shared === true ? `shared-toggle-button-${props.id}` : `toggle-button-${props.id}`
const state = ref<{ status: boolean }>({
status: getFromLocalStorage<boolean>(id, props.status ?? false)
status: getFromLocalStorage<boolean>(id, props.status ?? false),
})
const click = (): void => {
Expand Down
2 changes: 1 addition & 1 deletion ui/web/src/components/charging-stations/CSConnector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
() => {
$router.push({
name: 'start-transaction',
params: { hashId, chargingStationId, connectorId }
params: { hashId, chargingStationId, connectorId },
})
}
"
Expand Down
4 changes: 2 additions & 2 deletions ui/web/src/components/charging-stations/CSData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
name: 'set-supervision-url',
params: {
hashId: chargingStation.stationInfo.hashId,
chargingStationId: chargingStation.stationInfo.chargingStationId
}
chargingStationId: chargingStation.stationInfo.chargingStationId,
},
})
}
"
Expand Down
26 changes: 13 additions & 13 deletions ui/web/src/composables/UIClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
type RequestPayload,
type ResponsePayload,
ResponseStatus,
type UIServerConfigurationSection
type UIServerConfigurationSection,
} from '@/types'

import { randomUUID, validateUUID } from './Utils'
Expand Down Expand Up @@ -100,44 +100,44 @@ export class UIClient {
return this.sendRequest(ProcedureName.ADD_CHARGING_STATIONS, {
template,
numberOfStations,
options
options,
})
}

public async deleteChargingStation(hashId: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.DELETE_CHARGING_STATIONS, {
hashIds: [hashId]
hashIds: [hashId],
})
}

public async setSupervisionUrl(hashId: string, supervisionUrl: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.SET_SUPERVISION_URL, {
hashIds: [hashId],
url: supervisionUrl
url: supervisionUrl,
})
}

public async startChargingStation(hashId: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.START_CHARGING_STATION, {
hashIds: [hashId]
hashIds: [hashId],
})
}

public async stopChargingStation(hashId: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.STOP_CHARGING_STATION, {
hashIds: [hashId]
hashIds: [hashId],
})
}

public async openConnection(hashId: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.OPEN_CONNECTION, {
hashIds: [hashId]
hashIds: [hashId],
})
}

public async closeConnection(hashId: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.CLOSE_CONNECTION, {
hashIds: [hashId]
hashIds: [hashId],
})
}

Expand All @@ -149,7 +149,7 @@ export class UIClient {
return this.sendRequest(ProcedureName.START_TRANSACTION, {
hashIds: [hashId],
connectorId,
idTag
idTag,
})
}

Expand All @@ -159,7 +159,7 @@ export class UIClient {
): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.STOP_TRANSACTION, {
hashIds: [hashId],
transactionId
transactionId,
})
}

Expand All @@ -169,7 +169,7 @@ export class UIClient {
): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.START_AUTOMATIC_TRANSACTION_GENERATOR, {
hashIds: [hashId],
connectorIds: [connectorId]
connectorIds: [connectorId],
})
}

Expand All @@ -179,7 +179,7 @@ export class UIClient {
): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.STOP_AUTOMATIC_TRANSACTION_GENERATOR, {
hashIds: [hashId],
connectorIds: [connectorId]
connectorIds: [connectorId],
})
}

Expand All @@ -191,7 +191,7 @@ export class UIClient {
`${this.uiServerConfiguration.protocol}${this.uiServerConfiguration.version}`,
`authorization.basic.${btoa(
`${this.uiServerConfiguration.authentication.username}:${this.uiServerConfiguration.authentication.password}`
).replace(/={1,2}$/, '')}`
).replace(/={1,2}$/, '')}`,
]
: `${this.uiServerConfiguration.protocol}${this.uiServerConfiguration.version}`
this.ws = new WebSocket(
Expand Down
2 changes: 1 addition & 1 deletion ui/web/src/composables/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export {
getLocalStorage,
randomUUID,
setToLocalStorage,
useUIClient
useUIClient,
} from './Utils'
24 changes: 12 additions & 12 deletions ui/web/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,41 @@ export const router = createRouter({
path: '/',
name: 'charging-stations',
components: {
default: ChargingStationsView
}
default: ChargingStationsView,
},
},
{
path: '/add-charging-stations',
name: 'add-charging-stations',
components: {
default: ChargingStationsView,
action: AddChargingStations
}
action: AddChargingStations,
},
},
{
path: '/set-supervision-url/:hashId/:chargingStationId',
name: 'set-supervision-url',
components: {
default: ChargingStationsView,
action: SetSupervisionUrl
action: SetSupervisionUrl,
},
props: { default: false, action: true }
props: { default: false, action: true },
},
{
path: '/start-transaction/:hashId/:chargingStationId/:connectorId',
name: 'start-transaction',
components: {
default: ChargingStationsView,
action: StartTransaction
action: StartTransaction,
},
props: { default: false, action: true }
props: { default: false, action: true },
},
{
name: 'not-found',
path: '/:pathMatch(.*)*',
components: {
default: NotFoundView
}
}
]
default: NotFoundView,
},
},
],
})
Loading

0 comments on commit b015f77

Please sign in to comment.