Skip to content

Commit

Permalink
chore: add prettier check
Browse files Browse the repository at this point in the history
  • Loading branch information
pret-a-porter committed Nov 15, 2024
1 parent 741519d commit a19c788
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 31 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,26 @@ jobs:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the code
- name: Checkout code
uses: actions/checkout@v3

# Step 2: Set up Node.js
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

# Step 3: Install Yarn Berry
- name: Install Yarn Berry
run: yarn set version berry

# Step 4: Install dependencies
- name: Install dependencies
run: yarn install

# Step 5: Run the build script
- name: Run Prettier Check
run: yarn run prettier:check

- name: Build the project
run: yarn run build

# Step 6: Run tests
- name: Run tests
run: yarn run test
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.yarn
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"arrowParens": "avoid",
"bracketSameLine": true,
"bracketSpacing": true,
"endOfLine": "auto",
"jsxBracketSameLine": true,
"jsxSingleQuote": true,
"printWidth": 80,
"semi": true,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
],
"scripts": {
"build": "yarn workspaces foreach --all run build",
"prettier:check": "prettier . --check",
"prettier:fix": "prettier . --write",
"test": "yarn workspaces foreach --all run test"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"types": "lib/index.d.ts",
"engines": {
"node": ">= 12"
"node": ">= 18"
},
"scripts": {
"build": "yarn run --top-level tsup src/index.ts --format cjs,esm --dts --clean --sourcemap --out-dir lib --minify",
Expand Down
2 changes: 1 addition & 1 deletion packages/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"types": "lib/index.d.ts",
"sideEffects": false,
"engines": {
"node": ">= 12"
"node": ">= 18"
},
"directories": {
"lib": "lib"
Expand Down
3 changes: 1 addition & 2 deletions packages/preact/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ export const TranslationsProvider: FunctionalComponent<
locales,
setLanguage: stateHook[1],
translator,
}}
>
}}>
{children}
</TranslationsContext.Provider>
);
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"types": "lib/index.d.ts",
"engines": {
"node": ">= 12"
"node": ">= 18"
},
"directories": {
"lib": "lib"
Expand Down Expand Up @@ -58,7 +58,7 @@
"react": "^18.3.1"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^17.0.0 || ^18.0.0"
},
"gitHead": "85f16888e69bd8962e3e20ad92065a6ef5afcb22"
}
5 changes: 2 additions & 3 deletions packages/react-native/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ export const TranslationsProvider: FC<TranslationsProviderProps> = ({
locales,
setLanguage: stateHook[1],
translator,
}}
>
}}>
{children}
</TranslationsContext.Provider>
);
Expand Down Expand Up @@ -94,7 +93,7 @@ export const Translation: FC<TranslationProps> = ({
id,
...values
}) => {
return useTranslator().translate(id, values) as any;
return useTranslator().translate(id, values);
};

export interface TranslationsContextProps {
Expand Down
8 changes: 4 additions & 4 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"types": "lib/index.d.ts",
"engines": {
"node": ">= 12"
"node": ">= 18"
},
"directories": {
"lib": "lib"
Expand Down Expand Up @@ -64,8 +64,8 @@
"react-dom": "^18.3.1"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
},
"gitHead": "85f16888e69bd8962e3e20ad92065a6ef5afcb22"
}
}
3 changes: 1 addition & 2 deletions website/src/components/Highlight.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ export function Highlight({ children, color = '#67BFEC' }) {
borderRadius: '4px',
color: '#fff',
padding: '0.1rem 0.3rem',
}}
>
}}>
{children}{' '}
</span>
);
Expand Down
3 changes: 1 addition & 2 deletions website/src/components/LanguageSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export function LanguageSelector({ children }) {
}}
onChange={e => {
setLanguage(e.target.value);
}}
>
}}>
{LIST.map(language => (
<option value={language.code} key={language.code}>
{language.icon}&nbsp;{language.name}
Expand Down
6 changes: 2 additions & 4 deletions website/src/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ function Home() {
return (
<Layout
title='Internationalization of React applications'
description='Internationalization of React applications. Elegant lightweight library based on Internationalization API'
>
description='Internationalization of React applications. Elegant lightweight library based on Internationalization API'>
<header className={classnames('hero hero--primary', styles.heroBanner)}>
<div className='container'>
<h1 className='hero__title'>{siteConfig.title}</h1>
Expand All @@ -71,8 +70,7 @@ function Home() {
'button button--secondary button--lg',
styles.getStarted,
)}
to={useBaseUrl('docs/getting-started/install')}
>
to={useBaseUrl('docs/getting-started/install')}>
Get Started
</Link>
</div>
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ __metadata:
"@types/react-dom": "npm:^18.3.1"
react: "npm:^18.3.1"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react: ^17.0.0 || ^18.0.0
languageName: unknown
linkType: soft

Expand All @@ -420,8 +420,8 @@ __metadata:
react: "npm:^18.3.1"
react-dom: "npm:^18.3.1"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
react: ^17.0.0 || ^18.0.0
react-dom: ^17.0.0 || ^18.0.0
languageName: unknown
linkType: soft

Expand Down

0 comments on commit a19c788

Please sign in to comment.