Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
update formatting config and reformat whole codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanierh committed Dec 21, 2021
1 parent 4d6c03f commit 8220448
Show file tree
Hide file tree
Showing 506 changed files with 36,329 additions and 31,617 deletions.
80 changes: 41 additions & 39 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
module.exports = {
root: true,
env: {
browser: true,
es6: true,
commonjs: true,
node: true,
},
extends: ['next', 'eslint:recommended', 'plugin:react/recommended', 'prettier', 'plugin:diff/diff'],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
route: 'readonly',
},
parserOptions: {
parser: '@babel/eslint-parser',
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['react', 'react-hooks'],
rules: {
indent: 'off',
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single', { avoidEscape: true }],
semi: ['error', 'never'],
'react/no-unescaped-entities': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': [
'error',
{
additionalHooks:
'(useMotiPressableTransition|useMotiPressable|useMotiPressables|useMotiPressableAnimatedProps|useInterpolateMotiPressable)',
},
],
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
},
reportUnusedDisableDirectives: true,
}
root: true,
env: {
browser: true,
es6: true,
commonjs: true,
node: true,
},
extends: [
"next",
"eslint:recommended",
"plugin:react/recommended",
"plugin:prettier/recommended",
"plugin:diff/diff",
],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
route: "readonly",
},
parserOptions: {
parser: "@babel/eslint-parser",
ecmaVersion: 2020,
sourceType: "module",
},
plugins: ["react", "react-hooks"],
rules: {
"react/no-unescaped-entities": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": [
"error",
{
additionalHooks:
"(useMotiPressableTransition|useMotiPressable|useMotiPressables|useMotiPressableAnimatedProps|useInterpolateMotiPressable)",
},
],
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
},
reportUnusedDisableDirectives: true,
};
134 changes: 67 additions & 67 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,84 +3,84 @@ name: Chromatic
on: push

concurrency:
group: ${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy-to-chromatic:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Set up repository
uses: actions/checkout@v2
with:
fetch-depth: 0 # 👈 Required to retrieve git history
deploy-to-chromatic:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Set up repository
uses: actions/checkout@v2
with:
fetch-depth: 0 # 👈 Required to retrieve git history

- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: 14.x

- uses: 8BitJonny/[email protected]
id: PR
name: Check if we're in a PR
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ github.event.pull_request.head.sha }}
filterOutClosed: true
- uses: 8BitJonny/[email protected]
id: PR
name: Check if we're in a PR
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ github.event.pull_request.head.sha }}
filterOutClosed: true

- name: Find yarn cache
id: yarn-cache-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Find yarn cache
id: yarn-cache-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Restore cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Restore cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn install --frozen-lockfile --check-files
- name: Install dependencies
run: yarn install --frozen-lockfile --check-files

- name: Build storybook
run: yarn build:next-storybook
- name: Build storybook
run: yarn build:next-storybook

- name: Publish to Chromatic
id: chromatic-output
uses: chromaui/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: apps/storybook-react/storybook-static
- name: Publish to Chromatic
id: chromatic-output
uses: chromaui/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: apps/storybook-react/storybook-static

- name: Format Storybook Preview URL
id: format-storybook-preview-url
uses: mad9000/actions-find-and-replace-string@2
if: success() && steps.PR.outputs.number != ''
with:
source: ${{ steps.chromatic-output.outputs.storybookUrl }}
find: 'iframe.html'
replace: ''
- name: Format Storybook Preview URL
id: format-storybook-preview-url
uses: mad9000/actions-find-and-replace-string@2
if: success() && steps.PR.outputs.number != ''
with:
source: ${{ steps.chromatic-output.outputs.storybookUrl }}
find: "iframe.html"
replace: ""

- name: Find PR Comment
uses: peter-evans/find-comment@v1
if: success() && steps.PR.outputs.number != ''
id: existing-comment
with:
issue-number: ${{ steps.PR.outputs.number }}
body-includes: PR Preview - Storybook on Chromatic
- name: Find PR Comment
uses: peter-evans/find-comment@v1
if: success() && steps.PR.outputs.number != ''
id: existing-comment
with:
issue-number: ${{ steps.PR.outputs.number }}
body-includes: PR Preview - Storybook on Chromatic

- name: Create or update comment
uses: peter-evans/create-or-update-comment@v1
if: success() && steps.PR.outputs.number != ''
with:
comment-id: ${{ steps.existing-comment.outputs.comment-id }}
issue-number: ${{ steps.PR.outputs.number }}
edit-mode: replace
body: |
## PR Preview - Storybook on Chromatic
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v1
if: success() && steps.PR.outputs.number != ''
with:
comment-id: ${{ steps.existing-comment.outputs.comment-id }}
issue-number: ${{ steps.PR.outputs.number }}
edit-mode: replace
body: |
## PR Preview - Storybook on Chromatic
✅ Preview: <a href="${{steps.format-storybook-preview-url.outputs.value}}">The Storybook preview URL for this Pull Request</a>
✅ Preview: <a href="${{steps.format-storybook-preview-url.outputs.value}}">The Storybook preview URL for this Pull Request</a>
✅ Build: <a href="${{ steps.chromatic-output.outputs.buildUrl}}"> The Chromatic build URL for this Pull Request</a>
✅ Build: <a href="${{ steps.chromatic-output.outputs.buildUrl}}"> The Chromatic build URL for this Pull Request</a>
Loading

0 comments on commit 8220448

Please sign in to comment.