ES6 Support, JSHint Upgrade, PHP Fixes, and More...
Our JavaScript and PHP analysis just got better. Today we’re excited to announce some significant updates, which enable us to handle more types of code and provide deeper analysis for these languages.
ES6 Support
We now support ECMAScript 6 syntax, such as named/default exports/imports, and more.
While ES6 is not yet widely used in client-side applications, it is increasingly important for server-side applications. As such, we’re excited to now support it.
JSHint Upgrade
Our JavaScript linting analysis is implemented via JSHint, which we’ve now upgraded from version 2.1.10 to 2.5.8. As a result, we now support significantly more JSHint options (like freeze
and nonbsp
to name a couple). By adding these options to a .jshintrc file (within any folder of your repository), you can customize the types of linting and style issues that we’ll flag.
As an added bonus: We also now support inline JSHint configuration, allowing you to customize our linting analysis without the need for a .jshintrc
file. For example, you can now add the following directly to your source: /* jshint undef: true, unused: true */
Other Changes
- PHP Improvements: We’ve implemented a series of updates and changes to our PHP parser, which improve the analysis and resolves some known parsing issues. Specifically, we’ve leveled up our parser’s ability to handle very complex PHP code and we’ve improved our ability to identify which issues have changed between commits. As a result, some PHP grades and GPAs may change to be more accurate and you should also see better and deeper PHP analysis.
- JavaScript LOC Counts: We’ve modified our line counting algorithm to exclude JavaScript comments from the number of lines. While this won’t affect the number or kinds of issues we identify, your ratings and GPA may adjust based on the new number of lines now reported for your files.
- JavaScript Shebangs: Previously, Code Climate would ignore executable JavaScript files that began with
#!
(which are often found in nodejs apps). We’ve now added support for these files.
All of these changes are in the process of rolling out, and we expect all repositories to be updated by week’s end.
As always, if you have any feedback, or run into any issues, let us know.