Skip to content

🏷️ Convert to ES Modules and NodeNext #314

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

Merged
merged 11 commits into from
Jan 2, 2025
  •  
  •  
  •  
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 Down
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 Down
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 @@ -45,9 +45,8 @@ async function main() {
}
}

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

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