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 b50ed8a + d39e19e commit ee8b21c
Show file tree
Hide file tree
Showing 48 changed files with 762 additions and 907 deletions.
60 changes: 0 additions & 60 deletions .eslintrc.json

This file was deleted.

16 changes: 8 additions & 8 deletions documentation/docs/apis/draw-engine-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,16 @@ Returns categorized matchUps from a single structure.
```js
const { upcomingMatchUps, pendingMatchUps, completedMatchUps, abandonedMatchUps, byeMatchUps } =
drawEngine.getStructureMatchUps({
structureId,
context, // optional context to be added into matchUps
inContext, // boolean - add context { drawId, structureId, participant, individualParticipants ... }
nextMatchUps, // optioanl - boolean - to include winnerTo and loserTo
matchUpFilters, // attribute filters
contextFilters, // filters based on context attributes
tournamentParticipants, // optional - provide an array of tournamentParticipants to add into matchUps
requireParticipants, // optional - require that participants be loaded into drawEngine or passed into method
tournamentAppliedPolicies, // any policies, such as privacy, to be applied to matchUps
scheduleVisibilityFilters, // { visibilityThreshold: Date, eventIds, drawIds }
tournamentParticipants, // optional - provide an array of tournamentParticipants to add into matchUps
requireParticipants, // optional - require that participants be loaded into drawEngine or passed into method
contextFilters, // filters based on context attributes
matchUpFilters, // attribute filters
structureId,
nextMatchUps, // optioanl - boolean - to include winnerTo and loserTo
inContext, // boolean - add context { drawId, structureId, participant, individualParticipants ... }
context, // optional context to be added into matchUps
});
```

Expand Down
22 changes: 11 additions & 11 deletions documentation/docs/governors/query-governor.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Returns all matchUps for an event.

```js
const { matchUps } = allEventMatchUps({
scheduleVisibilityFilters, // { visibilityThreshold: dateString, eventIds, drawIds }
participantsProfile, // optional - ability to specify additions to context (see parameters of getParticipants())
scheduleVisibilityFilters, // { visibilityThreshold: Date, eventIds, drawIds }
matchUpFilters, // optional; [ scheduledDates: [], courtIds: [], stages: [], roundNumbers: [], matchUpStatuses: [], matchUpFormats: []]
contextFilters, // filters based on context attributes
nextMatchUps: true, // include winner/loser target matchUp details
Expand Down Expand Up @@ -61,7 +61,7 @@ Return an array of all matchUps contained within a tournament. These matchUps ar

```js
const { matchUps, groupInfo } = engine.allTournamentMatchUps({
scheduleVisibilityFilters, // { visibilityThreshold: Date, eventIds, drawIds }
scheduleVisibilityFilters, // { visibilityThreshold: dateString, eventIds, drawIds }
participantsProfile, // optional - ability to specify additions to context (see parameters of getParticipants())
matchUpFilters, // optional; [ scheduledDates: [], courtIds: [], stages: [], roundNumbers: [], matchUpStatuses: [], matchUpFormats: []]
contextFilters, // filters based on context attributes
Expand Down Expand Up @@ -118,13 +118,13 @@ Returns matchUps for an event grouped by status.

```js
const { abandonedMatchUps, byeMatchUps, completedMatchUps, pendingMatchUps, upcomingMatchUps } = engine.eventMatchUps({
eventId,
nextMatchUps, // optional boolean; include winner/loser target matchUp details
matchUpFilters, // optional; [ scheduledDates: [], courtIds: [], stages: [], roundNumbers: [], matchUpStatuses: [], matchUpFormats: []]
contextFilters,
scheduleVisibilityFilters, // { visibilityThreshold: dateString, eventIds, drawIds }
tournamentAppliedPolicies,
scheduleVisibilityFilters, // { visibilityThreshold: Date, eventIds, drawIds }
inContext: true, // optional - adds context details to all matchUps
contextFilters, // optiona; filter by attributes that are only present after matchUpContext has been added (hydration)
matchUpFilters, // optional; [ scheduledDates: [], courtIds: [], stages: [], roundNumbers: [], matchUpStatuses: [], matchUpFormats: []]
nextMatchUps, // optional boolean; include winner/loser target matchUp details
inContext, // optional - adds context details to all matchUps
eventId,
});
```

Expand Down Expand Up @@ -660,7 +660,7 @@ const {
allocatedCourts: [{ venueId, courtid }], // applies only to TEAM matchUps
},
} = engine.getMatchUpScheduleDetails({
scheduleVisibilityFilters, // { visibilityThreshold: Date, eventIds, drawIds }
scheduleVisibilityFilters, // { visibilityThreshold: dateString, eventIds, drawIds }
matchUp,
});
```
Expand Down Expand Up @@ -1515,9 +1515,9 @@ Returns tournament matchUps grouped by matchUpStatus. These matchUps are returne
```js
const { abandonedMatchUps, completedMatchUps, upcomingMatchUps, pendingMatchUps, byeMatchUps, groupInfo } =
engine.tournamentMatchUps({
matchUpFilters, // optional; [ scheduledDates: [], courtIds: [], stages: [], roundNumbers: [], matchUpStatuses: [], matchUpFormats: []]
scheduleVisibilityFilters, // { visibilityThreshold: dateString, eventIds, drawIds }
policyDefinitions, // optional - seeding or avoidance policies to be used when placing participants
scheduleVisibilityFilters, // { visibilityThreshold: Date, eventIds, drawIds }
matchUpFilters, // optional; [ scheduledDates: [], courtIds: [], stages: [], roundNumbers: [], matchUpStatuses: [], matchUpFormats: []]
});
```

Expand Down
76 changes: 76 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
const typescriptEslintParser = require('@typescript-eslint/parser');
const eslintPluginSonarjs = require('eslint-plugin-sonarjs');
const { FlatCompat } = require('@eslint/eslintrc');
const globals = require('globals');
const js = require('@eslint/js');

const compat = new FlatCompat({
recommendedConfig: js.configs.recommended,
baseDirectory: __dirname,
});

module.exports = [
...compat.extends('./eslint.vite.js'),
js.configs.recommended,
...compat.extends(
'plugin:compat/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:sonarjs/recommended',
'plugin:prettier/recommended',
),
{ plugins: { sonarjs: eslintPluginSonarjs } },
{
languageOptions: {
parser: typescriptEslintParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
...globals.node,
...globals.browser,
...globals.es6,
...globals.jest,
},
},
},
{
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/no-use-before-define': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'import/no-unresolved': 'off',
'import/namespace': 'off',
'sonarjs/cognitive-complexity': ['off', 100],
'sonarjs/no-all-duplicated-branches': 'warn',
'sonarjs/no-collapsible-if': 'warn',
'sonarjs/no-collection-size-mischeck': 'warn',
'sonarjs/no-duplicate-string': 'warn',
'sonarjs/no-duplicated-branches': 'warn',
'sonarjs/no-empty-collection': 'warn',
'sonarjs/no-extra-arguments': 'warn',
'sonarjs/no-gratuitous-expressions': 'warn',
'sonarjs/no-identical-expressions': 'warn',
'sonarjs/no-identical-functions': 'warn',
'sonarjs/no-ignored-return': 'off',
'sonarjs/no-misleading-array-reverse': 'off',
'sonarjs/no-nested-template-literals': 'warn',
'sonarjs/no-redundant-boolean': 'warn',
'sonarjs/no-redundant-jump': 'warn',
'sonarjs/no-small-switch': 'warn',
'sonarjs/no-unused-collection': 'warn',
'sonarjs/prefer-object-literal': 'warn',
'sonarjs/prefer-single-boolean-return': 'warn',
},
},
{ ignores: ['node_modules/', 'dist/', 'coverage/', '**/scratch/', 'server/', '**/*.test.ts'] },
];
53 changes: 53 additions & 0 deletions eslint.vite.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
module.exports = {
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:sonarjs/recommended',
],
parser: '@typescript-eslint/parser',
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
paths: ['src'],
},
},
},
plugins: ['@typescript-eslint', 'sonarjs'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-useless-escape': 'off',
'array-callback-return': 'warn',
complexity: ['off', 25],
eqeqeq: ['warn', 'smart'],
'import/named': 'off',
'import/no-duplicates': 'error',
'import/no-unresolved': 'off',
'no-console': 'off',
'no-debugger': 'error',
'no-duplicate-imports': 0,
'no-nested-ternary': 'warn',
'no-unneeded-ternary': 'warn',
'no-unused-vars': 'off',
'sonarjs/cognitive-complexity': ['warn', 15],
'sonarjs/no-collapsible-if': 'warn',
'sonarjs/no-duplicate-string': 'warn',
'sonarjs/no-duplicated-branches': 'warn',
'sonarjs/no-ignored-return': 'off',
'sonarjs/no-nested-template-literals': 'warn',
'sonarjs/no-redundant-boolean': 'warn',
'sonarjs/no-redundant-jump': 'warn',
'sonarjs/no-small-switch': 'warn',
'sonarjs/no-unused-collection': 'warn',
'sonarjs/prefer-single-boolean-return': 'warn',
},
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@
"eslint-plugin-compat": "4.2.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "7.34.1",
"eslint-plugin-sonarjs": "^0.25.0",
"esm": "3.2.25",
"fs-extra": "11.2.0",
"globals": "^15.0.0",
"husky": "9.0.11",
"jest": "29.7.0",
"lint-staged": "15.2.2",
Expand Down
Loading

0 comments on commit ee8b21c

Please sign in to comment.