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

build(apidom-error): use nodenext for TypeScript modules #4402

Merged
merged 5 commits into from
Oct 25, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"eslint-config-airbnb-base": "=15.0.0",
"eslint-config-airbnb-typescript": "=18.0.0",
"eslint-config-prettier": "=9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "=2.31.0",
"eslint-plugin-mocha": "=10.5.0",
"eslint-plugin-prettier": "=5.2.1",
Expand Down
22 changes: 22 additions & 0 deletions packages/apidom-error/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"settings": {
"import/resolver": {
"typescript": {
"project": ["./tsconfig.json"]
}
}
},
"rules": {
"import/extensions": [
"error",
"always",
{
"ts": "always",
"tsx": "always",
"js": "always",
"jsx": "never",
"ignorePackages": true
}
]
}
}
2 changes: 1 addition & 1 deletion packages/apidom-error/src/ApiDOMAggregateError.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type ApiDOMErrorOptions from './ApiDOMErrorOptions';
import type ApiDOMErrorOptions from './ApiDOMErrorOptions.ts';

class ApiDOMAggregateError extends AggregateError {
constructor(errors: Iterable<unknown>, message?: string, options?: ApiDOMErrorOptions) {
Expand Down
4 changes: 2 additions & 2 deletions packages/apidom-error/src/ApiDOMError.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ApiDOMAggregateError from './ApiDOMAggregateError';
import type ApiDOMErrorOptions from './ApiDOMErrorOptions';
import ApiDOMAggregateError from './ApiDOMAggregateError.ts';
import type ApiDOMErrorOptions from './ApiDOMErrorOptions.ts';

class ApiDOMError extends Error {
public static [Symbol.hasInstance](instance: unknown) {
Expand Down
4 changes: 2 additions & 2 deletions packages/apidom-error/src/ApiDOMStructuredError.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ApiDOMError from './ApiDOMError';
import type ApiDOMErrorOptions from './ApiDOMErrorOptions';
import ApiDOMError from './ApiDOMError.ts';
import type ApiDOMErrorOptions from './ApiDOMErrorOptions.ts';

class ApiDOMStructuredError extends ApiDOMError {
constructor(message?: string, structuredOptions?: ApiDOMErrorOptions) {
Expand Down
2 changes: 1 addition & 1 deletion packages/apidom-error/src/NotImplementedError.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import UnsupportedOperationError from './UnsupportedOperationError';
import UnsupportedOperationError from './UnsupportedOperationError.ts';

class NotImplementedError extends UnsupportedOperationError {}

Expand Down
2 changes: 1 addition & 1 deletion packages/apidom-error/src/UnsupportedOperationError.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ApiDOMError from './ApiDOMError';
import ApiDOMError from './ApiDOMError.ts';

class UnsupportedOperationError extends ApiDOMError {}

Expand Down
12 changes: 6 additions & 6 deletions packages/apidom-error/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// base error classes
export { default as ApiDOMError } from './ApiDOMError';
export { default as ApiDOMAggregateError } from './ApiDOMAggregateError';
export { default as ApiDOMStructuredError } from './ApiDOMStructuredError';
export type { default as ApiDOMErrorOptions } from './ApiDOMErrorOptions';
export { default as ApiDOMError } from './ApiDOMError.ts';
export { default as ApiDOMAggregateError } from './ApiDOMAggregateError.ts';
export { default as ApiDOMStructuredError } from './ApiDOMStructuredError.ts';
export type { default as ApiDOMErrorOptions } from './ApiDOMErrorOptions.ts';
// generic custom error classes
export { default as UnsupportedOperationError } from './UnsupportedOperationError';
export { default as NotImplementedError } from './NotImplementedError';
export { default as UnsupportedOperationError } from './UnsupportedOperationError.ts';
export { default as NotImplementedError } from './NotImplementedError.ts';
2 changes: 1 addition & 1 deletion packages/apidom-error/test/ApiDOMAggregateError.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from 'chai';

import { ApiDOMAggregateError, ApiDOMError } from '../src';
import { ApiDOMAggregateError, ApiDOMError } from '../src/index.ts';

describe('apidom-error', function () {
context('ApiDOMAggregateError', function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/apidom-error/test/ApiDOMError.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from 'chai';

import { ApiDOMError, ApiDOMErrorOptions } from '../src';
import { ApiDOMError, ApiDOMErrorOptions } from '../src/index.ts';

describe('apidom-error', function () {
context('ApiDOMError', function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/apidom-error/test/ApiDOMStructuredError.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from 'chai';

import { ApiDOMStructuredError, ApiDOMError } from '../src';
import { ApiDOMStructuredError, ApiDOMError } from '../src/index.ts';

describe('apidom-error', function () {
context('ApiDOMStructuredError', function () {
Expand Down
5 changes: 5 additions & 0 deletions packages/apidom-error/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext",
"allowImportingTsExtensions": true
},
"include": [
"src/**/*",
"test/**/*"
Expand Down