Skip to content

Commit a19c788

Browse files
committed
chore: add prettier check
1 parent 741519d commit a19c788

File tree

14 files changed

+24
-31
lines changed

14 files changed

+24
-31
lines changed

.github/workflows/ci.yaml

+3-6
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,26 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
# Step 1: Checkout the code
1716
- name: Checkout code
1817
uses: actions/checkout@v3
1918

20-
# Step 2: Set up Node.js
2119
- name: Setup Node.js
2220
uses: actions/setup-node@v3
2321
with:
2422
node-version: 18
2523
cache: 'yarn'
2624

27-
# Step 3: Install Yarn Berry
2825
- name: Install Yarn Berry
2926
run: yarn set version berry
3027

31-
# Step 4: Install dependencies
3228
- name: Install dependencies
3329
run: yarn install
3430

35-
# Step 5: Run the build script
31+
- name: Run Prettier Check
32+
run: yarn run prettier:check
33+
3634
- name: Build the project
3735
run: yarn run build
3836

39-
# Step 6: Run tests
4037
- name: Run tests
4138
run: yarn run test

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.yarn

.prettierrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"arrowParens": "avoid",
3+
"bracketSameLine": true,
34
"bracketSpacing": true,
45
"endOfLine": "auto",
5-
"jsxBracketSameLine": true,
66
"jsxSingleQuote": true,
77
"printWidth": 80,
88
"semi": true,

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
],
77
"scripts": {
88
"build": "yarn workspaces foreach --all run build",
9+
"prettier:check": "prettier . --check",
910
"prettier:fix": "prettier . --write",
1011
"test": "yarn workspaces foreach --all run test"
1112
},

packages/core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"types": "lib/index.d.ts",
1313
"engines": {
14-
"node": ">= 12"
14+
"node": ">= 18"
1515
},
1616
"scripts": {
1717
"build": "yarn run --top-level tsup src/index.ts --format cjs,esm --dts --clean --sourcemap --out-dir lib --minify",

packages/preact/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"types": "lib/index.d.ts",
1414
"sideEffects": false,
1515
"engines": {
16-
"node": ">= 12"
16+
"node": ">= 18"
1717
},
1818
"directories": {
1919
"lib": "lib"

packages/preact/src/index.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ export const TranslationsProvider: FunctionalComponent<
5151
locales,
5252
setLanguage: stateHook[1],
5353
translator,
54-
}}
55-
>
54+
}}>
5655
{children}
5756
</TranslationsContext.Provider>
5857
);

packages/react-native/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"types": "lib/index.d.ts",
1616
"engines": {
17-
"node": ">= 12"
17+
"node": ">= 18"
1818
},
1919
"directories": {
2020
"lib": "lib"
@@ -58,7 +58,7 @@
5858
"react": "^18.3.1"
5959
},
6060
"peerDependencies": {
61-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
61+
"react": "^17.0.0 || ^18.0.0"
6262
},
6363
"gitHead": "85f16888e69bd8962e3e20ad92065a6ef5afcb22"
6464
}

packages/react-native/src/index.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ export const TranslationsProvider: FC<TranslationsProviderProps> = ({
3838
locales,
3939
setLanguage: stateHook[1],
4040
translator,
41-
}}
42-
>
41+
}}>
4342
{children}
4443
</TranslationsContext.Provider>
4544
);
@@ -94,7 +93,7 @@ export const Translation: FC<TranslationProps> = ({
9493
id,
9594
...values
9695
}) => {
97-
return useTranslator().translate(id, values) as any;
96+
return useTranslator().translate(id, values);
9897
};
9998

10099
export interface TranslationsContextProps {

packages/react/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"types": "lib/index.d.ts",
1616
"engines": {
17-
"node": ">= 12"
17+
"node": ">= 18"
1818
},
1919
"directories": {
2020
"lib": "lib"
@@ -64,8 +64,8 @@
6464
"react-dom": "^18.3.1"
6565
},
6666
"peerDependencies": {
67-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
68-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
67+
"react": "^17.0.0 || ^18.0.0",
68+
"react-dom": "^17.0.0 || ^18.0.0"
6969
},
7070
"gitHead": "85f16888e69bd8962e3e20ad92065a6ef5afcb22"
71-
}
71+
}

website/src/components/Highlight.jsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ export function Highlight({ children, color = '#67BFEC' }) {
88
borderRadius: '4px',
99
color: '#fff',
1010
padding: '0.1rem 0.3rem',
11-
}}
12-
>
11+
}}>
1312
{children}{' '}
1413
</span>
1514
);

website/src/components/LanguageSelector.jsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ export function LanguageSelector({ children }) {
2222
}}
2323
onChange={e => {
2424
setLanguage(e.target.value);
25-
}}
26-
>
25+
}}>
2726
{LIST.map(language => (
2827
<option value={language.code} key={language.code}>
2928
{language.icon}&nbsp;{language.name}

website/src/pages/index.jsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ function Home() {
5959
return (
6060
<Layout
6161
title='Internationalization of React applications'
62-
description='Internationalization of React applications. Elegant lightweight library based on Internationalization API'
63-
>
62+
description='Internationalization of React applications. Elegant lightweight library based on Internationalization API'>
6463
<header className={classnames('hero hero--primary', styles.heroBanner)}>
6564
<div className='container'>
6665
<h1 className='hero__title'>{siteConfig.title}</h1>
@@ -71,8 +70,7 @@ function Home() {
7170
'button button--secondary button--lg',
7271
styles.getStarted,
7372
)}
74-
to={useBaseUrl('docs/getting-started/install')}
75-
>
73+
to={useBaseUrl('docs/getting-started/install')}>
7674
Get Started
7775
</Link>
7876
</div>

yarn.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ __metadata:
402402
"@types/react-dom": "npm:^18.3.1"
403403
react: "npm:^18.3.1"
404404
peerDependencies:
405-
react: ^16.8.0 || ^17.0.0 || ^18.0.0
405+
react: ^17.0.0 || ^18.0.0
406406
languageName: unknown
407407
linkType: soft
408408

@@ -420,8 +420,8 @@ __metadata:
420420
react: "npm:^18.3.1"
421421
react-dom: "npm:^18.3.1"
422422
peerDependencies:
423-
react: ^16.8.0 || ^17.0.0 || ^18.0.0
424-
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
423+
react: ^17.0.0 || ^18.0.0
424+
react-dom: ^17.0.0 || ^18.0.0
425425
languageName: unknown
426426
linkType: soft
427427

0 commit comments

Comments
 (0)