mysticatea / eslint-plugin-eslint-comments

Additional ESLint rules for directive comments of ESLint.
https://mysticatea.github.io/eslint-plugin-eslint-comments/
MIT License
361 stars 46 forks source link

no-restricted-disable breaks on allowing non-core rules #33

Open kimihiro64 opened 5 years ago

kimihiro64 commented 5 years ago

I'm not allowing any rules to be disabled by default (''), then adding specific rules that have to be disabled because they have no workaround. This works for core rules with '!corerule', but it breaks for all plugin rules '!plugin/rule', presumably because under the hood this uses the ignore package, which is built on recognizing directories. I tried escaping the / with both \/ and //, using instead of /, using . instead of /, nothing works. If ignore is the issue, then probably this needs to be redone using regex patterns instead of glob patterns to support plugin rules. As of right now I have to turn this rule off because it's always erroring for those plugin rules.

mysticatea commented 5 years ago

Would you provide the following items?

  1. What you did with actual code and config.
  2. Your expected result.
  3. The actual result.
mihai1voicescu commented 4 years ago

Given rules like this:

'eslint-comments/no-restricted-disable': [
            'error',
            '*', // disable all rules but the following

            // overrides the enforce that class methods use "this"
            // https://eslint.org/docs/rules/class-methods-use-this
            // used when declaring interfaces in JS
            '!class-methods-use-this',

            // this is a problem when returning a cast literal
            // https://palantir.github.io/tslint/rules/no-object-literal-type-assertion/
            '!@typescript-eslint/no-object-literal-type-assertion',
// eslint-disable-next-line import/no-unassigned-import -> will still error
// eslint-disable-next-line class-methods-use-this -> will not error
ChibiBlasphem commented 3 years ago

I do have this issue too. Can I make a PR to fix this problem? This issue is due to ignore package. Due to how it works (non reincluded sub file if parent is ignored), it ignore the non-core rules because of the * pattern

MichaelDeBoey commented 1 year ago

Hi @kimihiro64!

Since this repo is unmaintained, you might want to re-open this issue in the @eslint-community fork https://github.com/eslint-community/eslint-plugin-eslint-comments

For more info about why we created this organization, you can read https://eslint.org/blog/2023/03/announcing-eslint-community-org