@stzhu/eslint-config 0.1.1 → 0.3.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/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,63 @@ 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/turbo`: Turborepo monorepo
46
+ - `@stzhu/eslint-config/lingui`: Lingui internationalization configuration
47
+
48
+ ## Example Configurations
49
+
50
+ ### TypeScript Project
51
+
52
+ ```javascript
53
+ import { defineConfig } from '@stzhu/eslint-config';
54
+ import tsConfig from '@stzhu/eslint-config/ts';
55
+
56
+ export default defineConfig(...tsConfig);
57
+ ```
31
58
 
32
- Import any of the following optional configs depending on usage.
59
+ ### React Project
33
60
 
34
- - `@internal/eslint-config/vitest`
35
- - `@internal/eslint-config/storybook`
61
+ ```javascript
62
+ import { defineConfig } from '@stzhu/eslint-config';
63
+ import reactConfig from '@stzhu/eslint-config/react';
64
+
65
+ export default defineConfig(...reactConfig);
66
+ ```
67
+
68
+ ### React Project with Testing
69
+
70
+ ```javascript
71
+ import { defineConfig } from '@stzhu/eslint-config';
72
+ import reactConfig from '@stzhu/eslint-config/react';
73
+ import vitestConfig from '@stzhu/eslint-config/vitest';
74
+
75
+ export default defineConfig(...reactConfig, ...vitestConfig);
76
+ ```
77
+
78
+ ### Expo Project with Tailwind
79
+
80
+ ```javascript
81
+ import { defineConfig } from '@stzhu/eslint-config';
82
+ import expoConfig from '@stzhu/eslint-config/expo';
83
+ import tailwindConfig from '@stzhu/eslint-config/tailwind';
84
+
85
+ export default defineConfig(...expoConfig, ...tailwindConfig);
86
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stzhu/eslint-config",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "description": "Shared config for ESLint",
5
5
  "keywords": [
6
6
  "eslint"
@@ -21,22 +21,19 @@
21
21
  "./storybook": "./src/storybook.js",
22
22
  "./vitest": "./src/vitest.js",
23
23
  "./tailwind": "./src/tailwind.js",
24
- "./lingui": "./src/lingui.js"
25
- },
26
- "bin": {
27
- "eslint": "./node_modules/eslint/bin/eslint.js"
24
+ "./lingui": "./src/lingui.js",
25
+ "./turbo": "./src/turbo.js"
28
26
  },
29
27
  "dependencies": {
30
28
  "@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",
29
+ "@typescript-eslint/eslint-plugin": "^8.34.0",
30
+ "@typescript-eslint/parser": "^8.34.0",
31
+ "@vitest/eslint-plugin": "^1.2.2",
35
32
  "eslint-config-expo": "^9.2.0",
36
33
  "eslint-config-prettier": "^10.1.5",
37
34
  "eslint-config-turbo": "^2.5.4",
38
35
  "eslint-plugin-expo": "^0.1.4",
39
- "eslint-plugin-import": "^2.31.0",
36
+ "eslint-plugin-import-x": "^4.15.2",
40
37
  "eslint-plugin-lingui": "^0.10.1",
41
38
  "eslint-plugin-react": "^7.37.5",
42
39
  "eslint-plugin-react-hooks": "^5.2.0",
@@ -46,22 +43,19 @@
46
43
  "eslint-plugin-tailwindcss": "^3.18.0",
47
44
  "eslint-plugin-turbo": "^2.5.4",
48
45
  "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"
46
+ "typescript-eslint": "^8.34.0"
53
47
  },
54
48
  "devDependencies": {
55
49
  "@stzhu/prettier-plugin-tsconfig": "^0.5.0",
56
50
  "@stzhu/tsconfig": "^0.1.0",
57
51
  "@types/eslint-config-prettier": "^6.11.3",
58
- "eslint-plugin-import-x": "^4.15.1",
59
52
  "prettier": "^3.5.3",
60
53
  "prettier-plugin-packagejson": "^2.5.15"
61
54
  },
62
55
  "peerDependencies": {
56
+ "eslint": "^9",
63
57
  "postcss": "^8",
64
- "tailwindcss": "^4",
58
+ "tailwindcss": "^3",
65
59
  "typescript": "^5"
66
60
  },
67
61
  "peerDependenciesMeta": {
package/src/ts.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import js from '@eslint/js';
2
2
  import prettier from 'eslint-config-prettier';
3
- import turbo from 'eslint-plugin-turbo';
4
3
  import globals from 'globals';
5
4
  import tseslint from 'typescript-eslint';
6
5
 
@@ -13,7 +12,6 @@ export default tseslint.config(
13
12
  // name: 'ts/ignores',
14
13
  ignores: ['dist/', '.wrangler/'],
15
14
  },
16
- turbo.configs['flat/recommended'],
17
15
  Object.assign({ name: '@eslint/js/recommended' }, js.configs.recommended),
18
16
  ...importConfig,
19
17
  {
package/src/turbo.js ADDED
@@ -0,0 +1,4 @@
1
+ import turbo from 'eslint-plugin-turbo';
2
+ import tseslint from 'typescript-eslint';
3
+
4
+ export default tseslint.config(turbo.configs['flat/recommended']);