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

feat: add no-unused eslint rule to find unused styles #767

Merged
merged 4 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/docs/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
// The Eslint rule still needs work, but you can
// enable it to test things out.
'@stylexjs/valid-styles': 'error',
// '@stylexjs/no-unused': 'warn',
Copy link
Member

Choose a reason for hiding this comment

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

do we want to use warn or error here?

Copy link
Contributor Author

@Samantha-Zhan Samantha-Zhan Nov 8, 2024

Choose a reason for hiding this comment

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

If we follow the behavior in internal codebase, then this should be error; i agree we should change it to error(will update this after figuring out the definition not found error, @nmn is helping investigating this)

Copy link
Contributor

Choose a reason for hiding this comment

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

I will enable this after this PR lands. There are some issues with dependencies where this doesn't always work consistently.

// 'ft-flow/space-after-type-colon': 0,
// 'ft-flow/no-types-missing-file-annotation': 0,
// 'ft-flow/generic-spacing': 0,
Expand Down
1 change: 1 addition & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
},
"devDependencies": {
"@babel/eslint-parser": "^7.25.8",
"@stylexjs/eslint-plugin": "0.8.0",
"@stylexjs/babel-plugin": "0.9.3",
"clean-css": "^5.3.2",
"eslint": "^8.57.1",
Expand Down
23 changes: 23 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading