Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
CourtHive committed Apr 18, 2024
2 parents ee8b21c + 981e2a4 commit ce6ef15
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 79 deletions.
42 changes: 33 additions & 9 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ const compat = new FlatCompat({
});

module.exports = [
...compat.extends('./eslint.vite.js'),
// ...compat.extends('./eslint.vite.js'),
js.configs.recommended,
...compat.extends(
'eslint:recommended',
'plugin:compat/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
Expand All @@ -21,6 +22,16 @@ module.exports = [
'plugin:prettier/recommended',
),
{ plugins: { sonarjs: eslintPluginSonarjs } },
{
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
paths: ['src'],
},
},
},
},
{
languageOptions: {
parser: typescriptEslintParser,
Expand All @@ -38,18 +49,29 @@ module.exports = [
},
{
rules: {
'no-unused-expressions': 'off',
'@typescript-eslint/no-useless-escape': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'import/no-named-as-default': 'off',
'@typescript-eslint/no-useless-escape': 'off',
'array-callback-return': 'warn',
'import/named': 'off',
'import/namespace': 'off',
'import/no-duplicates': 'error',
'import/no-named-as-default-member': 'off',
'import/no-named-as-default': 'off',
'import/no-unresolved': 'off',
'import/namespace': 'off',
'no-console': 'off',
'no-debugger': 'error',
'no-duplicate-imports': 0,
'no-nested-ternary': 'warn',
'no-unneeded-ternary': 'warn',
'no-unused-expressions': 'off',
'no-unused-vars': 'off',
'sonarjs/cognitive-complexity': ['off', 100],
'sonarjs/no-all-duplicated-branches': 'warn',
'sonarjs/no-collapsible-if': 'warn',
Expand All @@ -70,6 +92,8 @@ module.exports = [
'sonarjs/no-unused-collection': 'warn',
'sonarjs/prefer-object-literal': 'warn',
'sonarjs/prefer-single-boolean-return': 'warn',
complexity: ['off', 25],
eqeqeq: ['warn', 'smart'],
},
},
{ ignores: ['node_modules/', 'dist/', 'coverage/', '**/scratch/', 'server/', '**/*.test.ts'] },
Expand Down
53 changes: 0 additions & 53 deletions eslint.vite.js

This file was deleted.

34 changes: 18 additions & 16 deletions src/query/matchUps/addMatchUpContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,15 @@ export function addMatchUpContext({
if (side.participantId) {
const participant = makeDeepCopy(
getMappedParticipant(side.participantId) ||
(tournamentParticipants &&
findParticipant({
policyDefinitions: appliedPolicies,
participantId: side.participantId,
tournamentParticipants,
internalUse: true,
contextProfile,
})),
(tournamentParticipants
? findParticipant({
policyDefinitions: appliedPolicies,
participantId: side.participantId,
tournamentParticipants,
internalUse: true,
contextProfile,
})
: undefined),
undefined,
true,
);
Expand All @@ -345,14 +346,15 @@ export function addMatchUpContext({
const individualParticipants = side.participant.individualParticipantIds.map((participantId) => {
return (
getMappedParticipant(participantId) ||
(tournamentParticipants &&
findParticipant({
policyDefinitions: appliedPolicies,
tournamentParticipants,
internalUse: true,
contextProfile,
participantId,
}))
(tournamentParticipants
? findParticipant({
policyDefinitions: appliedPolicies,
tournamentParticipants,
internalUse: true,
contextProfile,
participantId,
})
: undefined)
);
});
Object.assign(side.participant, { individualParticipants });
Expand Down
2 changes: 1 addition & 1 deletion src/tests/vitest.noThreshold.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import tsconfigPaths from 'vite-tsconfig-paths'; // necessary for vite to resolv
export default defineConfig({
plugins: [tsconfigPaths()],
test: {
onConsoleLog: () => {},
// onConsoleLog: () => {},
environment: 'node',
include: ['src/**/*.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
coverage: {
Expand Down

0 comments on commit ce6ef15

Please sign in to comment.