Skip to content

Commit fc7b665

Browse files
Merge pull request #5 from Gunock/chore/update-dependencies
Update prettier config, update eslint config, update dependencies
2 parents afffb20 + c5b812d commit fc7b665

File tree

21 files changed

+2435
-2201
lines changed

21 files changed

+2435
-2201
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
cache: 'yarn'
2323
cache-dependency-path: 'yarn.lock'
2424

25+
- name: Cache ESLint cache
26+
uses: actions/cache@v4
27+
with:
28+
path: js/.cache/.eslintcache
29+
# Invalidate cache when any of the listed files changes
30+
key: ${{ runner.os }}-eslint-${{ hashFiles('js/yarn.lock', 'js/eslint-config/src/*', 'js/eslint-config/index.js', 'js/eslint.config.js', 'js/.cache/.eslintcache') }}
31+
2532
- name: Install dependencies
2633
run: yarn install --frozen-lockfile
2734

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ dist/
3636
out/
3737
*.crx
3838
*.pem
39+
40+
.cache/

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
dist/
2+
node_modules/
3+
.yarn/

.prettierrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.yarn/releases/yarn-4.2.2.cjs

Lines changed: 0 additions & 894 deletions
This file was deleted.

.yarn/releases/yarn-4.5.3.cjs

Lines changed: 934 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
nodeLinker: node-modules
22

