Skip to content
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

"all" config includes deprecated rules #663

Closed
jdanil opened this issue Sep 8, 2020 · 5 comments · Fixed by #664
Closed

"all" config includes deprecated rules #663

jdanil opened this issue Sep 8, 2020 · 5 comments · Fixed by #664
Labels

Comments

@jdanil
Copy link
Contributor

jdanil commented Sep 8, 2020

I think I just missed the boat for a major release, but I just wanted to clarify how deprecated rules are handled in this plugin.

Currently the "all" config includes all rules in the rules directory, including deprecated rules that still exist in the source code.

const rulesDir = join(__dirname, 'rules');
const excludedFiles = ['__tests__', 'utils'];

const rules = readdirSync(rulesDir)
  .map(rule => parse(rule).name)
  .filter(rule => !excludedFiles.includes(rule))
  .reduce<Record<string, RuleModule>>(
    (acc, curr) => ({
      ...acc,
      [curr]: importDefault(join(rulesDir, curr)) as RuleModule,
    }),
    {},
  );

const allRules = Object.keys(rules).reduce<
  Record<string, TSESLint.Linter.RuleLevel>
>((rules, key) => ({ ...rules, [`jest/${key}`]: 'error' }), {});

I thought that those deprecated rules might get removed in the next major release. Is that generally the case, or are they expected to remain indefinitely?

Would it make sense for allRules to filter on rule.meta.deprecated?

@SimenB SimenB mentioned this issue Sep 8, 2020
@SimenB
Copy link
Member

SimenB commented Sep 8, 2020

I thought that those deprecated rules might get removed in the next major release. Is that generally the case, or are they expected to remain indefinitely?

Yeah, they were supposed to go away, we just forgot 😅

#579 (comment)
#661

Would it make sense for allRules to filter on rule.meta.deprecated?

That might make sense regardless of them being removed in the next major or not. @G-Rath thoughts?

G-Rath added a commit that referenced this issue Sep 8, 2020
@G-Rath
Copy link
Collaborator

G-Rath commented Sep 8, 2020

thoughts

Let's not forget to remove deprecated rules in future majors 😅

Also, I think this sets a predicents we should be careful of, as it's arguably breaking a similar but more subtle way to us removing the deprecated rules in a minor.

I've made a PR for this :)

@SimenB
Copy link
Member

SimenB commented Sep 8, 2020

We explicitly say all is not covered by semver in the readme: https://github.com/jest-community/eslint-plugin-jest/blob/d16b84c23acda12d95244968313dc60396369b31/README.md#all

G-Rath added a commit that referenced this issue Sep 12, 2020
github-actions bot pushed a commit that referenced this issue Sep 12, 2020
## [24.0.1](v24.0.0...v24.0.1) (2020-09-12)

### Bug Fixes

* don't include deprecated rules in `all` config ([#664](#664)) ([f636021](f636021)), closes [#663](#663)
@github-actions
Copy link

🎉 This issue has been resolved in version 24.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jdanil
Copy link
Contributor Author

jdanil commented Sep 15, 2020

Cheers fellas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants