Skip to content

Commit

Permalink
fix: buildFromOxlintConfig react-hooks rules did not applied (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sysix authored Nov 21, 2024
1 parent f782b27 commit bf7f215
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/build-from-oxlint-config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ describe('integration test with oxlint', () => {
{
categories: {
correctness: 'warn',
nursery: 'off', // enable after oxc-project/oxc#7073
nursery: 'warn',
pedantic: 'warn',
perf: 'warn',
restriction: 'warn',
Expand All @@ -341,7 +341,6 @@ describe('integration test with oxlint', () => {
'promise',
'jest',
'vitest',
'tree_shaking',
],
},
// everything on
Expand All @@ -359,11 +358,10 @@ describe('integration test with oxlint', () => {
'promise',
'jest',
'vitest',
'tree_shaking',
],
categories: {
correctness: 'warn',
nursery: 'off', // enable after oxc-project/oxc#7073
nursery: 'off', // ToDo: something with the import plugin
pedantic: 'warn',
perf: 'warn',
restriction: 'warn',
Expand Down
6 changes: 6 additions & 0 deletions src/build-from-oxlint-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ export const buildFromOxlintConfig = (
// it is not a plugin but it is activated by default
plugins.push('eslint');

// oxc handles "react-hooks" rules inside "react" plugin
// our generator split them into own plugins
if (plugins.includes('react')) {
plugins.push('react-hooks');
}

handleCategoriesScope(
plugins,
readCategoriesFromConfig(config) ?? defaultCategories,
Expand Down

0 comments on commit bf7f215

Please sign in to comment.