Skip to content

Commit

Permalink
major: version 4
Browse files Browse the repository at this point in the history
### Breaking
* Drop support for CJS

### Patch
* Updated dependencies
  • Loading branch information
vHeemstra authored Jul 10, 2024
2 parents ad74a4e + 2ff91b2 commit 92b3925
Show file tree
Hide file tree
Showing 20 changed files with 530 additions and 584 deletions.
30 changes: 30 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* eslint-env node */
module.exports = {
env: {
commonjs: false,
es2021: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
overrides: [
{
env: {
jest: true,
},
files: ["test/**"],
plugins: ["jest"],
extends: ["plugin:jest/recommended"],
rules: {},
},
],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
};
30 changes: 0 additions & 30 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierrc.js → .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
trailingComma: 'es5',
trailingComma: "es5",
tabWidth: 2,
semi: true,
singleQuote: true,
Expand Down
40 changes: 21 additions & 19 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { JestConfigWithTsJest } from 'ts-jest';

import { defaults as tsjPreset } from 'ts-jest/presets';
// import { defaults as tsjPreset } from 'ts-jest/presets';
// import { defaultsESM as tsjPreset } from 'ts-jest/presets';
// import { jsWithTs as tsjPreset } from 'ts-jest/presets';
// import { jsWithTsESM as tsjPreset } from 'ts-jest/presets';
import { jsWithTsESM as tsjPreset } from 'ts-jest/presets';
// import { jsWithBabel as tsjPreset } from 'ts-jest/presets';
// import { jsWithBabelESM as tsjPreset } from 'ts-jest/presets';

Expand Down Expand Up @@ -225,31 +225,33 @@ const jestConfig: JestConfigWithTsJest = {
* See: https://kulshekhar.github.io/ts-jest/docs/getting-started/presets
* See: https://kulshekhar.github.io/ts-jest/docs/getting-started/options/
*/
// preset: 'ts-jest/presets/js-with-ts',
transformIgnorePatterns: ['node_modules/(?!gettext-parser/)'],
// preset: 'ts-jest/presets/default-esm',
// preset: 'ts-jest',
// extensionsToTreatAsEsm: ['.ts'],
// moduleNameMapper: {
// '^(\\.{1,2}/.*)\\.js$': '$1',
// },
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
testEnvironment: 'node',
// testEnvironmentOptions: {
// NODE_OPTIONS: '--experimental-vm-modules',
// },
transform: {
...tsjPreset.transform,
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
'^.+\\.tsx?$': [
'ts-jest',
{
// ts-jest configuration goes here
diagnostics: false,
babelConfig: {
plugins: ['babel-plugin-transform-import-meta'],
},
// useESM: true,
},
],
// // '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
// // '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
// '^.+\\.[jt]sx?$': [
// 'ts-jest',
// {
// // ts-jest configuration goes here
// diagnostics: false,
// // babelConfig: {
// // plugins: ['babel-plugin-transform-import-meta'],
// // },
// useESM: true,
// },
// ],
},
};

Expand Down
Loading

0 comments on commit 92b3925

Please sign in to comment.