Skip to content

Turn on TypeScript linting and fix errors - #51346

Merged
sanchitmalhotra126 merged 5 commits into
stagingfrom
sanchit/ts-lint
Apr 14, 2023
Merged

Turn on TypeScript linting and fix errors#51346
sanchitmalhotra126 merged 5 commits into
stagingfrom
sanchit/ts-lint

Conversation

@sanchitmalhotra126

@sanchitmalhotra126 sanchitmalhotra126 commented Apr 14, 2023

Copy link
Copy Markdown
Contributor

Enable TS linting and fix outstanding violations (all in music lab). For now, we've disabled the no-var-requires rule, which would have flagged all uses of require() to include JS files. We can fix this by just adding 'allowJs': true to our tsconfig file, and change the requires to imports, but adding allowJs is currently causing some build errors. I've created a task to investigate those as a follow-up: https://codedotorg.atlassian.net/browse/SL-791.

Links

https://codedotorg.atlassian.net/browse/SL-763

Testing story

Tested locally; confirmed no linter errors appeared, and that the pre-commit hook correctly identified TS linter violations

@sanchitmalhotra126
sanchitmalhotra126 requested review from a team, breville and molly-moen April 14, 2023 14:06
Comment thread apps/package.json
"scripts": {
"lint": "yarn lint:scss && yarn lint:js",
"lint:js": "eslint --format ./.eslintCustomMessagesFormatter.js --ext .js,.jsx src test --resolve-plugins-relative-to .",
"lint:js": "eslint --format ./.eslintCustomMessagesFormatter.js --ext .js,.jsx,.ts,.tsx src test --resolve-plugins-relative-to .",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🎉

@sanchitmalhotra126
sanchitmalhotra126 merged commit 8e427fd into staging Apr 14, 2023
@sanchitmalhotra126
sanchitmalhotra126 deleted the sanchit/ts-lint branch April 14, 2023 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants