@stzhu/eslint-config 0.1.1 → 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.
Files changed (2) hide show
  1. package/README.md +64 -14
  2. package/package.json +8 -15
package/README.md CHANGED
@@ -1,20 +1,22 @@
1
1
  # @stzhu/eslint-config
2
2
 
3
- ## Usage
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
- Install:
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
- Create a `eslint.config.js` with the following config:
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 '@internal/eslint-config';
17
- import tsConfig from '@internal/eslint-config/ts';
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
- ### Shareable Configs
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
- Import one of the following required main configs depending on the project type.
38
+ ### Optional Configs
28
39
 
29
- - `@internal/eslint-config/ts`: Typescript Project
30
- - `@internal/eslint-config/react`: React Project
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
- Import any of the following optional configs depending on usage.
58
+ ### React Project
33
59
 
34
- - `@internal/eslint-config/vitest`
35
- - `@internal/eslint-config/storybook`
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.1.1",
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.33.1",
32
- "@typescript-eslint/parser": "^8.33.1",
33
- "@vitest/eslint-plugin": "^1.2.1",
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": "^2.31.0",
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,22 +42,19 @@
46
42
  "eslint-plugin-tailwindcss": "^3.18.0",
47
43
  "eslint-plugin-turbo": "^2.5.4",
48
44
  "globals": "^16.2.0",
49
- "postcss": "^8.5.4",
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": "^4",
57
+ "tailwindcss": "^3",
65
58
  "typescript": "^5"
66
59
  },
67
60
  "peerDependenciesMeta": {