Run if test -f .prettierrc.cjs; then
yarn run v1.22.22
$ /home/runner/work/discourse-multi-rating/discourse-multi-rating/node_modules/.bin/eslint --ext .js,.gjs,.js.es6 --no-error-on-unmatched-pattern test/javascripts assets/javascripts admin/assets/javascripts
Invalid option '--ext' - perhaps you meant '-c'?
You're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 2.
I don’t see --ext in my source tree, so maybe it’s in @discourse/lint-configs/eslint")? I don’t know where to find that.
I can’t see what I’m doing wrong or how this isn’t affecting a whole bunch of plugins.
I’ve seen this error on my own plugin. I figured out it was because I tried to update the eslint config file from .eslintrc.cjs to the latest flat config format eslint.config.js via the eslint migration. eslint.config.js doesn’t support the --ext (Command Line Interface Reference - ESLint - Pluggable JavaScript Linter), so changing the file to the older .eslintrc.cjs should fix it.
OMG. I’d just managed to fix it in some way that was completely impossible to reproduce, so this is a lifesaver. And now I’ve added it to my magic file so this might work next time
if [[ "$ARG" == 'fix-eslint' ]]
then
cd ~/src/discourse-repos/discourse
yarn
for x in ~/plugins/*
do
yarn eslint --fix x
done
fi