@korioinc/next-configs 2.0.43 → 2.0.45

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 +77 -43
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # @korioinc/next-configs
2
2
 
3
- Shared configuration presets for ESLint, Prettier, and TypeScript in Next.js projects.
3
+ Shared ESLint, Prettier, and TypeScript presets for Korio Next.js packages and
4
+ apps.
5
+
6
+ The package ships plain config files through package exports. There is no build
7
+ step for consumers.
4
8
 
5
9
  ## Installation
6
10
 
@@ -8,47 +12,82 @@ Shared configuration presets for ESLint, Prettier, and TypeScript in Next.js pro
8
12
  pnpm add -D @korioinc/next-configs
9
13
  ```
10
14
 
11
- ## Features
15
+ Install the peer tools used by the presets you consume. See the package's
16
+ `peerDependencies` for the exact supported ranges.
17
+
18
+ ## Public entrypoints
19
+
20
+ | Entrypoint | File | Purpose |
21
+ | --------------------------------------------- | -------------------------- | ---------------------------------- |
22
+ | `@korioinc/next-configs/eslint` | `eslint/next.mjs` | Default Next.js ESLint flat config |
23
+ | `@korioinc/next-configs/eslint/base` | `eslint/base.mjs` | Base TypeScript/JavaScript config |
24
+ | `@korioinc/next-configs/eslint/next` | `eslint/next.mjs` | Next.js app config |
25
+ | `@korioinc/next-configs/eslint/library` | `eslint/library.mjs` | Non-React library config |
26
+ | `@korioinc/next-configs/eslint/react-library` | `eslint/react-library.mjs` | React library config |
27
+ | `@korioinc/next-configs/prettier` | `prettier/index.mjs` | Prettier config |
28
+ | `@korioinc/next-configs/tsconfig/*` | `tsconfig/*.json` | TypeScript config presets |
29
+
30
+ ## ESLint
12
31
 
13
- - **ESLint Configs**: Pre-configured ESLint rules for Next.js, libraries, and React libraries
14
- - **Prettier Config**: Consistent code formatting with Tailwind CSS support
15
- - **TypeScript Configs**: Optimized tsconfig presets for different project types
32
+ Create `eslint.config.mjs`:
16
33
 
17
- ## Usage
34
+ ```javascript
35
+ import config from '@korioinc/next-configs/eslint';
18
36
 
19
- ### ESLint Configuration
37
+ export default [...config];
38
+ ```
20
39
 
21
- Create an `eslint.config.mjs` file:
40
+ Choose a more specific preset when needed:
22
41
 
23
42
  ```javascript
24
- import nextConfig from '@korioinc/next-configs/eslint/next';
43
+ import config from '@korioinc/next-configs/eslint/react-library';
25
44
 
26
- export default nextConfig;
45
+ export default [...config];
27
46
  ```
28
47
 
29
- Available presets:
30
- - `@korioinc/next-configs/eslint/base` - Base configuration
31
- - `@korioinc/next-configs/eslint/next` - Next.js applications
32
- - `@korioinc/next-configs/eslint/library` - Node.js libraries
33
- - `@korioinc/next-configs/eslint/react-library` - React component libraries
48
+ ### ESLint presets
49
+
50
+ | Preset | Use for | Includes |
51
+ | ---------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------- |
52
+ | `eslint/base` | Shared non-Next baseline | `@eslint/js`, `typescript-eslint`, `eslint-config-prettier`, Turbo env var rule |
53
+ | `eslint/next` | Next.js apps | Next core web vitals, Next TypeScript rules, import/promise/prettier/unused-imports, Valtio rules |
54
+ | `eslint/library` | Node or shared TypeScript libraries | Base rules plus import, promise, prettier, and Valtio rules |
55
+ | `eslint/react-library` | React component libraries | Library rules plus React and React Hooks rules |
56
+
57
+ The current ESLint configs are flat config arrays for ESLint `>=10`. Several
58
+ presets import plugins directly, including `eslint-plugin-import`,
59
+ `eslint-plugin-promise`, `eslint-plugin-prettier`, `eslint-plugin-turbo`,
60
+ `eslint-plugin-unused-imports`, `eslint-plugin-valtio`, and the React plugins
61
+ for React presets.
34
62
 
35
- ### Prettier Configuration
63
+ ## Prettier
36
64
 
37
- Create a `prettier.config.mjs` file:
65
+ Create `prettier.config.mjs`:
38
66
 
39
67
  ```javascript
40
- import prettierConfig from '@korioinc/next-configs/prettier';
68
+ import config from '@korioinc/next-configs/prettier';
41
69
 
42
- export default prettierConfig;
70
+ export default config;
43
71
  ```
44
72
 
45
- Features included:
46
- - Import sorting with `@trivago/prettier-plugin-sort-imports`
47
- - Tailwind CSS class sorting with `prettier-plugin-tailwindcss`
73
+ The shared config uses:
48
74
 
49
- ### TypeScript Configuration
75
+ - single quotes
76
+ - semicolons
77
+ - `printWidth: 120`
78
+ - trailing commas
79
+ - `@trivago/prettier-plugin-sort-imports`
80
+ - `prettier-plugin-tailwindcss`
50
81
 
51
- Extend from our presets in your `tsconfig.json`:
82
+ The default import order is:
83
+
84
+ ```javascript
85
+ ['^react$', '^next(/.*)?$', 'next-themes', '@/*', '<THIRD_PARTY_MODULES>'];
86
+ ```
87
+
88
+ ## TypeScript
89
+
90
+ Extend a preset from `tsconfig.json`:
52
91
 
53
92
  ```json
54
93
  {
@@ -56,30 +95,25 @@ Extend from our presets in your `tsconfig.json`:
56
95
  }
57
96
  ```
58
97
 
59
- Available presets:
60
- - `/tsconfig/base.json` - Base TypeScript configuration
61
- - `/tsconfig/nextjs.json` - Next.js applications
62
- - `/tsconfig/library.json` - Node.js libraries
63
- - `/tsconfig/react-library.json` - React component libraries
98
+ Available TypeScript presets:
64
99
 
65
- ## Peer Dependencies
100
+ | Preset | Use for | Notes |
101
+ | ------------------------ | ---------------------- | ------------------------------------------------------------------------------------------------- |
102
+ | `tsconfig/base` | Shared strict baseline | `NodeNext`, declarations enabled, strict mode, ES2022 target |
103
+ | `tsconfig/nextjs` | Next.js apps | Extends base, uses `moduleResolution: "Bundler"`, `jsx: "react-jsx"`, `noEmit: true`, Next plugin |
104
+ | `tsconfig/react-library` | React libraries | Extends base, uses bundler resolution and React JSX |
66
105
 
67
- This package requires the following peer dependencies:
106
+ There is no `tsconfig/library.json` preset in the current package.
68
107
 
69
- - `eslint` >=9.0.0
70
- - `typescript` >=5.9.0
71
- - `prettier` >=3.0.0
108
+ ## Key peer requirements
72
109
 
73
- For full functionality, you may also need:
74
- - `@next/eslint-plugin-next` >=15.0.0
75
- - `@typescript-eslint/eslint-plugin` >=8.41.0
76
- - `eslint-plugin-react` >=7.37.0
77
- - `prettier-plugin-tailwindcss` >=0.6.0
110
+ - ESLint `>=10.0.0`
111
+ - TypeScript `>=5.9.0`
112
+ - Prettier `>=3.0.0`
113
+ - Next.js ESLint tooling `>=16.2.6` for the Next preset
114
+ - React ESLint plugins for `eslint/react-library`
115
+ - Prettier import sorting and Tailwind plugins for the Prettier preset
78
116
 
79
117
  ## License
80
118
 
81
119
  MIT
82
-
83
- ## Contributing
84
-
85
- Contributions are welcome! Please feel free to submit a Pull Request.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korioinc/next-configs",
3
- "version": "2.0.43",
3
+ "version": "2.0.45",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./eslint": "./eslint/next.mjs",
@@ -30,16 +30,16 @@
30
30
  "author": "Korio Inc.",
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "@eslint/compat": "^2.0.5"
33
+ "@eslint/compat": "^2.1.0"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@eslint/js": ">=10.0.0",
37
- "@next/eslint-plugin-next": ">=16.1.1",
37
+ "@next/eslint-plugin-next": ">=16.2.6",
38
38
  "@trivago/prettier-plugin-sort-imports": ">=6.0.0",
39
39
  "@typescript-eslint/eslint-plugin": ">=8.41.0",
40
40
  "@typescript-eslint/parser": ">=8.41.0",
41
41
  "eslint": ">=10.0.0",
42
- "eslint-config-next": ">=16.1.1",
42
+ "eslint-config-next": ">=16.2.6",
43
43
  "eslint-config-prettier": ">=10.0.0",
44
44
  "eslint-plugin-import": ">=2.32.0",
45
45
  "eslint-plugin-prettier": ">=5.5.0",