Skip to content

Commit

Permalink
fix: add name for debugging with eslint inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Apr 8, 2024
1 parent ee93eba commit cfc5203
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/configs/flat/addon-interactions.ts
Expand Up @@ -5,13 +5,15 @@
*/
export = [
{
name: 'storybook:addon-interactions:setup',
plugins: {
get storybook() {
return require('../../index')
},
},
},
{
name: 'storybook:addon-interactions:stories-rules',
files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
'react-hooks/rules-of-hooks': 'off',
Expand All @@ -23,6 +25,7 @@ export = [
},
},
{
name: 'storybook:addon-interactions:main-rules',
files: ['.storybook/main.@(js|cjs|mjs|ts)'],
rules: {
'storybook/no-uninstalled-addons': 'error',
Expand Down
1 change: 1 addition & 0 deletions lib/configs/flat/csf-strict.ts
Expand Up @@ -8,6 +8,7 @@ import config from './csf'
export = [
...config,
{
name: 'storybook:csf-strict:rules',
rules: {
'react-hooks/rules-of-hooks': 'off',
'import/no-anonymous-default-export': 'off',
Expand Down
3 changes: 3 additions & 0 deletions lib/configs/flat/csf.ts
Expand Up @@ -5,13 +5,15 @@
*/
export = [
{
name: 'storybook:csf:setup',
plugins: {
get storybook() {
return require('../../index')
},
},
},
{
name: 'storybook:csf:stories-rules',
files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
'react-hooks/rules-of-hooks': 'off',
Expand All @@ -24,6 +26,7 @@ export = [
},
},
{
name: 'storybook:csf:main-rules',
files: ['.storybook/main.@(js|cjs|mjs|ts)'],
rules: {
'storybook/no-uninstalled-addons': 'error',
Expand Down
3 changes: 3 additions & 0 deletions lib/configs/flat/recommended.ts
Expand Up @@ -5,13 +5,15 @@
*/
export = [
{
name: 'storybook:recommended:setup',
plugins: {
get storybook() {
return require('../../index')
},
},
},
{
name: 'storybook:recommended:stories-rules',
files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
'react-hooks/rules-of-hooks': 'off',
Expand All @@ -28,6 +30,7 @@ export = [
},
},
{
name: 'storybook:recommended:main-rules',
files: ['.storybook/main.@(js|cjs|mjs|ts)'],
rules: {
'storybook/no-uninstalled-addons': 'error',
Expand Down
4 changes: 4 additions & 0 deletions tools/update-lib-flat-configs.ts
Expand Up @@ -25,17 +25,20 @@ function formatCategory(category: TCategory) {
*/
export = [
{
name: 'storybook:${category.categoryId}:setup',
plugins: {
get storybook() {
return require('../../index')
}
}
},
{
name: 'storybook:${category.categoryId}:stories-rules',
files: [${STORIES_GLOBS.join(', ')}],
rules: ${formatRules(category.rules, ['storybook/no-uninstalled-addons'])}
},
{
name: 'storybook:${category.categoryId}:main-rules',
files: [${MAIN_JS_FILE.join(', ')}],
rules: ${formatSingleRule(category.rules, 'storybook/no-uninstalled-addons')}
}
Expand All @@ -52,6 +55,7 @@ function formatCategory(category: TCategory) {
export = [
...config,
{
name: 'storybook:${category.categoryId}:rules',
rules: ${formatRules(category.rules)}
}
]
Expand Down

0 comments on commit cfc5203

Please sign in to comment.