Skip to content

Commit 998d4b7

Browse files
committed
🏷️ Convert examples and tests to ESM
1 parent 883b69b commit 998d4b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+139
-159
lines changed

.eslintrc.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
parser: "@typescript-eslint/parser"
1+
parser: '@typescript-eslint/parser'
22
extends:
33
- airbnb-base
4+
- prettier
45
parserOptions:
56
ecmaVersion: 2018
67
project: ./tsconfig.lint.json
@@ -10,7 +11,7 @@ env:
1011
node: true
1112
browser: true
1213
rules:
13-
"@typescript-eslint/lines-between-class-members": off
14+
'@typescript-eslint/lines-between-class-members': off
1415
arrow-parens:
1516
- error
1617
- as-needed
@@ -37,7 +38,7 @@ rules:
3738
padding-line-between-statements:
3839
- error
3940
- blankLine: always
40-
prev: "*"
41+
prev: '*'
4142
next:
4243
- block
4344
- block-like
@@ -59,7 +60,7 @@ rules:
5960
- import
6061
- let
6162
- var
62-
next: "*"
63+
next: '*'
6364
- blankLine: any
6465
prev:
6566
- const
@@ -86,5 +87,5 @@ rules:
8687
- export
8788
settings:
8889
import/parsers:
89-
"@typescript-eslint/parser":
90+
'@typescript-eslint/parser':
9091
- .ts

examples/src/addFixVersion.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Version3Client } from 'jira.js';
2-
import { createIssue } from './utils';
3-
import { apiToken, email, host } from './credentials';
2+
import { createIssue } from './utils/index.js';
3+
import { apiToken, email, host } from './credentials.js';
44

55
async function addFixVersion() {
66
const client = new Version3Client({

examples/src/addWorklog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Version3Client } from 'jira.js';
2-
import { createIssue } from './utils';
3-
import { apiToken, email, host } from './credentials';
2+
import { createIssue } from './utils/index.js';
3+
import { apiToken, email, host } from './credentials.js';
44

55
async function addWorklog() {
66
const client = new Version3Client({

examples/src/basic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Version3Client } from 'jira.js';
2-
import { apiToken, email, host } from './credentials';
2+
import { apiToken, email, host } from './credentials.js';
33

44
const client = new Version3Client({
55
host,

examples/src/getAllWorklogs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Version3Client } from 'jira.js';
22
import type { Worklog } from 'jira.js/out/version3/models';
3-
import { apiToken, email, host } from './credentials';
4-
import { addWorklog, createIssue } from './utils';
3+
import { apiToken, email, host } from './credentials.js';
4+
import { addWorklog, createIssue } from './utils/index.js';
55

66
async function getAllWorklogs() {
77
const client = new Version3Client({

examples/src/utils/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './addWorklog';
2-
export * from './createIssue';
1+
export * from './addWorklog.js';
2+
export * from './createIssue.js';

tests/integration/agile/sprint.test.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import { afterAll, beforeAll, test } from 'vitest';
2-
import { AgileModels } from '@jirajs';
3-
import { Constants } from '@tests/integration/constants';
4-
import {
5-
createAgileProject,
6-
deleteAgileProject,
7-
getAgileClient,
8-
getVersion3Client,
9-
} from '@tests/integration/utils';
2+
import { AgileModels } from '../../../src/index.js';
3+
import { Constants } from '../constants.js';
4+
import { createAgileProject, deleteAgileProject, getAgileClient, getVersion3Client } from '../utils/index.js';
105

116
const client = getAgileClient();
127

@@ -22,7 +17,9 @@ afterAll(async () => {
2217
});
2318

2419
test.sequential('should create new sprint', async ({ expect }) => {
25-
const boards = await client.board.getAllBoards({ name: Constants.testAgileProjectKey });
20+
const boards = await client.board.getAllBoards({
21+
name: Constants.testAgileProjectKey,
22+
});
2623

2724
expect(boards.total).toBe(1);
2825

tests/integration/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from '@tests/constants';
2-
export * as Utils from '@tests/utils';
1+
export * from './constants.js';
2+
export * as Utils from './utils/index.js';

tests/integration/utils/cleanupEnvironment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { deleteSoftwareProject } from './deleteSoftwareProject';
1+
import { deleteSoftwareProject } from './deleteSoftwareProject.js';
22

33
export const cleanupEnvironment = async () => {
44
await deleteSoftwareProject();

tests/integration/utils/createAgileProject.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Constants } from '@tests/integration/constants';
2-
import { getVersion3Client } from './getClient';
1+
import { Constants } from '../constants.js';
2+
import { getVersion3Client } from './getClient.js';
33

44
export const createAgileProject = async () => {
55
const client = getVersion3Client();
@@ -11,6 +11,7 @@ export const createAgileProject = async () => {
1111
name: Constants.testAgileProjectName,
1212
leadAccountId: myself.accountId,
1313
projectTypeKey: 'software',
14-
projectTemplateKey: 'com.pyxis.greenhopper.jira:gh-simplified-agility-scrum',
14+
projectTemplateKey:
15+
'com.pyxis.greenhopper.jira:gh-simplified-agility-scrum',
1516
});
1617
};

0 commit comments

Comments
 (0)