diff --git a/openbas-front/.eslintrc.cjs b/openbas-front/.eslintrc.cjs index 02c4eed923..3565a12028 100644 --- a/openbas-front/.eslintrc.cjs +++ b/openbas-front/.eslintrc.cjs @@ -1,5 +1,5 @@ module.exports = { - "root": true, + root: true, extends: [ 'airbnb-base', 'airbnb-typescript/base', @@ -7,26 +7,26 @@ module.exports = { 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react/recommended', - 'plugin:i18next/recommended' + 'plugin:i18next/recommended', ], settings: { - "react": { - "version": "detect" - } + react: { + version: 'detect', + }, }, parserOptions: { ecmaVersion: 2020, - project: './tsconfig.json', + project: ['./tsconfig.json', './tsconfig.node.json'], tsconfigRootDir: __dirname, - parser: '@typescript-eslint/parser' + parser: '@typescript-eslint/parser', }, env: { browser: true, }, overrides: [ { - "files": ["*.jsx", "*.js", "*.ts", "*.tsx"] - } + files: ['*.jsx', '*.js', '*.ts', '*.tsx'], + }, ], ignorePatterns: [ '**/builder/**', @@ -37,7 +37,7 @@ module.exports = { '**/__generated__/**', '**/src/static/ext/**', ], - plugins: ["import-newlines", "i18next", "custom-rules"], + plugins: ['import-newlines', 'i18next', 'custom-rules'], rules: { 'custom-rules/classes-rule': 1, 'no-restricted-syntax': 0, @@ -48,61 +48,61 @@ module.exports = { 'arrow-body-style': 'off', 'max-len': [ 'error', 180, 2, { - 'ignoreUrls': true, - 'ignoreComments': false, - 'ignoreRegExpLiterals': true, - 'ignoreStrings': true, - 'ignoreTemplateLiterals': true - } + ignoreUrls: true, + ignoreComments: false, + ignoreRegExpLiterals: true, + ignoreStrings: true, + ignoreTemplateLiterals: true, + }, ], 'no-restricted-imports': [ 'error', { patterns: [ { group: ['@mui/material/*', '!@mui/material/locale', '!@mui/material/styles', '!@mui/material/colors', '!@mui/material/transitions'], - message: "Please use named import from @mui/material instead." + message: 'Please use named import from @mui/material instead.', }, { group: ['@mui/styles/*'], - message: "Please use named import from @mui/styles instead." - } - ] - } + message: 'Please use named import from @mui/styles instead.', + }, + ], + }, ], '@typescript-eslint/naming-convention': ['error', { - 'selector': 'variable', - 'format': ['camelCase', 'UPPER_CASE'], - 'leadingUnderscore': 'allow', - 'trailingUnderscore': 'allow', - 'filter': { - 'regex': '/([^_]*)/', - 'match': true - } + selector: 'variable', + format: ['camelCase', 'UPPER_CASE'], + leadingUnderscore: 'allow', + trailingUnderscore: 'allow', + filter: { + regex: '/([^_]*)/', + match: true, + }, }], 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': [ 'error', { - 'argsIgnorePattern': '^_', - 'varsIgnorePattern': '^_', - 'caughtErrorsIgnorePattern': '^_' - } + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + }, ], - 'import-newlines/enforce': ['error', {items: 20, 'max-len': 180}], + 'import-newlines/enforce': ['error', { items: 20, 'max-len': 180 }], 'react/jsx-indent': [2, 2], 'react/jsx-indent-props': [2, 2], 'react/jsx-closing-bracket-location': 'error', - "import/no-extraneous-dependencies": [ - "error", + 'import/no-extraneous-dependencies': [ + 'error', { - "devDependencies": [ - "**/*.test.tsx", - "**/*.test.ts", - "vite.config.ts", - "vitest.config.ts", - "playwright.config.ts", - ] - } - ] - } -} + devDependencies: [ + '**/*.test.tsx', + '**/*.test.ts', + 'vite.config.ts', + 'vitest.config.ts', + 'playwright.config.ts', + ], + }, + ], + }, +}; diff --git a/openbas-front/package.json b/openbas-front/package.json index 88526fecdd..7586a96e3b 100644 --- a/openbas-front/package.json +++ b/openbas-front/package.json @@ -118,7 +118,7 @@ "jsdom": "25.0.0", "nyc": "17.0.0", "swagger-typescript-api": "13.0.22", - "typescript": "5.4.5", + "typescript": "5.6.2", "vite": "5.4.6", "vite-plugin-istanbul": "6.0.2", "vitest": "1.6.0" diff --git a/openbas-front/src/admin/components/components/teams/TeamAddPlayers.tsx b/openbas-front/src/admin/components/components/teams/TeamAddPlayers.tsx index 0eae5cb190..5ced78960f 100644 --- a/openbas-front/src/admin/components/components/teams/TeamAddPlayers.tsx +++ b/openbas-front/src/admin/components/components/teams/TeamAddPlayers.tsx @@ -42,10 +42,10 @@ interface Props { teamId: Team['team_id'] } -interface UserStoreExtended extends UserStore { +type UserStoreExtended = UserStore & { organization_name: Organization['organization_name']; organization_description: Organization['organization_description'] -} +}; const TeamAddPlayers: React.FC = ({ addedUsersIds, teamId }) => { const dispatch = useAppDispatch(); diff --git a/openbas-front/src/admin/components/components/teams/TeamPlayers.tsx b/openbas-front/src/admin/components/components/teams/TeamPlayers.tsx index ba493f4890..0732c97490 100644 --- a/openbas-front/src/admin/components/components/teams/TeamPlayers.tsx +++ b/openbas-front/src/admin/components/components/teams/TeamPlayers.tsx @@ -156,9 +156,9 @@ interface Props { handleClose: () => void } -interface UserStoreExtended extends UserStore { +type UserStoreExtended = UserStore & { user_enabled: boolean; -} +}; const TeamPlayers: React.FC = ({ teamId, handleClose }) => { // Standard hooks diff --git a/openbas-front/tsconfig.json b/openbas-front/tsconfig.json index 6d5d67cd27..9b3e559f98 100644 --- a/openbas-front/tsconfig.json +++ b/openbas-front/tsconfig.json @@ -28,6 +28,7 @@ "builder/dev/build", "builder/prod/build", "src/static/ext/*", + "vite.config.ts", "__generated__" ], "references": [ diff --git a/openbas-front/tsconfig.node.json b/openbas-front/tsconfig.node.json index 73dbb0b0a5..5a89709ca1 100644 --- a/openbas-front/tsconfig.node.json +++ b/openbas-front/tsconfig.node.json @@ -7,6 +7,7 @@ "allowSyntheticDefaultImports": true }, "include": [ - "vite.config.ts" + "vite.config.ts", + ".eslintrc.cjs" ] } \ No newline at end of file diff --git a/openbas-front/yarn.lock b/openbas-front/yarn.lock index 6997ea7607..13f3b09e2f 100644 --- a/openbas-front/yarn.lock +++ b/openbas-front/yarn.lock @@ -12232,7 +12232,7 @@ __metadata: rxjs: "npm:7.8.1" seamless-immutable: "npm:7.1.4" swagger-typescript-api: "npm:13.0.22" - typescript: "npm:5.4.5" + typescript: "npm:5.6.2" usehooks-ts: "npm:3.1.0" uuid: "npm:10.0.0" vite: "npm:5.4.6" @@ -15615,13 +15615,13 @@ __metadata: languageName: node linkType: hard -"typescript@npm:5.4.5": - version: 5.4.5 - resolution: "typescript@npm:5.4.5" +"typescript@npm:5.6.2": + version: 5.6.2 + resolution: "typescript@npm:5.6.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/2954022ada340fd3d6a9e2b8e534f65d57c92d5f3989a263754a78aba549f7e6529acc1921913560a4b816c46dce7df4a4d29f9f11a3dc0d4213bb76d043251e + checksum: 10c0/3ed8297a8c7c56b7fec282532503d1ac795239d06e7c4966b42d4330c6cf433a170b53bcf93a130a7f14ccc5235de5560df4f1045eb7f3550b46ebed16d3c5e5 languageName: node linkType: hard @@ -15645,13 +15645,13 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A5.4.5#optional!builtin": - version: 5.4.5 - resolution: "typescript@patch:typescript@npm%3A5.4.5#optional!builtin::version=5.4.5&hash=5adc0c" +"typescript@patch:typescript@npm%3A5.6.2#optional!builtin": + version: 5.6.2 + resolution: "typescript@patch:typescript@npm%3A5.6.2#optional!builtin::version=5.6.2&hash=8c6c40" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/db2ad2a16ca829f50427eeb1da155e7a45e598eec7b086d8b4e8ba44e5a235f758e606d681c66992230d3fc3b8995865e5fd0b22a2c95486d0b3200f83072ec9 + checksum: 10c0/94eb47e130d3edd964b76da85975601dcb3604b0c848a36f63ac448d0104e93819d94c8bdf6b07c00120f2ce9c05256b8b6092d23cf5cf1c6fa911159e4d572f languageName: node linkType: hard