-
Notifications
You must be signed in to change notification settings - Fork 234
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
Add typed-css-modules-webpack-plugin to support type checking #3192
Conversation
cd06422
to
478b243
Compare
@@ -1,5 +1,5 @@ | |||
.centered-modal-dialog { | |||
// TODO centering doesn't work on the patient view, disabling for now... | |||
// TODO centering does not work on the patient view, disabling for now... |
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.
parser doesn't like the '
character
import classNames from 'classnames'; | ||
|
||
const styles = styles_any as { |
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.
we don't need to manually add styles anymore
new TypedCssModulesPlugin({ | ||
globPattern: 'src/**/*.module.scss', | ||
}), |
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.
this does the magic
@@ -0,0 +1,3 @@ | |||
|
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.
The corresponding styling file is empty
@@ -335,7 +335,9 @@ export default class FixedHeaderTable<T> extends React.Component< | |||
{selectionOperation}{' '} | |||
<i | |||
className={ | |||
styles[selectionOperation.toLowerCase()] | |||
(styles as any)[ |
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.
Need to do as any when referencing with a variable string
//> div:nth-child(2) { | ||
// margin-top:0px !important; | ||
//} | ||
/*> div:nth-child(2) { |
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.
Parser doesn't like line comments
readonly "noGroupsMessage": string; | ||
readonly "survivalPlotHeader": string; | ||
readonly "survivalPlotHeaderContainer": string; | ||
readonly "survivalTypeOptions": string; |
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.
is this auto created or do we have to go in and add this every time we add a class?
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.
auto created, and works fine in the watch mode.
@@ -0,0 +1,3 @@ | |||
|
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.
empty file?
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.
yep, we have an empty style file :)
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.
Sorry, the empty one was the other file. Good catch!
Here the source scss doesn't really have any named references, it shouldn't be defined as a module but probably a regular scss.
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.
seems like we don't even import local.module.scss
anywhere, probably safe to remove it completely.
@@ -10,7 +10,8 @@ import { | |||
} from 'cbioportal-frontend-commons'; | |||
import SampleManager from '../SampleManager'; | |||
|
|||
import styles from './styles.module.scss'; | |||
// TODO styles.module.scss is empty! | |||
// import styles from './styles.module.scss'; |
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.
remove comments?
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.
yeah, eventually we should either remove those invalid usage or update them
@@ -194,7 +194,8 @@ export default class OQLTextArea extends React.Component< | |||
break; | |||
} | |||
this.geneQuery | |||
? classNames.push(styles.notEmpty) | |||
? // TODO no such style called `notEmpty` | |||
classNames.push(/* styles.notEmpty */ '') |
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.
get rid of this altogether then?
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.
most likely we will end up removing all the invalid references before merging the PR, but keeping them for now just in case someone wants to comment.
@@ -82,7 +84,7 @@ export default class Sift extends React.Component<ISiftProps, {}> { | |||
<td> | |||
<span | |||
className={ | |||
tooltipStyles[ | |||
(tooltipStyles as any)[ | |||
`sift-${this.props.siftPrediction}` |
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.
instead you could try tooltipStyles[`sift-$....` as keyof tooltipStyles`]
. Not sure if it would work but it might
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.
hmm, I'll give it a try
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.
this doesn't seem to work, leaving it as any
for now
@@ -43,7 +43,9 @@ export default class Sift extends React.Component<ISiftProps, {}> { | |||
<span | |||
className={classNames( | |||
annotationStyles['annotation-item-text'], | |||
tooltipStyles[`sift-${this.props.siftPrediction}`] | |||
(tooltipStyles as any)[ | |||
`sift-${this.props.siftPrediction}` |
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.
same thing here as below vvv
544a6d4
to
bbda3c8
Compare
bbda3c8
to
bf3c38f
Compare
@@ -16,6 +16,7 @@ | |||
*pegjs | |||
*.template | |||
*.ejs | |||
*module.scss.d.ts |
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.
ignore auto generated module typing files
dd91731
to
9eb7572
Compare
…s modules Signed-off-by: Onur Sumer <s.onur.sumer@gmail.com>
9eb7572
to
de8f1e8
Compare
Fix cBioPortal/cbioportal#7455
typed-css-mdoules-webpack-plugin
to auto generate typings for every scss module (files matching the pattern*.module.scss
)*.module.scss.d.ts
Checks