Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
"files": ["*.ts", "*.tsx", "*.mts"],
"extends": ["plugin:@nx/typescript"],
"rules": {
"@typescript-eslint/no-unused-vars": "off"
"@typescript-eslint/no-unused-vars": "off",
"curly": [
"error",
"all"
]
}
},
{
Expand Down Expand Up @@ -55,6 +59,10 @@
"leadingUnderscore": "forbid",
"trailingUnderscore": "forbid"
}
],
"curly": [
"error",
"all"
]
}
}
4 changes: 3 additions & 1 deletion apps/nuxt/src/components/program/detail/ProgramDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ if (currentProgram.value) {
}

const scrollToRef = (targetRef: HTMLElement | null | undefined) => {
if (!targetRef) return
if (!targetRef) {
return
}
if (targetRef) {
Scroll.toWithEligibilityBarOffset(targetRef)
}
Expand Down
4 changes: 3 additions & 1 deletion apps/nuxt/src/components/project/details/ProjectSideNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ const scrollTo = (id: string) => {
}

const hasTestimony = computed(() => {
if (!props.project) return false
if (!props.project) {
return false
}
return testimonies.some((testimony) => testimony.projects?.includes(props.project!.id))
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ const props = defineProps<{
}>()

const testimoniesToDisplay = computed(() => {
if (!props.project) return []
if (!props.project) {
return []
}
return testimonies.filter((testimony) => testimony.projects?.includes(props.project!.id))
})

const hasTestimony = computed(() => {
if (!props.project) return false
if (!props.project) {
return false
}
return testimonies.some((testimony) => testimony.projects?.includes(props.project!.id))
})
</script>
8 changes: 6 additions & 2 deletions apps/nuxt/src/pages/TeeBudgetPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,14 @@ const formatCurrency = (value: number): string => {
}

const drawBudgetChart = async () => {
if (!budgetChartCanvas.value) return
if (!budgetChartCanvas.value) {
return
}

const chartContext = budgetChartCanvas.value.getContext('2d')
if (!chartContext) return
if (!chartContext) {
return
}

// Import Chart.js de manière asynchrone
const { default: Chart } = await import('chart.js/auto')
Expand Down
4 changes: 3 additions & 1 deletion apps/nuxt/src/tools/analytic/useExternalLinkTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export function useExternalLinkTracker(type: 'program' | 'project') {
const trackExternalLinks = (event: Event) => {
if (import.meta.client) {
const trackedContainer = document.getElementById('externalLinksTracking')
if (!trackedContainer) return
if (!trackedContainer) {
return
}

const target = event.target as HTMLElement
const link = target.closest('a') as HTMLAnchorElement | null
Expand Down
4 changes: 3 additions & 1 deletion apps/nuxt/src/tools/companyData/companyData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ export class CompanyData {
}

static hasSiret() {
if (!this.company) return false
if (!this.company) {
return false
}

return !!(this.company as EstablishmentFront)?.siret
}
Expand Down
4 changes: 3 additions & 1 deletion libs/backend-ddd/src/common/domain/error/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import ServiceNotFoundError from '../api/serviceNotFoundError'
* @arg value - expected to be an error, e.g. retrieved with the `catch` keyword.
*/
export function ensureError(value: unknown): Error {
if (value instanceof Error) return value
if (value instanceof Error) {
return value
}

let stringified = '[Unable to stringify the thrown value]'
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ const addBrevoDeal: OpportunityRepository['create'] = async (

if (!dealId.isErr) {
const maybeError = await associateBrevoDealToContact(dealId.value, domainOpportunity.contactId)
if (maybeError.isJust)
if (maybeError.isJust) {
return Result.err(new Error('Something went wrong while attaching contact to opportunity', { cause: maybeError.value }))
}
}

return dealId
Expand Down
12 changes: 9 additions & 3 deletions libs/data/src/program/dataPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export const readPrograms = (log = false): ProgramType[] => {
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const dataDirPath: string = path.join(__dirname, PROGRAMS_FOLDER_PATH)

if (log) console.log('📂 Reading data at', dataDirPath, '\n')
if (log) {
console.log('📂 Reading data at', dataDirPath, '\n')
}

const filenames: string[] = fs.readdirSync(dataDirPath)

Expand All @@ -52,11 +54,15 @@ export const prependInterface = (programs: ProgramType[], log = false): ProgramT
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const fullPath: string = path.join(__dirname, INTERFACE_PATH)

if (log) console.log('🗎 reading constants at', fullPath)
if (log) {
console.log('🗎 reading constants at', fullPath)
}
const file: string = fs.readFileSync(fullPath, 'utf8')
const constants = yaml.load(file) as Record<string, unknown>

if (log) console.log('➕ prepending publicodes with common constants')
if (log) {
console.log('➕ prepending publicodes with common constants')
}

return programs.map((p) => {
p.publicodes = { ...constants, ...p.publicodes }
Expand Down
4 changes: 3 additions & 1 deletion libs/data/src/program/mailManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ export class MailManager {
const programKey = program['Id fiche dispositif']
const tech: ProgramTechField = JSON.parse(program.tech) || {}

if (tech.prod_release_date) continue
if (tech.prod_release_date) {
continue
}

const matchingJson = jsonPrograms.find((p) => p.id === programKey)
if (matchingJson) {
Expand Down
4 changes: 3 additions & 1 deletion libs/data/src/program/yamlGenerator/eligibilityGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ function setEligibilitySector(generator: CoreGenerator) {
}

function setEligibilityGeography(generator: CoreGenerator) {
if (generator.program['Couverture géographique'].Name == 'National') return ["France et territoires d'outre-mer"]
if (generator.program['Couverture géographique'].Name == 'National') {
return ["France et territoires d'outre-mer"]
}

if (generator.program['Zones Spécifiques (géographie)']) {
generator.logger.log(
Expand Down
4 changes: 3 additions & 1 deletion libs/data/tests/data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ function testDataAgainstSchema(data: object, dataDesc: string, validate: Validat
}

function ensureError(value: unknown): Error {
if (value instanceof Error) return value
if (value instanceof Error) {
return value
}

let stringified = '[Unable to stringify the thrown value]'
try {
Expand Down
Loading