Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nishkohli96 committed Jan 24, 2025
1 parent b66646e commit 38886bf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 2 additions & 0 deletions apps/eslint-config-docs/docs/changelog/v2.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ title: Changelog-v2.1

**Released - 25 January, 2025**

- Add `pack.sh` script to generate tarball of each package.

**Upgrade Dependencies**
| Dependency | Version |
|-|-|
Expand Down
8 changes: 3 additions & 5 deletions apps/eslint-config-docs/docs/usage/eslint-9.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default [

### NextJS

A dedicated ESLint configuration for [Next.js](https://nextjs.org/) applications is now available since version **1.1.0** of the package. It integrates seamlessly with the `create-next-app` boilerplate, which sets up projects using Next.js version 15. This simplifies setup, ensuring compatibility and optimized linting rules tailored for Next.js applications.
A dedicated ESLint configuration for [Next.js](https://nextjs.org/) applications is now available since version **1.1.0** of the package. It integrates seamlessly with the `create-next-app` boilerplate, which sets up projects using Next.js **version 15**. This simplifies setup, ensuring compatibility and optimized linting rules tailored for Next.js applications.

The `next` module in this package consolidates rules from both `js` and `jsx` configurations, extending the [stylistic](https://www.npmjs.com/package/@stylistic/eslint-plugin) plugin. It leverages the `typescript-eslint` and other React plugins provided by [eslint-config-next](https://www.npmjs.com/package/eslint-config-next), ensuring no need to duplicate plugin configurations for Next.js projects and to prevent the [redefine plugin error](#duplicate-import-error).

Expand All @@ -74,14 +74,12 @@ const eslintConfig = [
export default eslintConfig;
```
Make sure to preserve the order of the imports to avoid getting the `Error: 'React' is not defined. no-undef` linting error, else this needs to be manually fixed in the code.
### Duplicate Import Error
For ESLint 9, the error _**"Cannot redefine plugin @typescript-eslint"**_ or anything similar occurs because the `@typescript-eslint` plugin is initialized twice: once from the `js` config of this package and then from your current configuration. To fix this:
- Remove `@typescript-eslint` from the plugins key in your ESLint config.
- Let the `js` of **@nish1896/eslint-config** import manage the plugin initialization.
- Adjust any rule overrides under the rules key in your config.
- Let the `js` module of **@nish1896/eslint-config** manage the plugin initialization.
- Configure or turn off any rule in the `rules` key of eslint config.
This approach ensures no duplication while retaining flexibility for rule customization.
3 changes: 1 addition & 2 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
},
"scripts": {
"link:local": "npm link",
"unlink:local": "npm unlink @nish1896/eslint-config",
"publish:manual": "npm publish --access public"
"unlink:local": "npm unlink @nish1896/eslint-config"
},
"keywords": [
"@nish1896",
Expand Down
3 changes: 1 addition & 2 deletions packages/eslint-flat-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
},
"scripts": {
"link:local": "npm link",
"unlink:local": "npm unlink @nish1896/eslint-flat-config",
"publish:manual": "npm publish --access public"
"unlink:local": "npm unlink @nish1896/eslint-flat-config"
},
"keywords": [
"@nish1896",
Expand Down

0 comments on commit 38886bf

Please sign in to comment.