<p><b>@gravitystorm</b> commented on this pull request.</p>
<p>Normally I would hesitate about removing a gem and doing it ourselves, but I don't see much activity in either of the gems mentioned so hey-ho.</p>
<p>I'm also totally in favour of yarn instead of npm, beyond it being the rails default.</p><hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2209#discussion_r292807958">lib/tasks/eslint.rake</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,27 @@
+task "eslint" => "eslint:check"
+
+namespace "eslint" do
+ def yarn_path
+ Rails.root.join("bin", "yarn").to_s
+ end
+
+ def config_file
+ Rails.root.join("config", "eslint.json").to_s
+ end
+
+ def js_files
+ require File.dirname(__FILE__) + "/../../config/environment"
</pre>
<p>Instead of manually requiring the environment, rake tasks can be marked as depending on the rails environment e.g.</p>
<p><code>task :check => :environment do</code></p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2209#discussion_r292808494">.travis.yml</a>:</p>
<pre style='color:#555'>> script:
- bundle exec rubocop -f fuubar
- - bundle exec rake eslint:run_all
+ - bundle exec rake eslint
</pre>
<p>We should add this to CONTRIBUTING.md in the Coding Style section. I mean, I expect a change like this to have a corresponding change to the documentation, but the documentation mentioning eslint is missing <g-emoji class="g-emoji" alias="smile" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f604.png">😄</g-emoji></p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2209?email_source=notifications&email_token=AAK2OLP3JCIL4JU37D6D4YLP2C22HA5CNFSM4HF3EKA2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB3I3LDA#pullrequestreview-248624524">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLKZO3I7DWAATMRDINLP2C22HANCNFSM4HF3EKAQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAK2OLKETA6RX2NI5WTPX6DP2C22HA5CNFSM4HF3EKA2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB3I3LDA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2209?email_source=notifications\u0026email_token=AAK2OLP3JCIL4JU37D6D4YLP2C22HA5CNFSM4HF3EKA2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB3I3LDA#pullrequestreview-248624524",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2209?email_source=notifications\u0026email_token=AAK2OLP3JCIL4JU37D6D4YLP2C22HA5CNFSM4HF3EKA2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB3I3LDA#pullrequestreview-248624524",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>