You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: prepare package for npm publishing and update dependencies
- Add package metadata (author, files, engines) for proper npm publishing
- Update GitHub Actions to latest versions (checkout@v4, setup-node@v4)
- Use Node.js LTS version in CI workflow
- Add legacy.js export for backward compatibility
- Update examples with proper documentation
- Refine ESLint configurations for better developer experience
- Update dependencies to latest compatible versions
This ensures the package is ready for public npm distribution with proper
metadata, modern CI/CD setup, and comprehensive examples for both ESLint 8.x
and 9.x configurations.
🤖 Generated with Claude Code
Co-Authored-By: Claude <[email protected]>
> **Note**: All ESLint plugins and parsers are included as dependencies, so you don't need to install them separately.
73
68
74
-
Create a `.eslintrc.js` file (or `.eslintrc.cjs` if your package uses `"type": "module"`) in your project root:
75
-
76
-
```js
77
-
module.exports= {
78
-
root:true,
79
-
extends:'@hypetech/eslint-config',
80
-
}
81
-
```
82
-
83
-
#### Option 3: Extending the configuration
84
-
85
-
To customize the configuration, create a `.eslintrc.js` or `.eslintrc.cjs` file:
86
-
87
-
```js
88
-
module.exports= {
89
-
...require('@hypetech/eslint-config'),
90
-
rules: {
91
-
// Your custom rules here
92
-
'no-console':'warn',
93
-
},
94
-
}
95
-
```
96
-
97
-
> **Best Practice**: Use `package.json` for libraries and `.eslintrc.js`/`.eslintrc.cjs` for applications. Avoid using both methods in the same project.
69
+
## Usage
98
70
99
-
### Flat Configuration (ESLint 9.x, Next.js 15 or later)
### Legacy Configuration (ESLint 8.x, Next.js 14 or earlier)
140
+
141
+
To use the legacy configuration, import it from the `/legacy` path:
142
+
143
+
#### Option 1: Via package.json
144
+
145
+
Add the `eslint` property to your `package.json` file:
146
+
147
+
```json
148
+
"eslintConfig": {
149
+
"extends":"@hypetech/eslint-config/legacy"
150
+
}
151
+
```
152
+
153
+
You can use the `npm pkg` subcommand to add this automatically:
154
+
155
+
```bash
156
+
npm pkg set eslintConfig.extends=@hypetech/eslint-config/legacy
183
157
```
184
158
159
+
#### Option 2: Via .eslintrc.js or .eslintrc.cjs
160
+
161
+
Create a `.eslintrc.js` file (or `.eslintrc.cjs` if your package uses `"type":"module"`) in your project root:
162
+
163
+
```js
164
+
module.exports= {
165
+
root:true,
166
+
extends:'@hypetech/eslint-config/legacy',
167
+
}
168
+
```
169
+
170
+
#### Option 3: Extending the configuration
171
+
172
+
To customize the configuration, create a `.eslintrc.js` or `.eslintrc.cjs` file:
173
+
174
+
```js
175
+
module.exports= {
176
+
...require('@hypetech/eslint-config/legacy'),
177
+
rules: {
178
+
// Your custom rules here
179
+
'no-console':'warn',
180
+
},
181
+
}
182
+
```
183
+
184
+
> **Best Practice**: Use `package.json` for libraries and `.eslintrc.js`/`.eslintrc.cjs` for applications. Avoid using both methods in the same project.
185
+
185
186
## Migration Guide
186
187
187
188
### Migrating from ESLint 8 to ESLint 9 (Next.js 14 to Next.js 15)
If you have an existing `.eslintrc.js`, `.eslintrc.cjs`, or `eslintConfig` in your `package.json`, you can remove it or keep it for backward compatibility with tools that don't yet support the flat config system.
205
+
If you have an existing `.eslintrc.js`, `.eslintrc.cjs`, or `eslintConfig` in your `package.json`, you can remove it.
204
206
205
207
4. **Update your VS Code settings** (optional):
206
208
If you're using VS Code, update your settings to work with the new flat config:
@@ -210,6 +212,18 @@ export default eslintConfig;
210
212
}
211
213
```
212
214
215
+
### Using Legacy Configuration
216
+
217
+
If you need to continue using the ESLint 8.x configuration (e.g., for compatibility reasons), update your imports:
218
+
219
+
```js
220
+
// Before (v2.x)
221
+
extends:'@hypetech/eslint-config'
222
+
223
+
// After (v3.x)
224
+
extends:'@hypetech/eslint-config/legacy'
225
+
```
226
+
213
227
# Contributing
214
228
215
229
Contributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change.
0 commit comments