cannot make linter ignore specific rules

Open Beginner friendly
#3,333 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
javascript
Domain
cli

Research direction

Start in src/cmd/lint.js at the linked option-handling code and trace how web-ext lint invokes addons-linter. Check how disableLinterRules is represented there, then verify that specific rules can be disabled without ignoring other violations in the same file.

Written by the indexing model from the issue text.

Description

contrib: welcome

Even though addons-linter supports disabling specific rules, it seems that there is no way to use this feature when invoking web-ext lint. Based on a very quick glance at the code, maybe fixing this is as simple as adding disableLinterRules here?

https://github.com/mozilla/web-ext/blob/61464c83b46fb2f2fa7185538c1b816c2a75d681/src/cmd/lint.js#L32-L48

The only workaround seems to be to ignore whole files, but this is undesirable for the same reason it's undesirable in other linters like eslint: it runs the risk of missing other rule violations in the ignored file.

Dominant language
JavaScript
Stars
3.1k
Forks
386
Avg merge
8h
Merged PRs (30d)
19

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mozilla/web-ext

All issues in mozilla/web-ext

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.