Skip to content

Commit

Permalink
Merge pull request #238 from akhilmhdh/feat/storybook
Browse files Browse the repository at this point in the history
feat(frontend): added storybook with tailwind integration
  • Loading branch information
vmatsiiako authored Jan 18, 2023
2 parents 3a6b208 + 83899be commit b7115d8
Show file tree
Hide file tree
Showing 8 changed files with 30,859 additions and 6,768 deletions.
34 changes: 29 additions & 5 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ module.exports = {
browser: true,
es2021: true
},
extends: ['airbnb', 'airbnb-typescript', 'airbnb/hooks', 'plugin:react/recommended', 'prettier'],
extends: [
'airbnb',
'airbnb-typescript',
'airbnb/hooks',
'plugin:react/recommended',
'prettier',
'plugin:storybook/recommended'
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
Expand All @@ -20,23 +27,40 @@ module.exports = {
'import/prefer-default-export': 'off',
'react-hooks/exhaustive-deps': 'off',
'@typescript-eslint/ban-ts-comment': 'warn',
'react/jsx-props-no-spreading': 'off', // switched off for component building
// TODO: This rule will be switched ON after complete revamp of frontend
'@typescript-eslint/no-explicit-any': 'off',
'no-console': 'off',
'arrow-body-style': 'off',
'no-underscore-dangle': ['error', { allow: ['_id'] }],
'jsx-a11y/anchor-is-valid': 'off', // all those <a> tags must be converted to label or a p component
'no-underscore-dangle': [
'error',
{
allow: ['_id']
}
],
'jsx-a11y/anchor-is-valid': 'off',
// all those <a> tags must be converted to label or a p component
//
'react/require-default-props': 'off',
'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.ts'] }],
'react/jsx-filename-extension': [
1,
{
extensions: ['.tsx', '.ts']
}
],
// TODO: turn this rule ON after migration. everything should use arrow functions
'react/function-component-definition': [
0,
{
namedComponents: 'arrow-function'
}
],
'react/no-unknown-property': ['error', { ignore: ['jsx'] }],
'react/no-unknown-property': [
'error',
{
ignore: ['jsx']
}
],
'@typescript-eslint/no-non-null-assertion': 'off',
'simple-import-sort/exports': 'warn',
'simple-import-sort/imports': [
Expand Down
21 changes: 21 additions & 0 deletions frontend/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const path = require('path');
module.exports = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'storybook-dark-mode',
'@storybook/addon-postcss'
],
framework: {
name: '@storybook/nextjs',
options: {}
},
core: {
disableTelemetry: true
},
docs: {
autodocs: 'tag'
}
};
11 changes: 11 additions & 0 deletions frontend/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import '../src/styles/globals.css';

export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/
}
}
};
Loading

0 comments on commit b7115d8

Please sign in to comment.