chore: Application du linter

This commit is contained in:
Luc SORIGNET
2025-05-12 10:34:47 +02:00
parent 23a593dbc7
commit 425e6d73e5
56 changed files with 1140 additions and 1469 deletions

View File

@ -1,26 +1,39 @@
const fs = require('fs');
const path = require('path');
const fs = require("fs");
const path = require("path");
// Chemins vers les fichiers
const rootPackageJsonPath = path.resolve(__dirname, '../package.json');
const rootPackageJson = JSON.parse(fs.readFileSync(rootPackageJsonPath, 'utf8'));
const rootPackageJsonPath = path.resolve(__dirname, "../package.json");
const rootPackageJson = JSON.parse(
fs.readFileSync(rootPackageJsonPath, "utf8")
);
// Lire la version actuelle du package.json principal
const newVersion = rootPackageJson.version;
const frontendPackageJsonPath = path.resolve(__dirname, '../Front-End/package.json');
const frontendPackageJsonPath = path.resolve(
__dirname,
"../Front-End/package.json"
);
// Lire et mettre à jour le package.json du sous-module
const frontendPackageJson = JSON.parse(fs.readFileSync(frontendPackageJsonPath, 'utf8'));
const frontendPackageJson = JSON.parse(
fs.readFileSync(frontendPackageJsonPath, "utf8")
);
frontendPackageJson.version = newVersion;
// Écrire les changements dans le fichier frontend/package.json
fs.writeFileSync(frontendPackageJsonPath, JSON.stringify(frontendPackageJson, null, 2), 'utf8');
fs.writeFileSync(
frontendPackageJsonPath,
JSON.stringify(frontendPackageJson, null, 2),
"utf8"
);
// eslint-disable-next-line no-console
console.log(`Version mise à jour dans frontend/package.json : ${newVersion}`);
// Chemin vers le fichier Python de version
const versionFilePath = path.resolve(__dirname, '../Back-End/__version__.py');
const versionFilePath = path.resolve(__dirname, "../Back-End/__version__.py");
// Mettre à jour le fichier Python
const versionContent = `__version__ = "${newVersion}"\n`;
fs.writeFileSync(versionFilePath, versionContent, 'utf8');
console.log(`Version du backend mise à jour dans ${versionFilePath} : ${newVersion}`);
fs.writeFileSync(versionFilePath, versionContent, "utf8");
// eslint-disable-next-line no-console
console.log(
`Version du backend mise à jour dans ${versionFilePath} : ${newVersion}`
);