Repository navigation
Conversation
The plugins entry sat outside compilerOptions in tsconfig.json, so TypeScript never loaded it, and ws-nextjs-app's own plugins list replaced it anyway. Move it into compilerOptions in both configs. The plugin resolves Sass imports through tsconfig paths, so map @scss to the directory the webpack alias points at. Editors now get typed class names for SCSS module imports.
Nothing imports from #cypress, and the root cypress directory it points at only holds untracked test output.
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves JIRA:
Summary
typescript-plugin-css-moduleswas installed but never loaded: its entry sat outsidecompilerOptionsintsconfig.json, and the Next.js tsconfig's ownpluginslist replaced it anyway. Once loaded, it also couldn't compile stylesheets that use@use '@scss/themeTokens', because@scssonly existed as a webpack alias. This PR enables the plugin in both projects, so editors get typed class names (autocomplete and typo errors) for SCSS module imports. It's editor-only:tscand the build ignore TypeScript plugins.Before and after
Given a typo in a class name in
AccountActionButtons:Before: hovering
stylesshows a loose index signature, sostyles.offers no suggestions and the typo goes unreported. At runtimeclassNameisundefinedand the icon loses its styles.After: hovering
stylesshows the stylesheet's real classes,styles.autocompletes them, and the typo is flagged in the editor.Code changes
compilerOptionsin the root tsconfig and add it alongsidenextinws-nextjs-app/tsconfig.json.@scss/*path mapping to both tsconfigs, matching the webpack alias, so the plugin can resolve theme token imports.#cypress/*alias, which pointed at a directory holding only untracked test output.Testing
.module.scssfile (e.g.src/app/components/Account/AccountActionButtons/index.tsx) and typestyles.: the stylesheet's class names should be suggested.ws-nextjs-app/pagescomponent (e.g.LiveElectionBanner).Useful Links