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

fix(types): bring types from less into namespace #19738

Merged
merged 3 commits into from Mar 16, 2023
Merged

Conversation

rchl
Copy link

@rchl rchl commented Mar 16, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The Less namespace is referenced in this file and the @types/less is one of the dependencies of @nuxt/types but less is not imported anywhere within the @nuxt/types package which causes the following error when running tsc in projects using @nuxt/types:

../../packages/types/config/build.d.ts:68:10 - error TS2503: Cannot find namespace 'Less'.

68   less?: Less.Options
            ~~~~

Projects can work around it by including less in types in tsconfig.json but they shouldn't need to.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox
Copy link

codesandbox bot commented Mar 16, 2023

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@rchl
Copy link
Author

rchl commented Mar 16, 2023

Note that import type Less from 'less' would trigger typescript hint about unused variable. That's why it's just an import for the sake of referencing it.

@danielroe danielroe changed the title fix(types): reference "less" types to fix "Cannot find namespace 'Less'" fix(types): bring types from less into namespace Mar 16, 2023
@danielroe danielroe merged commit 8e0aba0 into nuxt:2.x Mar 16, 2023
13 checks passed
@rchl rchl deleted the fix/less-type branch March 16, 2023 14:41
@wattanx wattanx mentioned this pull request Nov 4, 2023
8 tasks
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.

None yet

2 participants