Find all unused Javascript and CSS files in my application - javascript

Is there a way to find unused javascript files ? As I am working on very big and old application and many people have worked on this application and recently we have made it responsive and added bootstrap as well, all others have added Javascript and css files as per their convenience. But now I want to minimize these files and keep only required files in my system.
Kindly suggest any tool to find unused files.

Developer tools in your browser. For example Chrome: Developer tools -> Network

Related

Is there a Prettier equivalent for Visual Studio 2017? (Or a way to set up something similar)

I recently started a job at a company who's product is built in ASP.Net. In the past I've used the Prettier extension in VS Code with my teams to keep everyone's styles uniform. I've searched for some similar extension in the VS MarketPlace but I can't find anything remotely close.
I know I can set up an editor config file but it doesn't cover nearly the same level of options as having a shared lint file that everyone uses. I know I can change the text editor options under tools but that only updates my settings.
What I really want is to be able to have a few global lint/config files in the solution that will apply styles to a file on save so everyone's formatting is consistent. If anyone has experience setting up something similar your thoughts/experience would be tremendously helpful. Thanks!
Yes! You can. It only works for JS, but you can find the installation instructions here.
(Taken from official docs)
For support with other languages, you can use this extension.

Visual Studio Code Sencha Ext JS Extension Issue

I'm learning Ext JS so I installed the Sencha.vscode-extjs extension v1.0.1 in my Visual Studio Code (which is new as well, just downloaded today). I want this plugin because I saw where you can put your cursor on something like a controller and do Control+MouseClick and it will open that file. Very handy when dealing with large Ext Js apps. But I can't seem to get that feature to work. I keep seeing No definition found for 'main'...
I have verified that the extension did finish indexing everything by looking at the vscode-extjs.log file. It did take a very long time to index because I also have all the example Ext Js apps. Any idea what I'm missing? Thanks!
UPDATE: The controller is in the same folder, see image...
I think I finally figured it out. I can now Ctrl+Hover over extend, controller, requires, etc... and it will show a popup of its definition and when I Ctrl+MouseClick (or press F12) it opens that file. What I did to make it work was I opened just a single Ext JS app folder then waited for the plugin to index everything. That's it. Before, I had my entire "Projects" directory open in Visual Studio Code which contained about 8 sub folders all of which were Ext JS apps. So maybe there were naming conflicts between the different apps or maybe this plugin just wasn't intended to work with multiple apps at once.

Eclipse Neon Content Assist has no proposals for JavaScript

Bottom Line Up Front: Eclipse Neon content assist (Ctrl+space) does not offer any proposals for my JavaScript code.
Here is what I've checked so far:
JSDT has been installed
"JavaScript resources" include ECMASciptBuilt-In Library, ECMA 3 Browser Support Library, jQuery
The project's Include path has ECMAScipt Built-In Library, ECMA 3 Browser Support Library, jQuery, and JavaScript Web Project support
Eclipse's JavaScript Content Assist is enabled and includes Basic proposals, Other JavaScript Proposals, Template Proposals, and word proposals.
I changed the content assist from ctrl+space to ctrl+0 to check whether ctrl+space had been hijacked
Content assist DOES work with regular Java (in a different project)
I tried reset to defaults under Content Assist > Advanced
JavaScript facet is selected for the project
.js files and .jsp files are stored in folders that are under folders that are designated as source folders in the project properties under JavaScript > Include Path
This is also an issue in Mars 2.
I've run through the steps listed here for configuring content assist: http://www.eclipse.org/pdt/help/html/using_javascript_content_assist.htm
The content assist isn't even proposing functions that are defined within the same .js file. How can I get Eclipse's content assist to propose elements correctly?
I have the same problem and it seems to be a known bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=504057
+1 not working in Eclipse Neon. As an alternative you may try Netbeans 8. Javascript is working good there. I don't know what happened to Eclipse but php and Js support is poor.
P.S. Just downloaded Eclipse Mars - can confirm that it's working fine.
I've met this situation before,and then I found that if the js file is in a "normal java project",then it won't come uip with content assist,but if the js file is in a "dynamic web project",then the content assist just work well,hope it will help.

How the hell does Google Chrome know what/where my sources are and how to interpret them?

I'm currently playing around with Haxe to create a simple little web framework. Everything but the front-end framework (Yahoo Pure) is being written from scratch using a combination of Haxe/HTML/CSS. I'm writing it in FlashDevelop, using USBWebServer, and a couple of custom build/deploy scripts to copy the output JS to the UsbWebserver host directory, and to launch Google Chrome and point it at http://localhost/myserver/whatever.
For all intents and purposes, my development environment is a jumbled up mess of scripts and files in a bunch of different directories. The output directory on the server has absolutely zero Haxe code, just the generated javascript and PHP files that came out of the Haxe compiler.
Yet somehow, by some black magic, the Google Chrome developer tools (opened with F12) have a "Sources" tab which
Correctly points to my Haxe source files in the write directory
Displays the sources with simple syntax highlighting
Allows me to add breakpoints in the haxe code itself
AND lets me see the value of variables (included objects) by highlighting them with my mouse when a breakpoint is reached (like you'd see in Visual Studio or other fancy IDEs)
So how the hell can Google Chrome do this? My "launch script" is just this:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "http://localhost:8080/mysite"
That might explain how it finds my source directory, because that script is run from there. That doesn't explain how Google Chrome understands Haxe, or knows how to match the generated javascript code with the source Haxe code on a line-by-line basis.
I don't have any Haxe plugins installed. The only development-related plugins I have are Advanced REST client, and Javascript Errors Notifier (which just adds a little visual indicator when there's a javascript error)
This all seems like (extremely useful) black magic.
I've never used Haxe, but I would assume that it's just spitting out regular Source Maps (maps source variables/lines to compiled), which are interpreted by all major browsers. To learn more about it, I suggest this article: html5rocks.com/en/tutorials/developertools/sourcemaps

Eclipse PDT - Javascript Code Assist is not work?

I thought PDT would do code assisting on JS files. Was I wrong, or is there a bug or something I am missing?
Is the Javascript development tools installed? I'm not sure, whether its installed together with the PHP Development Tools.
Select Help/Install new software, then select the Helios update site (http://download.eclipse.org/releases/helios), then install the Javascript Development Tools from the Web, XML and Java EE category.
Update: See the answer at your other question.
Got here because I had the same problem, first install "Eclipse web developer tools => javascript development tools"
Then instead of creating a javascript project create a "static web project". Right click the project in project explorer choose configure (in the bottom) make sure you add javascript support (if it's not there than it's probably already supported).
Under your project in project explorer there should be an item called javascript resources right click that and choose properties. If the browser libraries or ecma3 libraries are not there you can add them.

Categories