-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[No QA][TS migration] Adjust ESLint and TS configs #40778
Merged
roryabraham
merged 33 commits into
Expensify:main
from
software-mansion-labs:ts/eslint-typescript-config
May 14, 2024
Merged
Changes from 30 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
51f2ed3
Update .github eslint config
blazejkustra 422e872
Update tests eslint config
blazejkustra 8d61837
Create workflow tests eslint config
blazejkustra df3e91c
Remove overrides for workflow tests
blazejkustra bce33e4
Remove overrides for tests
blazejkustra b65414b
Move no-restricted-imports to common ruleset
blazejkustra 0748762
fix no-restricted-imports, put it in the right section
blazejkustra 2d214d7
Remove ignorePatterns from eslint config and update eslintignore
blazejkustra 6e8a2be
Fix android build ignore line
blazejkustra c5a1f72
Clean up eslint config
blazejkustra 25b2935
Add temporary config for js files
blazejkustra af17bf5
Ignore config files and docs/assets
blazejkustra b6f605d
Ignore other js eslint errors
blazejkustra 57d2950
Clean up tsconfig
blazejkustra 56395cd
Fix imports inside eslint config
blazejkustra 76b1780
Add missing endline
blazejkustra a06de12
Build GH actions
blazejkustra 85ff452
Add gtm.js to eslintignore
blazejkustra b47c28b
Add comments with explanation about last JS components
blazejkustra 88a1e5b
Merge branch 'main' into ts/eslint-typescript-config
blazejkustra d5083d2
Merge branch 'main' into ts/eslint-typescript-config
blazejkustra a37b660
Merge branch 'main' into ts/eslint-typescript-config
blazejkustra 4c00bca
Merge branch 'main' into ts/eslint-typescript-config
blazejkustra 7e7be1d
Add testing-library rules that were removed in the last merge
blazejkustra 9cdbda3
Rerun GH workflows
blazejkustra 5f36384
Add empty lien to eslintignore
blazejkustra 84117ae
Merge branch 'main' into ts/eslint-typescript-config
blazejkustra 2cb2c5f
Bring back module: commonjs in tsconfig
blazejkustra 3468278
Merge branch 'main' into ts/eslint-typescript-config
blazejkustra ccfd44b
Fix failing workflow
blazejkustra 5ebca88
Merge branch 'main' into ts/eslint-typescript-config
blazejkustra 7f6763c
Adjust ESLint configuration
blazejkustra 6f2f703
Merge branch 'main' into ts/eslint-typescript-config
blazejkustra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
**/node_modules/* | ||
**/dist/* | ||
android/**/build/* | ||
.github/actions/**/index.js" | ||
.* | ||
*.config.js | ||
**/node_modules/** | ||
**/dist/** | ||
android/**/build/** | ||
.github/actions/**/index.js | ||
docs/vendor/** | ||
docs/assets/** | ||
web/gtm.js |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
// For all these Node.js scripts, we do not want to disable `console` statements | ||
module.exports = { | ||
rules: { | ||
// For all these Node.js scripts, we do not want to disable `console` statements | ||
'no-console': 'off', | ||
|
||
'@lwc/lwc/no-async-await': 'off', | ||
'no-await-in-loop': 'off', | ||
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/pages/iou/request/MoneyTemporaryForRefactorRequestParticipantsSelector.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
module.exports = { | ||
extends: ['plugin:testing-library/react'], | ||
rules: { | ||
'no-import-assign': 'off', | ||
'@lwc/lwc/no-async-await': 'off', | ||
'no-await-in-loop': 'off', | ||
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'], | ||
|
||
// This helps disable the `prefer-alias` rule for tests | ||
'@dword-design/import-alias/prefer-alias': ['off'], | ||
|
||
'testing-library/await-async-queries': 'error', | ||
'testing-library/await-async-utils': 'error', | ||
'testing-library/no-debugging-utils': 'error', | ||
'testing-library/no-manual-cleanup': 'error', | ||
'testing-library/no-unnecessary-act': 'error', | ||
'testing-library/prefer-find-by': 'error', | ||
'testing-library/prefer-presence-queries': 'error', | ||
'testing-library/prefer-screen-queries': 'error', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blazejkustra marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
rules: { | ||
'@lwc/lwc/no-async-await': 'off', | ||
'no-await-in-loop': 'off', | ||
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
question: does this line ignore anything that starts with
.
? If yes, great change! I was going to ask that we ignore.bundle
and.expo
too but it seems like that's covered.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.
Yes! I thought it was clever but turns out here are two caveats:
.github
and.storybook
weren't linted (it's more complicated because we want to lint.github
but not.github/actions/**/index.js
).*
, instead I did this: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.
@parasharrajat I checked it myself but could you double check that correct directories are linted (.github, .storybook, src, web, desktop etc) and correct are omitted (.github/actions/**/index.js, configs, dist, .expo, .git)? Thank you!
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.
Sure.
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.
It looks good to me.
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.
Some files are still showing errors via ts compiler though the EsLint is not triggered.