Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and add test filterModuleRules for next-plugin-storybook (#17306)
I tried the preset provided at `packages/next-plugin-storybook` but it was raising error due to an [unsafe negation](https://eslint.org/docs/rules/no-unsafe-negation) in the `preset.js` file. I added a test to show the error: ``` ● next-plugin-storybook filterModuleRules › should filter module rules correctly TypeError: rule.test.test is not a function 48 | if (!rule.test instanceof RegExp) return true 49 | // use Next.js' built-in CSS > 50 | if (rule.test.test('hello.css')) { | ^ 51 | return false 52 | } 53 | // use next-babel-loader instead of storybook's babel-loader at filter (../packages/next-plugin-storybook/preset.js:50:21) at Array.filter (<anonymous>) at Object.filterModuleRules (../packages/next-plugin-storybook/preset.js:46:28) at Object.<anonymous> (unit/webpack-config-overrides.test.js:12:36) ```
- Loading branch information