-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): include default export to work around some bundler issues (…
…#205) * fix(build): include default export to work around some bundler issues fixes #186 * chore(build): upgrade linters * chore: specify extension for relative imports
- Loading branch information
Showing
14 changed files
with
2,726 additions
and
6,135 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
import jest from "eslint-plugin-jest"; | ||
import globals from "globals"; | ||
import tsParser from "@typescript-eslint/parser"; | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import js from "@eslint/js"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
export default [...compat.extends( | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:prettier/recommended", | ||
), { | ||
plugins: { | ||
"@typescript-eslint": typescriptEslint, | ||
jest, | ||
}, | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
...jest.environments.globals.globals, | ||
}, | ||
|
||
parser: tsParser, | ||
ecmaVersion: 2020, | ||
sourceType: "module", | ||
}, | ||
|
||
rules: {}, | ||
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { defaults } from 'jest-config' | ||
|
||
// @type {import('jest-config').InitialOptions} | ||
const config = { | ||
rootDir: './', | ||
moduleFileExtensions: [...defaults.moduleFileExtensions, 'mts'], | ||
collectCoverage: false, | ||
collectCoverageFrom: [ | ||
'packages/**/src/**/*.ts', | ||
'!**/examples/**', | ||
'!packages/cli/**', | ||
'!**/types/**', | ||
'!**/build/**', | ||
'!**/node_modules/**', | ||
'!packages/test-react-app/**', | ||
'!packages/test-utils/**', | ||
], | ||
coverageReporters: ['json'], | ||
coverageDirectory: './coverage', | ||
coverageProvider: 'v8', | ||
testMatch: ['**/__tests__/**/*.test.ts'], | ||
automock: false, | ||
// // typescript 5 removes the need to specify relative imports as .js, so we should no longer need this workaround | ||
// // but webpack still requires .js specifiers, so we are keeping it for now | ||
moduleNameMapper: { | ||
'^(\\.{1,2}/.*)\\.js$': '$1', | ||
}, | ||
transform: { | ||
'^.+\\.m?tsx?$': [ | ||
'ts-jest', | ||
{ | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
extensionsToTreatAsEsm: ['.ts'], | ||
testEnvironment: 'node', | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.