Closed
Description
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
?
Activity
SimenB commentedon Sep 8, 2020
Yeah, they were supposed to go away, we just forgot 😅
#579 (comment)
#661
That might make sense regardless of them being removed in the next major or not. @G-Rath thoughts?
fix: don't include deprecated rules in `all` config
G-Rath commentedon Sep 8, 2020
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 :)
all
config #664fix: don't include deprecated rules in `all` config
SimenB commentedon 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#allfix: don't include deprecated rules in `all` config (#664)
chore(release): 24.0.1 [skip ci]
github-actions commentedon Sep 12, 2020
🎉 This issue has been resolved in version 24.0.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
jdanil commentedon Sep 15, 2020
Cheers fellas!
no-try-expect
is still part of thejest/recommended
#678