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

Upgrade to @definitelytyped/dtslint #2739

Closed
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ff3cb16
Change `Global` component to use the `StyleSheet` constructor of the …
Jack-Works Mar 10, 2022
7f8910a
Removed the direct dependency on from as it's no longer used that way
Andarist Mar 10, 2022
239f2d0
Version Packages (#2679)
github-actions[bot] Mar 10, 2022
2d3d7dd
Fixed `CacheProvider` demo in the docs (#2678)
pengx17 Mar 10, 2022
1a25293
Added `includeStyles` option to `createSerializer` to optionally disa…
thompsongl Apr 5, 2022
d935762
Fixed a false positive warning for `content` properties that included…
arturmuller Apr 5, 2022
8c1c7c7
Fixed a Prettier error
Andarist Apr 5, 2022
fc52bed
Update snapshots after renaming a test (#2711)
Andarist Apr 6, 2022
7a478fc
Version Packages (#2710)
github-actions[bot] Apr 6, 2022
3743483
Fixed an issue with `createEnzymeSerializer` not handling the recentl…
thompsongl Apr 7, 2022
6c9dbe5
Version Packages (#2716)
github-actions[bot] Apr 7, 2022
cd535bf
Update to new DocSearch index (#2718)
emmatown Apr 9, 2022
ae0f650
Fixed an issue in the minifying logic that could remove rules with th…
Andarist Apr 10, 2022
888377a
Version Packages (#2722)
github-actions[bot] Apr 10, 2022
409b237
Replace CodeSandbox link in bug report issue template (#2726)
srmagura Apr 16, 2022
6c652d9
Fix TS 4.7 error related to isPropValid
srmagura Apr 24, 2022
b575ef7
Merge branch 'main' of https://github.com/emotion-js/emotion into ts-…
srmagura Apr 24, 2022
69b3e06
Merge branch 'ts-april-23' into ts-merge
srmagura Apr 24, 2022
6bf9be3
Remove accidentally-committed .d.ts files
srmagura Apr 24, 2022
b9640a5
Fix unintentional breaking change to @emotion/memoize
srmagura Apr 24, 2022
f187b1d
Reorder function overloads in packages/memoize/src/index.ts
srmagura Apr 24, 2022
ba5f146
Make snapshots more readable (#2733)
SimenB Apr 25, 2022
7a3f608
Merge branch 'main' of https://github.com/emotion-js/emotion into ts-…
srmagura Apr 28, 2022
24e4cc3
Upgrade to @definitelytyped/dtslint
srmagura Apr 28, 2022
9cd10e8
Cleanup dtslint-related infrastructure
srmagura Apr 28, 2022
3a5af86
Fix dtslint errors
srmagura Apr 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 2 additions & 21 deletions .github/workflows/main.yml
Expand Up @@ -176,27 +176,8 @@ jobs:
run: yarn lint:check

dtslint:
name: DTSLint
name: dtslint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- cache
- css
- hash
- is-prop-valid
- jest
- memoize
- native
- react
- serialize
- server
- sheet
- styled
- utils
- weak-memoize

steps:
- uses: actions/checkout@main

Expand All @@ -222,5 +203,5 @@ jobs:
- name: Install Dependencies
run: yarn

- name: TypeScript
- name: dtslint
run: cd packages/${{ matrix.package }} && yarn test:typescript
4 changes: 0 additions & 4 deletions package.json
Expand Up @@ -125,9 +125,6 @@
"site",
"scripts/*",
"playgrounds/*"
],
"nohoist": [
"**/dtslint"
]
},
"preconstruct": {
Expand Down Expand Up @@ -212,7 +209,6 @@
"bundlesize": "^0.13.2",
"codecov": "^2.3.1",
"cssjanus": "^1.2.0",
"dtslint": "^4.2.1",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
"enzyme-to-json": "^3.6.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/cache/package.json
Expand Up @@ -22,8 +22,8 @@
"stylis": "4.0.13"
},
"devDependencies": {
"@definitelytyped/dtslint": "0.0.112",
"@emotion/hash": "*",
"dtslint": "^4.2.1",
"typescript": "^4.5.5"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cache/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"semicolon": false
Expand Down
2 changes: 1 addition & 1 deletion packages/css/package.json
Expand Up @@ -33,7 +33,7 @@
},
"devDependencies": {
"@babel/core": "^7.13.10",
"dtslint": "^4.2.1",
"@definitelytyped/dtslint": "0.0.112",
"typescript": "^4.5.5"
},
"author": "Kye Hohenberger",
Expand Down
2 changes: 1 addition & 1 deletion packages/css/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"import-spacing": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/hash/package.json
Expand Up @@ -18,7 +18,7 @@
"test:typescript": "dtslint types"
},
"devDependencies": {
"dtslint": "^4.2.1",
"@definitelytyped/dtslint": "0.0.112",
"typescript": "^4.5.5"
},
"browser": {
Expand Down
2 changes: 1 addition & 1 deletion packages/hash/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"import-spacing": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/is-prop-valid/package.json
Expand Up @@ -17,7 +17,7 @@
"@emotion/memoize": "^0.7.4"
},
"devDependencies": {
"dtslint": "^4.2.1",
"@definitelytyped/dtslint": "0.0.112",
"typescript": "^4.5.5"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/is-prop-valid/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"import-spacing": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/jest/package.json
Expand Up @@ -36,10 +36,10 @@
}
},
"devDependencies": {
"@definitelytyped/dtslint": "0.0.112",
"@emotion/css": "11.9.0",
"@emotion/react": "11.9.0",
"@types/jest": "^27.0.3",
"dtslint": "^4.2.1",
"enzyme-to-json": "^3.6.1",
"preact": "^8.2.9",
"preact-render-to-json": "^3.6.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"semicolon": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/memoize/package.json
Expand Up @@ -14,7 +14,7 @@
"access": "public"
},
"devDependencies": {
"dtslint": "^4.2.1",
"@definitelytyped/dtslint": "0.0.112",
"typescript": "^4.5.5"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/memoize/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"import-spacing": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/native/package.json
Expand Up @@ -16,8 +16,8 @@
"types": "types/index.d.ts",
"devDependencies": {
"@babel/core": "^7.13.10",
"@definitelytyped/dtslint": "0.0.112",
"@types/react-native": "^0.63.2",
"dtslint": "^4.2.1",
"react": "16.14.0",
"react-native": "^0.63.2",
"typescript": "^4.5.5"
Expand Down
2 changes: 1 addition & 1 deletion packages/native/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"callable-types": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Expand Up @@ -48,12 +48,12 @@
},
"devDependencies": {
"@babel/core": "^7.13.10",
"@definitelytyped/dtslint": "0.0.112",
"@emotion/css": "11.9.0",
"@emotion/css-prettifier": "1.0.1",
"@emotion/server": "11.4.0",
"@emotion/styled": "11.8.1",
"@types/react": "^16.9.11",
"dtslint": "^4.2.1",
"html-tag-names": "^1.1.2",
"react": "16.14.0",
"svg-tag-names": "^1.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"callable-types": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/serialize/package.json
Expand Up @@ -21,7 +21,7 @@
"csstype": "^3.0.2"
},
"devDependencies": {
"dtslint": "^4.2.1",
"@definitelytyped/dtslint": "0.0.112",
"typescript": "^4.5.5"
},
"files": [
Expand Down
2 changes: 2 additions & 0 deletions packages/serialize/src/index.ts
Expand Up @@ -6,6 +6,8 @@ import * as CSS from 'csstype'

export type { RegisteredCache, SerializedStyles }

declare const process: { env: { NODE_ENV: string } }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this was creating an issue (I mean - during what task etc). I believe that I was fixing similar (but maybe different) problem by adding this to the files seen by dtslint:

/// <reference types="node" />

Like here:

/// <reference types="node" />

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure referencing all of the node types is the best solution? Because in the browser, we don't have access to Node stuff, except process.env.NODE_ENV which I believe is set by the bundler e.g. Webpack.


type Cursor = {
name: string
styles: string
Expand Down
2 changes: 1 addition & 1 deletion packages/serialize/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"semicolon": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Expand Up @@ -28,11 +28,11 @@
}
},
"devDependencies": {
"@definitelytyped/dtslint": "0.0.112",
"@emotion/babel-plugin": "11.9.2",
"@emotion/css": "11.9.0",
"@emotion/css-prettifier": "1.0.1",
"@types/node": "^10.11.4",
"dtslint": "^4.2.1",
"typescript": "^4.5.5"
},
"author": "Kye Hohenberger",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/types/tsconfig.json
Expand Up @@ -3,7 +3,7 @@
"baseUrl": "../",
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"lib": ["es6"],
"lib": ["es6", "dom"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: why do we need to a DOM lib to @emotion/server here? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my 2nd bullet point in the original comment 😉

"module": "commonjs",
"noEmit": true,
"strict": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/server/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"semicolon": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/sheet/package.json
Expand Up @@ -22,7 +22,7 @@
"dist"
],
"devDependencies": {
"dtslint": "^4.2.1",
"@definitelytyped/dtslint": "0.0.112",
"typescript": "^4.5.5"
}
}
2 changes: 2 additions & 0 deletions packages/sheet/src/index.ts
Expand Up @@ -21,6 +21,8 @@ styleSheet.flush()

*/

declare const process: { env: { NODE_ENV: string } }

function sheetForTag(tag: HTMLStyleElement): CSSStyleSheet {
if (tag.sheet) {
return tag.sheet
Expand Down
2 changes: 1 addition & 1 deletion packages/sheet/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"semicolon": false
Expand Down
2 changes: 1 addition & 1 deletion packages/styled/package.json
Expand Up @@ -32,8 +32,8 @@
},
"devDependencies": {
"@babel/core": "^7.13.10",
"@definitelytyped/dtslint": "0.0.112",
"@emotion/react": "11.9.0",
"dtslint": "^4.2.1",
"react": "16.14.0",
"typescript": "^4.5.5"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/styled/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"file-name-casing": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Expand Up @@ -22,7 +22,7 @@
"dist"
],
"devDependencies": {
"dtslint": "^4.2.1",
"@definitelytyped/dtslint": "0.0.112",
"typescript": "^4.5.5"
}
}
2 changes: 1 addition & 1 deletion packages/utils/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"semicolon": false
Expand Down
2 changes: 1 addition & 1 deletion packages/weak-memoize/package.json
Expand Up @@ -14,7 +14,7 @@
"access": "public"
},
"devDependencies": {
"dtslint": "^4.2.1",
"@definitelytyped/dtslint": "0.0.112",
"typescript": "^4.5.5"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/weak-memoize/types/tslint.json
@@ -1,5 +1,5 @@
{
"extends": "dtslint/dtslint.json",
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"import-spacing": false,
Expand Down