Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
setup and run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
tatimblin committed Nov 8, 2022
1 parent e27168d commit 7c5a07e
Show file tree
Hide file tree
Showing 24 changed files with 174 additions and 113 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: ['@yext/eslint-config', 'plugin:storybook/recommended']
};
extends: ["@yext/eslint-config", "plugin:storybook/recommended"],
};
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This workflow will run our tests, generate an lcov code coverage file,
# and send that coverage to Coveralls
# and send that coverage to Coveralls

name: Code Coverage

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/percy_snapshots.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

name: Percy Snapshots

on:
on:
push:
branches-ignore: dev/*
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync_sites_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
with:
source: "${{ github.event.repository.default_branch }}"
target: "storybook-site"
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/third_party_notices_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ jobs:
call_notices_check:
uses: yext/slapshot-reusable-workflows/.github/workflows/third_party_notices_check.yml@v1
secrets:
REPO_SCOPED_TOKEN: ${{ secrets.BOT_REPO_SCOPED_TOKEN }}
REPO_SCOPED_TOKEN: ${{ secrets.BOT_REPO_SCOPED_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/update_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ jobs:
call_update_docs:
uses: yext/slapshot-reusable-workflows/.github/workflows/update_docs.yml@v1
secrets:
REPO_SCOPED_TOKEN: ${{ secrets.BOT_REPO_SCOPED_TOKEN }}
REPO_SCOPED_TOKEN: ${{ secrets.BOT_REPO_SCOPED_TOKEN }}
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
18 changes: 8 additions & 10 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
module.exports = {
stories: [
"../tests/**/*.stories.@(js|jsx|ts|tsx)"
],
stories: ["../tests/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
'@storybook/addon-a11y',
"@storybook/addon-a11y",
{
name: '@storybook/addon-coverage',
name: "@storybook/addon-coverage",
options: {
istanbul: {
include: ['src/components/**']
}
}
include: ["src/components/**"],
},
},
},
],
framework: "@storybook/react",
core: {
builder: "@storybook/builder-vite",
},
staticDirs: ['./public'],
}
staticDirs: ["./public"],
};
2 changes: 1 addition & 1 deletion .storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<link rel="icon" href="./yextIcon.svg">
<link rel="icon" href="./yextIcon.svg" />
4 changes: 2 additions & 2 deletions .storybook/manager.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { addons } = require('@storybook/addons');
const { addons } = require("@storybook/addons");

addons.setConfig({
theme: require('./yextTheme.cjs')
theme: require("./yextTheme.cjs"),
});
2 changes: 1 addition & 1 deletion .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<script>
window.global = window;
</script>
</script>
12 changes: 5 additions & 7 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { runOnly } from './wcagConfig';
import { runOnly } from "./wcagConfig";

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
Expand All @@ -10,14 +10,12 @@ export const parameters = {
},
a11y: {
options: {
runOnly
}
runOnly,
},
},
options: {
storySort: {
order: [
'Address'
],
order: ["Address"],
},
},
}
};
12 changes: 6 additions & 6 deletions .storybook/test-runner.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { injectAxe, checkA11y } from 'axe-playwright';
import { Page } from 'playwright-core';
import { runOnly } from './wcagConfig';
import { injectAxe, checkA11y } from "axe-playwright";
import { Page } from "playwright-core";
import { runOnly } from "./wcagConfig";

/**
* See https://storybook.js.org/docs/react/writing-tests/test-runner#test-hook-api-experimental
Expand All @@ -11,11 +11,11 @@ const renderFunctions = {
await injectAxe(page);
},
async postRender(page: Page, context) {
await checkA11y(page, '#root', {
await checkA11y(page, "#root", {
axeOptions: {
runOnly,
rules: {
'color-contrast': { enabled: context.name !== 'Loading' }
"color-contrast": { enabled: context.name !== "Loading" },
},
},
detailedReport: true,
Expand All @@ -26,4 +26,4 @@ const renderFunctions = {
},
};

export default renderFunctions;
export default renderFunctions;
10 changes: 5 additions & 5 deletions .storybook/wcagConfig.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { axeOptionsConfig } from 'axe-playwright';
import { axeOptionsConfig } from "axe-playwright";

export const runOnly: axeOptionsConfig['axeOptions']['runOnly'] = {
type: 'tag',
values: ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']
};
export const runOnly: axeOptionsConfig["axeOptions"]["runOnly"] = {
type: "tag",
values: ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"],
};
37 changes: 18 additions & 19 deletions .storybook/yextTheme.cjs
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@

const { create } = require('@storybook/theming');
const { create } = require("@storybook/theming");

module.exports = create({
base: 'light',
colorPrimary: '#eeeff0',
colorSecondary: '#2563eb',
base: "light",
colorPrimary: "#eeeff0",
colorSecondary: "#2563eb",

// UI
appBg: '#fafafa',
appContentBg: 'white',
appBorderColor: '#eeeff0',
appBg: "#fafafa",
appContentBg: "white",
appBorderColor: "#eeeff0",
appBorderRadius: 6,

// Text colors
textColor: 'black',
textMutedColor: '#4b5563',
textColor: "black",
textMutedColor: "#4b5563",

// Toolbar colors
barTextColor: '#4b5563',
barBg: '#eeeff0',
barTextColor: "#4b5563",
barBg: "#eeeff0",

// Form
inputBg: 'white',
inputTextColor: 'black',
inputBorder: '#9ca3af',
inputBg: "white",
inputTextColor: "black",
inputBorder: "#9ca3af",
inputBorderRadius: 4,

// Brand logo
brandTitle: 'Yext Component Library',
brandUrl: 'https://github.com/yext/search-ui-react',
brandImage: './logo.png'
});
brandTitle: "Yext Component Library",
brandUrl: "https://github.com/yext/search-ui-react",
brandImage: "./logo.png",
});
6 changes: 2 additions & 4 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"plugins": [
"stylelint-scss"
],
"plugins": ["stylelint-scss"],
"rules": {
"color-no-invalid-hex": true,
"function-calc-no-invalid": true,
Expand All @@ -18,4 +16,4 @@
"scss/at-import-no-partial-leading-underscore": true,
"scss/at-import-partial-extension": "never"
}
}
}
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Contains information from the language-subtag-registry JSON Database (https://github.com/mattcg/language-subtag-registry/tree/master/data/json)
which is made available under the ODC Attribution License (https://github.com/mattcg/language-subtag-registry/blob/master/LICENSE.md).

The React Component files listed in this repository are licensed under the below license. All other features and products are subject to separate agreements
and certain functionality requires paid subscriptions to Yext products.

Expand Down
6 changes: 3 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Needed for es6 imports and TS support in jest
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-typescript",
],
};
};
Loading

0 comments on commit 7c5a07e

Please sign in to comment.