@stzhu/eslint-config 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/bump-version.yml +62 -0
- package/README.md +64 -14
- package/package.json +19 -15
- package/renovate.json +4 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: Bump Package Version
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version_type:
|
|
7
|
+
description: 'Version bump type'
|
|
8
|
+
required: true
|
|
9
|
+
default: 'patch'
|
|
10
|
+
type: choice
|
|
11
|
+
options:
|
|
12
|
+
- patch
|
|
13
|
+
- minor
|
|
14
|
+
- major
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
bump-version:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
permissions:
|
|
20
|
+
contents: write
|
|
21
|
+
pull-requests: write
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- uses: pnpm/action-setup@v4
|
|
27
|
+
|
|
28
|
+
- name: Setup Node.js
|
|
29
|
+
uses: actions/setup-node@v4
|
|
30
|
+
with:
|
|
31
|
+
node-version-file: package.json
|
|
32
|
+
cache: pnpm
|
|
33
|
+
registry-url: https://registry.npmjs.org
|
|
34
|
+
- name: Configure Git
|
|
35
|
+
run: |
|
|
36
|
+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
37
|
+
git config --local user.name "github-actions[bot]"
|
|
38
|
+
- name: Get current version
|
|
39
|
+
id: current_version
|
|
40
|
+
run: |
|
|
41
|
+
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
|
42
|
+
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
|
43
|
+
- name: Bump version
|
|
44
|
+
id: bump_version
|
|
45
|
+
run: |
|
|
46
|
+
npm version ${{ github.event.inputs.version_type }} --no-git-tag-version
|
|
47
|
+
NEW_VERSION=$(node -p "require('./package.json').version")
|
|
48
|
+
echo "new=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
49
|
+
- name: Create branch
|
|
50
|
+
run: |
|
|
51
|
+
BRANCH_NAME="bump-version-${{ steps.bump_version.outputs.new }}"
|
|
52
|
+
git checkout -b $BRANCH_NAME
|
|
53
|
+
echo "branch=$BRANCH_NAME" >> $GITHUB_ENV
|
|
54
|
+
- name: Commit changes
|
|
55
|
+
run: |
|
|
56
|
+
git add package.json
|
|
57
|
+
git commit -m "chore(release): ${{ github.event.inputs.version_type }} version bump to ${{ steps.bump_version.outputs.new }}"
|
|
58
|
+
git push origin ${{ env.branch }}
|
|
59
|
+
- name: Create Pull Request
|
|
60
|
+
run: gh pr create --fill
|
|
61
|
+
env:
|
|
62
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/README.md
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
# @stzhu/eslint-config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A collection of ESLint configurations for TypeScript and React projects. This package provides a set of pre-configured ESLint rules that follow best practices and common coding standards.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
+
```bash
|
|
8
|
+
pnpm i -D eslint @stzhu/eslint-config
|
|
7
9
|
```
|
|
8
|
-
pnpm i -D @stzhu/eslint-config
|
|
9
|
-
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Create an `eslint.config.js` file in your project root:
|
|
12
14
|
|
|
13
15
|
```javascript
|
|
14
16
|
// @ts-check
|
|
15
17
|
|
|
16
|
-
import { defineConfig } from '@
|
|
17
|
-
import tsConfig from '@
|
|
18
|
+
import { defineConfig } from '@stzhu/eslint-config';
|
|
19
|
+
import tsConfig from '@stzhu/eslint-config/ts';
|
|
18
20
|
|
|
19
21
|
export default defineConfig(
|
|
20
22
|
// select from one of the configs below
|
|
@@ -22,14 +24,62 @@ export default defineConfig(
|
|
|
22
24
|
);
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
## Available Configurations
|
|
28
|
+
|
|
29
|
+
### Main Configs
|
|
30
|
+
|
|
31
|
+
Choose one of these based on your project type:
|
|
32
|
+
|
|
33
|
+
- `@stzhu/eslint-config/ts`: TypeScript project configuration
|
|
34
|
+
- `@stzhu/eslint-config/react`: React project configuration
|
|
35
|
+
- `@stzhu/eslint-config/node`: Node.js project configuration
|
|
36
|
+
- `@stzhu/eslint-config/expo`: Expo/React Native project configuration
|
|
26
37
|
|
|
27
|
-
|
|
38
|
+
### Optional Configs
|
|
28
39
|
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
Add these as needed:
|
|
41
|
+
|
|
42
|
+
- `@stzhu/eslint-config/vitest`: Vitest testing configuration
|
|
43
|
+
- `@stzhu/eslint-config/storybook`: Storybook configuration
|
|
44
|
+
- `@stzhu/eslint-config/tailwind`: Tailwind CSS configuration
|
|
45
|
+
- `@stzhu/eslint-config/lingui`: Lingui internationalization configuration
|
|
46
|
+
|
|
47
|
+
## Example Configurations
|
|
48
|
+
|
|
49
|
+
### TypeScript Project
|
|
50
|
+
|
|
51
|
+
```javascript
|
|
52
|
+
import { defineConfig } from '@stzhu/eslint-config';
|
|
53
|
+
import tsConfig from '@stzhu/eslint-config/ts';
|
|
54
|
+
|
|
55
|
+
export default defineConfig(...tsConfig);
|
|
56
|
+
```
|
|
31
57
|
|
|
32
|
-
|
|
58
|
+
### React Project
|
|
33
59
|
|
|
34
|
-
|
|
35
|
-
|
|
60
|
+
```javascript
|
|
61
|
+
import { defineConfig } from '@stzhu/eslint-config';
|
|
62
|
+
import reactConfig from '@stzhu/eslint-config/react';
|
|
63
|
+
|
|
64
|
+
export default defineConfig(...reactConfig);
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### React Project with Testing
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
import { defineConfig } from '@stzhu/eslint-config';
|
|
71
|
+
import reactConfig from '@stzhu/eslint-config/react';
|
|
72
|
+
import vitestConfig from '@stzhu/eslint-config/vitest';
|
|
73
|
+
|
|
74
|
+
export default defineConfig(...reactConfig, ...vitestConfig);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Expo Project with Tailwind
|
|
78
|
+
|
|
79
|
+
```javascript
|
|
80
|
+
import { defineConfig } from '@stzhu/eslint-config';
|
|
81
|
+
import expoConfig from '@stzhu/eslint-config/expo';
|
|
82
|
+
import tailwindConfig from '@stzhu/eslint-config/tailwind';
|
|
83
|
+
|
|
84
|
+
export default defineConfig(...expoConfig, ...tailwindConfig);
|
|
85
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stzhu/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Shared config for ESLint",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint"
|
|
@@ -23,20 +23,16 @@
|
|
|
23
23
|
"./tailwind": "./src/tailwind.js",
|
|
24
24
|
"./lingui": "./src/lingui.js"
|
|
25
25
|
},
|
|
26
|
-
"bin": {
|
|
27
|
-
"eslint": "./node_modules/eslint/bin/eslint.js"
|
|
28
|
-
},
|
|
29
26
|
"dependencies": {
|
|
30
27
|
"@eslint/js": "^9.28.0",
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
32
|
-
"@typescript-eslint/parser": "^8.
|
|
33
|
-
"@vitest/eslint-plugin": "^1.2.
|
|
34
|
-
"eslint": "^9.28.0",
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "^8.34.0",
|
|
29
|
+
"@typescript-eslint/parser": "^8.34.0",
|
|
30
|
+
"@vitest/eslint-plugin": "^1.2.2",
|
|
35
31
|
"eslint-config-expo": "^9.2.0",
|
|
36
32
|
"eslint-config-prettier": "^10.1.5",
|
|
37
33
|
"eslint-config-turbo": "^2.5.4",
|
|
38
34
|
"eslint-plugin-expo": "^0.1.4",
|
|
39
|
-
"eslint-plugin-import": "^
|
|
35
|
+
"eslint-plugin-import-x": "^4.15.2",
|
|
40
36
|
"eslint-plugin-lingui": "^0.10.1",
|
|
41
37
|
"eslint-plugin-react": "^7.37.5",
|
|
42
38
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
@@ -46,24 +42,32 @@
|
|
|
46
42
|
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
47
43
|
"eslint-plugin-turbo": "^2.5.4",
|
|
48
44
|
"globals": "^16.2.0",
|
|
49
|
-
"
|
|
50
|
-
"tailwindcss": "^4.1.8",
|
|
51
|
-
"typescript": "^5.8.3",
|
|
52
|
-
"typescript-eslint": "^8.33.1"
|
|
45
|
+
"typescript-eslint": "^8.34.0"
|
|
53
46
|
},
|
|
54
47
|
"devDependencies": {
|
|
55
48
|
"@stzhu/prettier-plugin-tsconfig": "^0.5.0",
|
|
56
49
|
"@stzhu/tsconfig": "^0.1.0",
|
|
57
50
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
58
|
-
"eslint-plugin-import-x": "^4.15.1",
|
|
59
51
|
"prettier": "^3.5.3",
|
|
60
52
|
"prettier-plugin-packagejson": "^2.5.15"
|
|
61
53
|
},
|
|
62
54
|
"peerDependencies": {
|
|
55
|
+
"eslint": "^9",
|
|
63
56
|
"postcss": "^8",
|
|
64
|
-
"tailwindcss": "^
|
|
57
|
+
"tailwindcss": "^3",
|
|
65
58
|
"typescript": "^5"
|
|
66
59
|
},
|
|
60
|
+
"peerDependenciesMeta": {
|
|
61
|
+
"postcss": {
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
64
|
+
"tailwindcss": {
|
|
65
|
+
"optional": true
|
|
66
|
+
},
|
|
67
|
+
"typescript": {
|
|
68
|
+
"optional": true
|
|
69
|
+
}
|
|
70
|
+
},
|
|
67
71
|
"scripts": {
|
|
68
72
|
"format": "prettier -w .",
|
|
69
73
|
"lint": "prettier -c . && eslint .",
|
package/renovate.json
ADDED