Travis tests failing due to eslint

I’ve got two plugins that are failing travis tests. It appears that I don’t have any es6 files in them and eslint feels left out?

Running linters/prettyfiers
eslint yarn run v1.22.5
$ /var/www/discourse/node_modules/.bin/eslint -v
v6.8.0
Done in 0.32s.
prettier yarn run v1.22.5
$ /var/www/discourse/node_modules/.bin/prettier -v
2.1.1
Done in 0.28s.
[2020-09-07 01:34:21] bundle exec rubocop --parallel plugins/discourse-allow-pm-to-staff
Inspecting 2 files
..
2 files inspected, no offenses detected
[2020-09-07 01:34:22] bundle exec ruby script/i18n_lint.rb plugins/discourse-allow-pm-to-staff/config/locales/{client,server}.en.yml
[2020-09-07 01:34:23] yarn eslint --global I18n --ext .es6 plugins/discourse-allow-pm-to-staff
yarn run v1.22.5
$ /var/www/discourse/node_modules/.bin/eslint --global I18n --ext .es6 plugins/discourse-allow-pm-to-staff
Oops! Something went wrong! :(
ESLint: 6.8.0.
No files matching the pattern "plugins/discourse-allow-pm-to-staff" were found.
Please check for typing mistakes in the pattern.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Listing prettier offenses in discourse-allow-pm-to-staff:

https://travis-ci.org/github/pfaffman/discourse-allow-pm-to-staff/jobs/724771255#L477

1 Like

Yes, eslint doesn’t like having nothing to do. This makes it feel more useful.

mkdir -p assets/javascripts/discourse
touch assets/javascripts/discourse/eslint.js.es6
git add assets/javascripts/discourse/eslint.js.es6
git commit -m 'try to make eslint not feel left out'
git push

Oh, but I think this is the real solution:

https://github.com/discourse/discourse/compare/master...pfaffman:patch-5

1 Like

Ah, but how are you going to PR that without eslint complaining? :wink:

1 Like

I understand so little of what’s going on here that I almost didn’t get your joke!

1 Like

Yes I pushed this fix for github actions the other day:

https://github.com/discourse/discourse/commit/110f6ec6dd16b154ad796a7de124148321240e40

So basically new eslint doesn’t like when it doesn’t match anything. I also took the opportunity to simplify the commands, will apply the same to our rake task no worries.

7 Likes

That should fix it:

https://github.com/discourse/discourse/commit/a60ba75ac29f748774a495dd60beb28291a2bcb9

Let me know how it goes :+1:

4 Likes
2 files inspected, no offenses detected
[2020-09-10 18:43:13] bundle exec ruby script/i18n_lint.rb plugins/discourse-topic-default-tag/config/locales/{client,server}.en.yml
[2020-09-10 18:43:13] yarn eslint --global I18n --ext .es6 plugins/discourse-topic-default-tag
yarn run v1.22.5
$ /var/www/discourse/node_modules/.bin/eslint --global I18n --ext .es6 plugins/discourse-topic-default-tag
Oops! Something went wrong! :(
ESLint: 6.8.0.
No files matching the pattern "plugins/discourse-topic-default-tag" were found.
Please check for typing mistakes in the pattern.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Listing prettier offenses in discourse-topic-default-tag:

Oops. My bad.

Oh right yes it’s using discourse-plugin-ci stuff, if you read at the code you will see:

https://github.com/discourse/discourse-plugin-ci/blob/master/script.sh#L17

And my commit is not yet in tests-passed

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.