-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[docs] Add Grid List TypeScript demos #15118
Conversation
No bundle size changes comparing 2c2075e...94cc041 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good! For tileData.ts
though, I would just add a tileData.d.ts
file and define the type that is exported by tileData.js
. That could look something like:
export interface TileDataItem {
img: string;
title: string;
author: string;
cols: number;
featured: boolean;
}
declare const tileData: TileDataItem[];
export default tileData;
That way you don't have to redefine the values of tileData!
I liked that idea, so I tried to do it. However, after adding the definition file, The question is: How do one solve this problem?
For now, I won't change it due to the linting error. |
|
I think that rule is there to prevent someone from adding a relative import to the component in the demo (ex: GridList), which wouldn’t be helpful to readers. I think the inline/duplication idea might be the best option |
We could get rid of the "describing comments" which describe the structure of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since they are not meant to be editable in codesandbox the relative import is fine.
However disabling the lint rule for a file would need a comment which is preserved during transpilation. Does the CLI pick up an additional tslint.json in this directory that disables this rule?
I would also agree that a tileData.d.ts
is sufficient. The tileData.ts
is never actually used.
The more demos we can run on codesandbox the better. But it does not always worth it. |
@eps1lon I pushed a version with |
@Dudrie Maybe try it with a |
This replaces the disabling comments in the `.tsx` files.
@eps1lon Done 😊 |
@Dudrie Much appreciated! Thanks. |
This are the typescript demos for the grid list components.