-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESLint JSDoc rules removed #5
Comments
Thanks for the heads-up! So, sure feel free to raise a PR and migrate the existing rules. I looked whether there are some base configs we can use, but I've found no useful ones. However, what we should keep is the requirement for JSDoc, i.e. maybe migrate that to that |
Yeah, to replicate the existing If we are adding plugins, we should probably add Mozilla's eslint-plugin-no-unsanitized and eslint-plugin-mozilla plugins as well. The eslint-plugin-unicorn plugin might also be good (see bug 1539513).
If you set the Anyway, it may be good to setup GitHub Actions CI for each of your add-ons to run both ESLint and the TypeScript compiler, so that it can automatically check PRs (similar to rugk/unicodify#7). |
Yeah, that would be good… I just don't have much time currently for stuff, as you probably noticed, so contributors adding CI stuff or so, are always welcome. Maybe there is even a GitHub Action for that that does test everything. Also web-ext lint would propbably be a good addition: https://github.com/marketplace/actions/web-ext-lint
Ah was unaware/missed that this of course catches missing JSDoc comments, yeah I see. Otherwise I would have said yeah not too bad, let's not care about EsLint plugins. However… if we need them anyway…
Sure, totally agree, of course. |
I have not tested it, but something like this should do the trick (along with those changes to the jobs:
ESLint:
name: ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install
run: npm install -g eslint
- name: Script
run: eslint --report-unused-disable-directives .
continue-on-error: true
TSC:
name: TypeScript Compiler
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-node@v3
- name: Install
run: npm install -g typescript
- name: Script
run: tsc -p jsconfig.json --noEmit
continue-on-error: true Those
No, TypeScript is really all or nothing, as it wants to know the datatype for all variables. If you want some examples, just add those suggested keys to your |
I'm happy for any PR for any simple add-on to test this on. Note that even on PRs if you add the file it should run (maybe once I approve that you may execute pipelines or so), so you can easily test it. |
The JSDoc rules were just removed in the upcoming ESLint v9: eslint/eslint#17694 |
The two ESLint JSDoc rules used by this template and your other add-ons were deprecated in 2018: https://eslint.org/blog/2018/11/jsdoc-end-of-life/ and it looks like they might be removed soon: eslint/eslint#15820
AddonTemplate/.eslintrc
Lines 79 to 102 in 2068d62
It would probably be good to find a replacement. They recommended using the eslint-plugin-jsdoc plugin, but I would recommend using the TypeScript compiler instead (it supports checking JS code), as it is built into many editors by default (such as VS Code) and it can also validate the data types. Using it just requires adding a few keys to the
compilerOptions
section of the existing jsconfig.json file, such as:See the documentation for more information: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
Using this to check Unicodify and the Awesome Emoji Picker found a significant number of JSDoc (mostly incorrect datatypes) and other issues, which I can summit respective PRs to fix if you want.
Mozilla is tracking this issue in Bug 1510561.
The text was updated successfully, but these errors were encountered: