summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-10-26 16:31:08 +0000
committerFatih Acet <acetfatih@gmail.com>2016-10-26 16:31:08 +0000
commitdd5e46ab693910f41333109bc8dfd5488121b440 (patch)
treef5f9fb333696a09c78f915a02a1d5dd1ca09c312 /lib
parent5a4dabd0c9a58fbfc9ed103fa82bf84433756d27 (diff)
parent02f94cf038b08d25bc1b414a32d16f988fb9268e (diff)
downloadgitlab-ce-dd5e46ab693910f41333109bc8dfd5488121b440.tar.gz
Merge branch 'eslint' into 'master'
Add ESLint ## What does this MR do? - create `package.json` - add ESLint dependencies to `package.json` - add JavaScript linting to CI - add Rake task `lint:javascript`as alias for `eslint` (which itself is an alias for `npm run eslint`) ## Are there points in the code the reviewer needs to double check? Probably not. ## Why was this MR needed? My hovercraft was full of eels. ## What are the relevant issue numbers? - https://gitlab.com/gitlab-org/gitlab-ce/issues/13224#note_12537431 - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5006#note_13255658 See merge request !5445
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/eslint.rake7
-rw-r--r--lib/tasks/lint.rake9
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/tasks/eslint.rake b/lib/tasks/eslint.rake
new file mode 100644
index 00000000000..d43cbad1909
--- /dev/null
+++ b/lib/tasks/eslint.rake
@@ -0,0 +1,7 @@
+unless Rails.env.production?
+ desc "GitLab | Run ESLint"
+ task :eslint do
+ system("npm", "run", "eslint")
+ end
+end
+
diff --git a/lib/tasks/lint.rake b/lib/tasks/lint.rake
new file mode 100644
index 00000000000..32b668df3bf
--- /dev/null
+++ b/lib/tasks/lint.rake
@@ -0,0 +1,9 @@
+unless Rails.env.production?
+ namespace :lint do
+ desc "GitLab | lint | Lint JavaScript files using ESLint"
+ task :javascript do
+ Rake::Task['eslint'].invoke
+ end
+ end
+end
+