3-
yarnPath: .yarn/releases/yarn-4.2.2.cjs
3+
yarnPath: .yarn/releases/yarn-4.5.3.cjs

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ from [chrome-extension-boilerplate-react](https://github.com/lxieyang/chrome-ext
1111
This is a basic Chrome Extensions boilerplate to help you write modular and modern Javascript code and load CSS easily.
1212
This boilerplate is using:
1313

14-
- [Chrome Extension Manifest V3](https://developer.chrome.com/docs/extensions/mv3/intro/mv3-overview/)
15-
- [React 18](https://reactjs.org)
16-
- [MUI](https://mui.com/)
17-
- [CRXJS Vite Plugin](https://www.npmjs.com/package/@crxjs/vite-plugin/v/2.0.0-beta.23)
18-
- ESLint:
19-
- [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react)
20-
- [eslint-config-prettier](https://www.npmjs.com/package/eslint-config-prettier)
21-
- [eslint-plugin-simple-import-sort](https://www.npmjs.com/package/eslint-plugin-simple-import-sort)
22-
- [typescript-eslint](https://www.npmjs.com/package/typescript-eslint)
23-
- [Prettier](https://prettier.io/)
24-
- [TypeScript](https://www.typescriptlang.org/)
14+
- [Chrome Extension Manifest V3](https://developer.chrome.com/docs/extensions/mv3/intro/mv3-overview/)
15+
- [React 18](https://reactjs.org)
16+
- [MUI](https://mui.com/)
17+
- [CRXJS Vite Plugin](https://www.npmjs.com/package/@crxjs/vite-plugin/v/2.0.0-beta.23)
18+
- ESLint:
19+
- [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react)
20+
- [eslint-config-prettier](https://www.npmjs.com/package/eslint-config-prettier)
21+
- [eslint-plugin-simple-import-sort](https://www.npmjs.com/package/eslint-plugin-simple-import-sort)
22+
- [typescript-eslint](https://www.npmjs.com/package/typescript-eslint)
23+
- [Prettier](https://prettier.io/)
24+
- [TypeScript](https://www.typescriptlang.org/)
2525

2626
Please open up an issue to nudge me to keep the npm packages up-to-date.
2727

@@ -72,7 +72,7 @@ at the [official guide](https://developer.chrome.com/webstore/publish) to more i
7272

7373
## Resources:
7474

75-
- [Chrome Extension documentation](https://developer.chrome.com/docs/extensions/get-started)
75+
- [Chrome Extension documentation](https://developer.chrome.com/docs/extensions/get-started)
7676

7777
---
7878

eslint.config.js

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
11
// @ts-check
2-
3-
import eslint from '@eslint/js';
42
import eslintConfigPrettier from 'eslint-config-prettier';
5-
import reactJsxRuntime from 'eslint-plugin-react/configs/jsx-runtime.js';
6-
import reactRecommended from 'eslint-plugin-react/configs/recommended.js';
7-
import simpleImportSort from 'eslint-plugin-simple-import-sort';
3+
import eslintPluginReact from 'eslint-plugin-react';
4+
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
85
import tseslint from 'typescript-eslint';
96

7+
import eslint from '@eslint/js';
8+
109
export default tseslint.config(
11-
{
12-
ignores: ['dist']
13-
},
1410
eslint.configs.recommended,
1511
...tseslint.configs.recommended,
12+
eslintPluginReact.configs.flat.recommended,
13+
eslintPluginReact.configs.flat['jsx-runtime'],
1614
{
17-
...reactRecommended,
18-
...reactJsxRuntime,
19-
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
20-
settings: {
21-
version: 'detect'
22-
}
23-
},
24-
{
15+
files: ['src/**/*.jsx', 'src/**/*.tsx'],
2516
plugins: {
26-
'simple-import-sort': simpleImportSort
17+
'react-hooks': eslintPluginReactHooks
2718
},
2819
rules: {
29-
'simple-import-sort/imports': 'warn',
30-
'simple-import-sort/exports': 'warn'
20+
...eslintPluginReactHooks.configs.recommended.rules
3121
}
3222
},
33-
eslintConfigPrettier
23+
eslintConfigPrettier,
24+
{
25+
settings: {
26+
react: {
27+
version: 'detect'
28+
}
29+
},
30+
ignores: ['dist', 'node_modules', '.yarn']
31+
}
3432
);

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,39 @@
55
"license": "MIT",
66
"type": "module",
77
"scripts": {
8-
"lint": "eslint .",
9-
"lint:fix": "eslint . --fix",
10-
"format": "prettier --write .",
8+
"lint": "eslint . --cache --cache-strategy content --cache-location .cache/.eslintcache",
9+
"format": "prettier --config prettier.config.js --write .",
1110
"watch": "tsc && vite build --watch",
1211
"build": "tsc && vite build"
1312
},
1413
"dependencies": {
15-
"@emotion/react": "^11.11.4",
16-
"@emotion/styled": "^11.11.5",
17-
"@fontsource/roboto": "^5.0.13",
18-
"@mui/icons-material": "^5.15.16",
19-
"@mui/material": "^5.15.16",
20-
"@mui/system": "^5.15.15",
21-
"axios": "^1.6.8",
14+
"@emotion/react": "^11.13.5",
15+
"@emotion/styled": "^11.13.5",
16+
"@fontsource/roboto": "^5.1.0",
17+
"@mui/icons-material": "^6.1.10",
18+
"@mui/material": "^6.1.10",
19+
"@mui/system": "^6.1.10",
20+
"axios": "^1.7.9",
2221
"react": "^18.3.1",
2322
"react-dom": "^18.3.1",
24-
"react-router-dom": "^6.23.0"
23+
"react-router-dom": "^6.28.0"
2524
},
2625
"devDependencies": {
27-
"@crxjs/vite-plugin": "2.0.0-beta.23",
28-
"@eslint/js": "^8.57.0",
29-
"@types/react": "^18.3.1",
30-
"@types/react-dom": "^18.3.0",
31-
"@vitejs/plugin-react": "^4.2.1",
32-
"chrome-types": "^0.1.282",
33-
"eslint": "^8.57.0",
26+
"@crxjs/vite-plugin": "2.0.0-beta.28",
27+
"@eslint/js": "^9.16.0",
28+
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
29+
"@types/react": "^18.3.14",
30+
"@types/react-dom": "^18.3.2",
31+
"@vitejs/plugin-react": "^4.3.4",
32+
"chrome-types": "^0.1.323",
33+
"eslint": "^9.16.0",
3434
"eslint-config-prettier": "^9.1.0",
35-
"eslint-plugin-react": "^7.34.1",
36-
"eslint-plugin-simple-import-sort": "^12.1.0",
37-
"prettier": "^3.2.5",
38-
"typescript": "5.4.5",
39-
"typescript-eslint": "^7.8.0",
40-
"vite": "^5.2.11"
35+
"eslint-plugin-react": "^7.37.2",
36+
"eslint-plugin-react-hooks": "^5.1.0",
37+
"prettier": "^3.4.2",
38+
"typescript": "5.7.2",
39+
"typescript-eslint": "^8.17.0",
40+
"vite": "^5.4.11"
4141
},
42-
"packageManager": "yarn@4.2.2"
42+
"packageManager": "yarn@4.5.3"
4343
}

0 commit comments

Comments
 (0)