Commit Graph

15 Commits

Author SHA1 Message Date
Ben McCann
ffbdb48310 Upgrade dependencies (incl. ESLint 4) (#4738) 2017-11-01 16:00:10 +01:00
Simon Brunel
9ef5cc72f6 Enforce variable declaration coding style (#4610)
For consistency, enable ESLint `one-var` rule to require multiple variable declarations for initialized variables per scope. Uninitialized variables can still be declared together (preferred) or separately.

http://eslint.org/docs/rules/one-var
2017-08-03 18:33:18 +02:00
Simon Brunel
4c763bff44 Enforce spaces around infix/unary words operators (#4547)
Enable ESLint `space-infix-ops` and `space-unary-ops` (for words only) rules. Also added `samples` to the linting task to match Code Climate expectations.

http://eslint.org/docs/rules/space-infix-ops
http://eslint.org/docs/rules/space-unary-ops
2017-07-22 14:13:09 +02:00
Simon Brunel
ecca3373b2 Increase ESLint complexity and add config for tests (#4421)
Raise the cyclomatic complexity to 10 which seems to better match the project coding style and still reasonable (6 being quite low). Also move unit tests specific eslint rules in the cascaded `./test/.eslintrc` file (previously in `gulp.js`).
2017-07-01 09:55:11 +02:00
Simon Brunel
5c5b1bfe59 Turn off linebreak-style linting rule
On Windows, this rule conflicts when running ESLint locally on a repository setup with autoCrlf (then all lines are errors).
2016-09-15 23:10:03 +02:00
Zach Panzarino
8207027743 Implement eslint changes proposed by @simonbrunel in code review 2016-09-15 12:49:11 +00:00
Zach Panzarino
8bc280e185 Allow variable use before define with warning 2016-09-15 00:27:29 +00:00
Zach Panzarino
dd8fa78b45 Fix more style errors in controllers, elements, and scales 2016-09-14 22:34:41 +00:00
Zach Panzarino
9bf2e2bf7a Remove func-call-spacing rule 2016-09-14 18:16:21 +00:00
Zach Panzarino
11739234a4 Add keyword spacing to eslint and update code 2016-09-14 18:12:23 +00:00
Zach Panzarino
f6eb675470 Update new eslint rules 2016-09-14 18:03:55 +00:00
Simon Brunel
7c93255b16 Enforce curly braces for single statement block
curly: [error, all] (http://eslint.org/docs/rules/curly)
2016-09-03 18:42:28 +02:00
Simon Brunel
3d40774c7d Enforce consistent tab indentation
indent: [error, tab] (http://eslint.org/docs/rules/indent)
2016-09-03 18:42:26 +02:00
Simon Brunel
69ab0d3e23 Use gulp-eslint instead of gulp-jshint
Change the linter in gulp tasks to be consistent with Code Climate results which are based on ESLint using .eslintrc options. However, defaults Code Climate rules are too strict, so turn as warnings the 'complexity' and 'max-statements' rules (other errors has been fixed). Note that the Gulp task name has been changed for `gulp lint`.
2016-09-03 18:42:22 +02:00
Evert Timberg
d4917afba9 Update git ignore to make it easier to switch between branches. Add code climate config here as well. 2016-02-14 15:15:17 -05:00