Qeole / colorediffs

Thunderbird extension to colorize code diffs in messages.
Mozilla Public License 2.0
25 stars 5 forks source link

ESLint issue when building #111

Closed laggarcia closed 2 years ago

laggarcia commented 2 years ago

When building the add-on using make, I am getting an ESLint issue:

npx eslint  scripts options

Oops! Something went wrong! :(

ESLint: 8.10.0

ESLint couldn't find the config "standard" to extend from. Please check that the name of the config is correct.

The config "standard" was referenced from the config file in "/home/laggarcia/src/git/colorediffs/.eslintrc.json".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

make: *** [Makefile:71: eslint] Error 2

I was able to work around the issue by generating a package.json file with:

npm init

Then:

npx eslint --init

After that, the build process was able to pass this issue.

Just as a side note, using make xpi I can bundle the add-on without facing issues as the checks made in the full build are not executed.

Qeole commented 2 years ago

Yeah, make xpi just packages the add-on and runs no other check (it's just a zip command really, although it may download highlight.js as a dependency).

I was pretty sure I documented the workflow for the ESLint action. Found it, it's all here... In this commit log :) As you probably realised by now, I wrote this Makefile mostly for myself (the README just mentions make xpi). But agreed, it wouldn't hurt to either document this in the Makefile, or add some step to check if the packages are installed (and maybe prompt to install otherwise?).

laggarcia commented 2 years ago

Ah! Great! The instructions in the commit log are good! :joy: .

laggarcia commented 2 years ago

So, I have tried this few more times, and now I can say for sure that the instructions in the commit log are almost good.

If I follow the instructions there:

To run the linter, install ESLint and the "standard" package:

    $ npm install eslint --save-dev
    $ npm install standard --save-dev

And run the linter:

    $ npx eslint scripts options popup

I will get:

npx eslint  scripts options

Oops! Something went wrong! :(

ESLint: 8.11.0

ESLint couldn't find the config "standard" to extend from. Please check that the name of the config is correct.

The config "standard" was referenced from the config file in "/home/laggarcia/src/git/colorediffs/.eslintrc.json".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

I had to recreate the eslint file by running npx eslint --init in order to make things work.

IOW, it seems the .eslintrc.json file in the project is outdated.

laggarcia commented 2 years ago

Never mind... I am not seeing this issue anymore... :thinking: