Skip to content

Commit

Permalink
Fix legacy rules for new @vitest/eslint-plugin package (#498)
Browse files Browse the repository at this point in the history
* Fix legacy rules

* Update legacy docs
  • Loading branch information
davecardwell authored Aug 11, 2024
1 parent 5f815b3 commit f32e70b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ If you're using old Eslint configuration, make sure to use legacy key like the f

```js
{
"extends": ["plugin:vitest/legacy-recommended"] // or legacy-all
"extends": ["plugin:@vitest/legacy-recommended"] // or legacy-all
}
```

Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ const createConfig = <R extends Linter.RulesRecord>(rules: R) => (
}

const createConfigLegacy = (rules: Record<string, string>) => ({
plugins: ['vitest'],
plugins: ['@vitest'],
rules: Object.keys(rules).reduce((acc, ruleName) => {
return {
...acc,
[`vitest/${ruleName}`]: rules[ruleName]
[`@vitest/${ruleName}`]: rules[ruleName]
}
}, {})
})
Expand Down

0 comments on commit f32e70b

Please sign in to comment.