sarbbottam / eslint-find-rules

Find built-in ESLint rules you don't have in your custom config
http://npm.im/eslint-find-rules
MIT License
201 stars 33 forks source link

[New] check unused rules with overrides #343

Closed nicolaichuk closed 2 years ago

nicolaichuk commented 2 years ago

Fixes #317.

MichaelDeBoey commented 2 years ago

@nicolaichuk Is there something I can help with in order to get this one merged?

ljharb commented 2 years ago

Answering the question i asked above would help.

MichaelDeBoey commented 2 years ago

@ljharb This PR will make it possible to have an .eslintrc like

module.exports = {
  rules: {},
  overrides: {
    files: ['**/__tests__/**/*.+(js|ts)?(x)'],
    rules: {
      'jest/no-conditional-expect': 'error',
    },
  },
}

instead of needing to first disable it

module.exports = {
  rules: {
     'jest/no-conditional-expect': 'off',
  },
  overrides: {
    files: ['**/__tests__/**/*.+(js|ts)?(x)'],
    rules: {
      'jest/no-conditional-expect': 'error',
    },
  },
}

And still have --unused flag pass.

This will make the jest config of eslint-config-kentcdodds doesn't have to use a workaround https://github.com/kentcdodds/eslint-config-kentcdodds/blob/ef7069e100e932be165115f1d03b5d76a797cf04/jest.js#L137-L141

ljharb commented 2 years ago

Great, thanks for explaining.

codecov-commenter commented 2 years ago

Codecov Report

Merging #343 (6dabfb7) into master (bc5a855) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #343   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          185       185           
=========================================
  Hits           185       185           
Impacted Files Coverage Δ
src/lib/rule-finder.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bc5a855...6dabfb7. Read the comment docs.

MichaelDeBoey commented 2 years ago

@ljharb Thanks for merging!

Can you please cut a release?

ljharb commented 2 years ago

That takes a bit longer due to requiring a review from another collaborator.

MichaelDeBoey commented 2 years ago

Please ping me when it's released

ljharb commented 2 years ago

v4.1.0 is released

nicolaichuk commented 1 year ago

@ljharb, @MichaelDeBoey

Thanks.