Import loader create invalid variable name based off package name
See original GitHub issueTry importing jquery-migrate into a legacy jquery plugin, and you will get a compile error:
/node_modules/imports-loader/index.js?jQuery=jquery,this=>window,"jquery-igrate"!...node_modules/vh.jquery.ba-bbq/jquery.ba-bbq.js Unexpected token (4:4) You may need an appropriate loader to handle this file type. | var jQuery = require("jquery"); | (function() { | var "jquery-migrate" = require("\"jquery-migrate\""); | | /*!
My workaround is to create an alias but it would be nice if the import loader replaced invalid variable name characters with underscores or something.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:26 (15 by maintainers)
Top Results From Across the Web
Solved: Variable Naming Error when importing data sets
You have CSV file. If you have the VALIDVARNAME option set to V7 then PROC IMPORT will generate valid SAS names from the...
Read more >5. The import system — Python 3.11.1 documentation
When a regular package is imported, this __init__.py file is implicitly executed, and the objects it defines are bound to names in the...
Read more >Python import: Advanced Techniques and Tips
In this tutorial, you'll learn how to: Use modules, packages, and namespace packages; Handle resources and data files inside your packages; Import modules ......
Read more >invalid-name / C0103 - Pylint 2.16.0-dev documentation
Description: Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...). Additional details:
Read more >How do I convert a string to a valid variable name in Python?
You can use the built in func: str.isidentifier() in combination with filter() . This requires no imports such as re and works by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s fine. 👍
This discussion is going in the wrong direction. imports-loader is for injecting values in this module’s scope, not put things in global just because you can’t find a local name.