Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚧 Pipeline for feature/esm #1

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 6 additions & 5 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parser: "@typescript-eslint/parser"
parser: '@typescript-eslint/parser'
extends:
- airbnb-base
- prettier
parserOptions:
ecmaVersion: 2018
project: ./tsconfig.lint.json
Expand All @@ -10,7 +11,7 @@ env:
node: true
browser: true
rules:
"@typescript-eslint/lines-between-class-members": off
'@typescript-eslint/lines-between-class-members': off
arrow-parens:
- error
- as-needed
Expand All @@ -37,7 +38,7 @@ rules:
padding-line-between-statements:
- error
- blankLine: always
prev: "*"
prev: '*'
next:
- block
- block-like
Expand All @@ -59,7 +60,7 @@ rules:
- import
- let
- var
next: "*"
next: '*'
- blankLine: any
prev:
- const
Expand All @@ -86,5 +87,5 @@ rules:
- export
settings:
import/parsers:
"@typescript-eslint/parser":
'@typescript-eslint/parser':
- .ts
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ out/
docs/
coverage/

pnpm-lock.yaml
yarn.lock
yarn-error.log
.DS_Store
Expand Down
3 changes: 2 additions & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
},
"dependencies": {
"jira.js": "latest"
}
},
"type": "module"
}
4 changes: 2 additions & 2 deletions examples/src/addFixVersion.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Version3Client } from 'jira.js';
import { createIssue } from './utils';
import { apiToken, email, host } from './credentials';
import { createIssue } from './utils/index.js';
import { apiToken, email, host } from './credentials.js';

async function addFixVersion() {
const client = new Version3Client({
Expand All @@ -19,11 +19,11 @@
propertyValue: 'N/a',
});

console.log(fix);

Check warning on line 22 in examples/src/addFixVersion.ts

View workflow job for this annotation

GitHub Actions / Lint Code (18.x)

Unexpected console statement

Check warning on line 22 in examples/src/addFixVersion.ts

View workflow job for this annotation

GitHub Actions / Lint Code (20.x)

Unexpected console statement
}

addFixVersion().catch(e => {
console.error(e);

Check warning on line 26 in examples/src/addFixVersion.ts

View workflow job for this annotation

GitHub Actions / Lint Code (18.x)

Unexpected console statement

Check warning on line 26 in examples/src/addFixVersion.ts

View workflow job for this annotation

GitHub Actions / Lint Code (20.x)

Unexpected console statement

throw new Error(e.errorMessages?.join(' '));
});
4 changes: 2 additions & 2 deletions examples/src/addWorklog.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Version3Client } from 'jira.js';
import { createIssue } from './utils';
import { apiToken, email, host } from './credentials';
import { createIssue } from './utils/index.js';
import { apiToken, email, host } from './credentials.js';

async function addWorklog() {
const client = new Version3Client({
Expand All @@ -20,11 +20,11 @@
timeSpentSeconds: 60, // Required one of `timeSpentSeconds` or `timeSpent`
});

console.log(`Worklog successfully added for Issue Id: ${worklog.issueId}`);

Check warning on line 23 in examples/src/addWorklog.ts

View workflow job for this annotation

GitHub Actions / Lint Code (18.x)

Unexpected console statement

Check warning on line 23 in examples/src/addWorklog.ts

View workflow job for this annotation

GitHub Actions / Lint Code (20.x)

Unexpected console statement
}

addWorklog().catch(e => {
console.error(e);

Check warning on line 27 in examples/src/addWorklog.ts

View workflow job for this annotation

GitHub Actions / Lint Code (18.x)

Unexpected console statement

Check warning on line 27 in examples/src/addWorklog.ts

View workflow job for this annotation

GitHub Actions / Lint Code (20.x)

Unexpected console statement

throw new Error(e.errorMessages.join(' '));
});
11 changes: 5 additions & 6 deletions examples/src/basic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Version3Client } from 'jira.js';
import { apiToken, email, host } from './credentials';
import { apiToken, email, host } from './credentials.js';

const client = new Version3Client({
host,
Expand Down Expand Up @@ -28,7 +28,7 @@

const issue = await client.issues.getIssue({ issueIdOrKey: id });

console.log(`Issue '${issue.fields.summary}' was successfully added to '${project.name}' project.`);

Check warning on line 31 in examples/src/basic.ts

View workflow job for this annotation

GitHub Actions / Lint Code (18.x)

Unexpected console statement

Check warning on line 31 in examples/src/basic.ts

View workflow job for this annotation

GitHub Actions / Lint Code (20.x)

Unexpected console statement
} else {
const myself = await client.myself.getCurrentUser();

Expand All @@ -41,13 +41,12 @@

const project = await client.projects.getProject({ projectIdOrKey: id.toString() });

console.log(`Project '${project.name}' was successfully created.`);

Check warning on line 44 in examples/src/basic.ts

View workflow job for this annotation

GitHub Actions / Lint Code (18.x)

Unexpected console statement

Check warning on line 44 in examples/src/basic.ts

View workflow job for this annotation

GitHub Actions / Lint Code (20.x)

Unexpected console statement
}
}

main()
.catch(e => {
console.error(e);
main().catch(e => {
console.error(e);

Check warning on line 49 in examples/src/basic.ts

View workflow job for this annotation

GitHub Actions / Lint Code (18.x)

Unexpected console statement

Check warning on line 49 in examples/src/basic.ts

View workflow job for this annotation

GitHub Actions / Lint Code (20.x)

Unexpected console statement

throw new Error(JSON.stringify(e));
});
throw new Error(JSON.stringify(e));
});
7 changes: 4 additions & 3 deletions examples/src/getAllWorklogs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Version3Client } from 'jira.js';
import { addWorklog, createIssue } from './utils';
import { apiToken, email, host } from './credentials';
import type { Worklog } from 'jira.js/out/version3/models';
import { apiToken, email, host } from './credentials.js';
import { addWorklog, createIssue } from './utils/index.js';

async function getAllWorklogs() {
const client = new Version3Client({
Expand All @@ -19,7 +20,7 @@ async function getAllWorklogs() {
await addWorklog(client, issue);

// The main part responsible for getting the worklogs
const worklogs = [];
const worklogs: Worklog[] = [];

let offset = 0;
let total = 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './addWorklog';
export * from './createIssue';
export * from './addWorklog.js';
export * from './createIssue.js';
Loading