Skip to content

Commit fc74bee

Browse files
authored
Merge pull request #2555 from emotion-js/ts-migration
TS migration
2 parents 73f6881 + 1effaf9 commit fc74bee

File tree

274 files changed

+2251
-3538
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+2251
-3538
lines changed

.changeset/clever-clocks-yell.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/unitless': minor
3+
---
4+
5+
Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.

.changeset/eighty-spies-beam.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/css': minor
3+
---
4+
5+
Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.

.changeset/healthy-elephants-serve.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/serialize': minor
3+
---
4+
5+
Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.

.changeset/hip-moons-play.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/memoize': minor
3+
---
4+
5+
Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.

.changeset/hot-yaks-flow.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/is-prop-valid': minor
3+
---
4+
5+
Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.

.changeset/loud-hairs-approve.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/weak-memoize': minor
3+
---
4+
5+
Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.

.changeset/lovely-zebras-admire.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/eslint-plugin': patch
3+
---
4+
5+
An empty css prop (`<div css />`) will now raise an error in the `@emotion/syntax-preference` rule instead of crashing on this case.

.changeset/modern-penguins-play.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/eslint-plugin': minor
3+
---
4+
5+
Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.

.changeset/modern-tomatoes-work.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/css': patch
3+
---
4+
5+
Fixed `options` parameter to `createEmotion` from `@emotion/css/create-instance` incorrectly being marked as optional when it's required.

.changeset/neat-shoes-search.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@emotion/primitives-core': minor
3+
---
4+
5+
author: @srmagura
6+
pr: #2818
7+
commit: 8546dd0
8+
9+
Source code has been migrated to TypeScript so from now on type declarations will be available in the published package.

.changeset/old-years-breathe.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/utils': minor
3+
---
4+
5+
Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.

.changeset/sharp-trees-smell.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/eslint-plugin': patch
3+
---
4+
5+
Fixed a crash on empty css prop (`<div css />`) in the `@emotion/jsx-import` rule.

.changeset/stale-dogs-wink.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/hash': patch
3+
---
4+
5+
Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.

.changeset/thick-tips-join.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/sheet': minor
3+
---
4+
5+
Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.

.changeset/thirty-years-divide.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/sheet': patch
3+
---
4+
5+
Type declaration for `StyleSheet`'s constructor has been fixed. It incorrectly was specifying that `options` were optional when in reality they weren't.

.changeset/wet-boxes-raise.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/babel-plugin-jsx-pragmatic': minor
3+
---
4+
5+
Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.

.eslintignore

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,4 @@ coverage/
44
node_modules/
55
stylis.min.js
66
/demo/dist
7-
flow-typed/
8-
9-
# This is to prevent ESLint parsing errors in the website which is written in
10-
# TypeScript. TODO: Reenable once the codebase is converted to TypeScript.
11-
/site/
7+
/site/out

.flowconfig

-24
This file was deleted.

.flowconfig-ci

-25
This file was deleted.

.github/workflows/main.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- ts-migration
78
pull_request:
89

910
permissions:
@@ -30,15 +31,15 @@ jobs:
3031
uses: codecov/codecov-action@v1
3132
if: ${{ matrix.platform == 'ubuntu-latest' && always() }}
3233

33-
flow:
34-
name: Flow
34+
typescript:
35+
name: TypeScript
3536
runs-on: ubuntu-latest
3637
steps:
3738
- uses: actions/checkout@v3
3839
- uses: ./.github/actions/ci-setup
3940

4041
- name: Check Types
41-
run: yarn flow:check
42+
run: yarn tsc:all
4243

4344
test_react18:
4445
name: Test React 18
@@ -70,7 +71,7 @@ jobs:
7071
- name: ESLint
7172
run: yarn lint:check
7273

73-
typescript:
74+
dtslint:
7475
name: dtslint
7576
runs-on: ubuntu-latest
7677
steps:

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ package-lock.json
2121
!.yarn/versions
2222

2323
# Website
24-
site/out
25-
.next
24+
/site/out
25+
.next

.prettierrc.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ overrides:
66
- files: 'docs/*.md'
77
options:
88
printWidth: 60
9-
- files: '*.js'
10-
options:
11-
parser: flow

__mocks__/react-native.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @flow
21
/* eslint-env jest */
32

43
let components = [

__mocks__/react-primitives.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
// @flow
21
export * from 'react-primitives/lib/index.web'

babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let isTestFile = filename =>
1010
module.exports = api => {
1111
api.cache(true)
1212
return {
13-
presets: ['babel-preset-emotion-dev'],
13+
presets: ['babel-preset-emotion-dev', '@babel/preset-typescript'],
1414
overrides: [
1515
{
1616
test: filename =>

docs/docs.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
- source-maps
3333
- testing
3434
- typescript
35-
- flow
3635
- eslint-plugin-react
3736

3837
# This loads the READMEs instead of files in docs/

docs/flow.mdx

-115
This file was deleted.

flow-typed/npm/gatsby_vx.x.x.js

-20
This file was deleted.

0 commit comments

Comments
 (0)