Skip to content

Commit 61a908a

Browse files
committed
allow TS files to be compiled in src dir
1 parent bdc0634 commit 61a908a

File tree

4 files changed

+46
-10
lines changed

4 files changed

+46
-10
lines changed

eslint.config.mjs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default tseslint.config(
2121
{ languageOptions: { globals: globals.browser } },
2222
pluginJs.configs.recommended,
2323
importPlugin.flatConfigs.recommended,
24+
importPlugin.flatConfigs.typescript,
2425
...tseslint.configs.recommended,
2526

2627
{
@@ -48,14 +49,6 @@ export default tseslint.config(
4849
},
4950
},
5051

51-
{
52-
files: ['**/*.{ts,tsx}'],
53-
extends: [
54-
importPlugin.flatConfigs.recommended,
55-
importPlugin.flatConfigs.typescript,
56-
],
57-
},
58-
5952
{
6053
files: ['src/*'],
6154
rules: {

package-lock.json

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"lint:format": "prettier --check \"{__tests__,src,type-definitions,website/src,perf,resources}/**/*{.js,.mjs,.ts,.tsx,.flow,.css}\"",
6464
"lint:js": "eslint",
6565
"type-check": "run-s type-check:*",
66-
"type-check:ts": "tsc --project type-definitions/tsconfig.json && tsc --project __tests__/tsconfig.json",
66+
"type-check:ts": "tsc --project tsconfig.src.json && tsc --project type-definitions/tsconfig.json && tsc --project __tests__/tsconfig.json",
6767
"type-check:flow": "flow check type-definitions/flow-tests --include-warnings",
6868
"build": "run-s build:*",
6969
"build:clean": "rimraf dist",
@@ -87,6 +87,7 @@
8787
"@rollup/plugin-commonjs": "28.0.2",
8888
"@rollup/plugin-json": "6.1.0",
8989
"@rollup/plugin-terser": "^0.4.4",
90+
"@rollup/plugin-typescript": "^12.1.2",
9091
"@size-limit/esbuild-why": "^8.2.6",
9192
"@size-limit/preset-small-lib": "^8.2.6",
9293
"@types/jest": "^29.0.0",
@@ -121,6 +122,7 @@
121122
"rollup": "4.34.8",
122123
"size-limit": "^8.2.6",
123124
"transducers-js": "0.4.174",
125+
"tslib": "^2.8.1",
124126
"tstyche": "^3.5",
125127
"typescript": "5.7",
126128
"typescript-eslint": "^8.24.0"

resources/rollup-config.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import buble from '@rollup/plugin-buble';
33
import commonjs from '@rollup/plugin-commonjs';
44
import json from '@rollup/plugin-json';
55
import terser from '@rollup/plugin-terser';
6+
// TODO replace @rollup/plugin-typescript with babel after babel migration
7+
import typescript from '@rollup/plugin-typescript';
68
import copyright from './copyright.mjs';
79

810
const SRC_DIR = path.resolve('src');
@@ -11,7 +13,7 @@ const DIST_DIR = path.resolve('dist');
1113
export default [
1214
{
1315
input: path.join(SRC_DIR, 'Immutable.js'),
14-
plugins: [commonjs(), json(), buble()],
16+
plugins: [commonjs(), json(), typescript(), buble()],
1517
output: [
1618
// umd build
1719
{

0 commit comments

Comments
 (0)