feat: Add Storybook for component documentation, testing, and development (#34907)
Co-authored-by: Echo <ChaosExAnima@users.noreply.github.com> Co-authored-by: Renaud Chaput <renchap@gmail.com>
This commit is contained in:
parent
989ca63b59
commit
f2cfa4f482
17 changed files with 1822 additions and 104 deletions
|
@ -12,6 +12,7 @@ import jsxA11Y from 'eslint-plugin-jsx-a11y';
|
|||
import promisePlugin from 'eslint-plugin-promise';
|
||||
import react from 'eslint-plugin-react';
|
||||
import reactHooks from 'eslint-plugin-react-hooks';
|
||||
import storybook from 'eslint-plugin-storybook';
|
||||
import globals from 'globals';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
|
@ -187,6 +188,7 @@ export default tseslint.config([
|
|||
importPlugin.flatConfigs.react,
|
||||
// @ts-expect-error -- For some reason the formatjs package exports an empty object?
|
||||
formatjs.configs.strict,
|
||||
storybook.configs['flat/recommended'],
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
|
@ -252,6 +254,11 @@ export default tseslint.config([
|
|||
'app/javascript/mastodon/test_setup.js',
|
||||
'app/javascript/mastodon/test_helpers.tsx',
|
||||
'app/javascript/**/__tests__/**',
|
||||
'app/javascript/**/*.stories.ts',
|
||||
'app/javascript/**/*.stories.tsx',
|
||||
'app/javascript/**/*.test.ts',
|
||||
'app/javascript/**/*.test.tsx',
|
||||
'.storybook/**/*.ts',
|
||||
],
|
||||
},
|
||||
],
|
||||
|
@ -398,4 +405,18 @@ export default tseslint.config([
|
|||
globals: globals.vitest,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.stories.ts', '**/*.stories.tsx', '.storybook/**/*.ts'],
|
||||
rules: {
|
||||
'import/no-default-export': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['vitest.shims.d.ts'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
|
||||
'@typescript-eslint/no-unnecessary-condition': 'off',
|
||||
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue