Skip to content

Commit

Permalink
Rollup boilerplate updated (#81)
Browse files Browse the repository at this point in the history
* Rollup boilerplate updated

* workflow adjusted

* ci workflow adjusted

* yarn lock file renewed
  • Loading branch information
KaiHotz authored Aug 29, 2023
1 parent dea3289 commit 6f8ba2e
Show file tree
Hide file tree
Showing 66 changed files with 16,669 additions and 30,150 deletions.
63 changes: 0 additions & 63 deletions .babelrc.js

This file was deleted.

3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ build
dist
node_modules
coverage
config
styleguide
storybook-static
.storybook
139 changes: 139 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:react/jsx-runtime',
'plugin:storybook/recommended',
'plugin:jsx-a11y/recommended',
'plugin:prettier/recommended'
],
plugins: ['react', 'react-hooks', 'react-refresh', 'storybook', 'import', 'jsx-a11y', 'prettier'],
env: {
node: true,
browser: true,
},
settings: {
ecmaVersion: 'latest',
react: {
version: 'detect',
},
'import/resolver': {
node: true,
typescript: true,
},
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
ignorePatterns: [
'!*.js',
'!.storybook',
'.*.js',
'*.json',
'scripts',
'src/graphql/generated/*',
],
rules: {
'newline-before-return': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'no-console': 'warn',
'no-debugger': 'warn',
'no-warning-comments': 'warn',
'object-shorthand': 'error',
'no-param-reassign': 'off',
'react/prop-types': 'off',
'react/self-closing-comp': [
'error',
{
component: true,
html: true,
},
],
'react/jsx-props-no-spreading': 'off',
'react/jsx-curly-brace-presence': [
'error',
{ props: 'never', children: 'never' },
],
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link', 'NextLink', 'RouterLink'],
aspects: ['invalidHref'],
},
],
'import/namespace': 'off',
'import/order': [
'error',
{
'newlines-between': 'always',
pathGroups: [
{
pattern: '$/**',
group: 'internal',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
groups: [
['builtin', 'external'],
['internal'],
['parent', 'sibling', 'index'],
'unknown',
],
},
],
'import/no-extraneous-dependencies': 0,
},
ignorePatterns: ['.eslintrc.cjs', 'vitest.config.ts', 'setupTests.ts'],
overrides: [
{
files: ['*.ts', '*.tsx'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/typescript',
],
plugins: ['@typescript-eslint/eslint-plugin'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
},
rules: {
'@typescript-eslint/no-use-before-define': [
'error',
{ functions: false },
],
'@typescript-eslint/no-floating-promises': [
'error',
{ ignoreVoid: true },
],
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-unsafe-call': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
'@typescript-eslint/no-unsafe-return': 0,
'@typescript-eslint/no-misused-promises': 0
},
},
{
files: [
'*story.*',
'*stories.*',
'src/pages/**/*.tsx',
'additional.d.ts',
'**/__mocks__/**',
],
rules: {
'import/no-anonymous-default-export': 'off',
'import/no-default-export': 'off',
},
},
],
};
25 changes: 0 additions & 25 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- name: Install dependencies
run: |
yarn install --frozen-lockfile
yarn install --immutable
- name: Run Continuous Integration
run: |
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# dependencies
node_modules
.yarn/cache

# builds
build
Expand All @@ -22,7 +23,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
coverage
styleguide
storybook-static


18 changes: 10 additions & 8 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@
.editorconfig
.eslint*
.yarnrc
.babelrc.js
.stylelintrc.js
.stylelintignore
.babel*
.stylelint*
.storybook
jest.config.js
jest.setup.js
postcss.config.js
prettier.config.js

.yarn*
.prettier*
jest*
postcss*
prettier*
rollup*
vit*
setupTests.*

config.gypi
CVS
Expand Down
22 changes: 22 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"singleQuote": true,
"bracketSpacing": true,
"arrowParens": "always",
"printWidth": 140,
"quoteProps": "preserve",
"trailingComma": "all",
"overrides": [
{
"files": "*.jsx",
"options": {
"printWidth": 120
}
},
{
"files": "*.tsx",
"options": {
"printWidth": 120
}
}
]
}
21 changes: 3 additions & 18 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { StorybookConfig } from '@storybook/react-webpack5';
import custom from './webpack.config.js';
import type { StorybookConfig } from '@storybook/react-vite';

const config: StorybookConfig = {
stories: [
'../src/components/**/*.stories.@(js|jsx|ts|tsx)',
'../src/components/**/*.story.@(js|jsx|ts|tsx)'
],
addons: [
Expand All @@ -20,22 +18,9 @@ const config: StorybookConfig = {
}
},
],
webpackFinal: async config => {
return {
...config,
resolve: {
...config.resolve,
...custom.resolve
},
module: {
...config.module,
rules: custom.module.rules
}
};
},
framework: {
name: '@storybook/react-webpack5',
options: {}
name: '@storybook/react-vite',
options: {},
},
docs: {
autodocs: true,
Expand Down
11 changes: 0 additions & 11 deletions .storybook/preview.js

This file was deleted.

15 changes: 15 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Preview } from "@storybook/react";

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

export default preview;
Loading

0 comments on commit 6f8ba2e

Please sign in to comment.