-
Notifications
You must be signed in to change notification settings - Fork 0
feat: replace Airbnb ESLint rules with standard configurations #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Removes `eslint-config-airbnb` and `eslint-config-airbnb-base` and updates ESLint configurations (`.eslintrc.js`, `node.js`, `next.js`) to use `eslint:recommended`, `plugin:@typescript-eslint/recommended`, and `next/core-web-vitals` as base rule sets. - Updated `node.js` to remove `airbnb-base`. - Updated `next.js` to remove `airbnb`. - Removed Airbnb ESLint packages from `package.json`. - Added `eslint-plugin-n` for enhanced Node.js linting. This change aims to simplify the ESLint setup and rely on more standard, broadly adopted rule sets. Potential linting errors arising from this change will be addressed in subsequent commits if the pre-commit hooks detect them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @leoortizz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
Hello team, gemini-code-assist here to provide a summary of this pull request by @leoortizz. The primary goal of this PR is to simplify our ESLint configuration by moving away from the opinionated Airbnb rule sets and adopting more standard configurations. This involves removing the eslint-config-airbnb
and eslint-config-airbnb-base
dependencies and updating our .eslintrc.js
, node.js
, and next.js
config files to use eslint:recommended
, plugin:@typescript-eslint/recommended
, and next/core-web-vitals
as the base rules. Additionally, the PR introduces eslint-plugin-n
for enhanced Node.js specific linting rules.
Highlights
- ESLint Configuration Simplification: Replaced Airbnb-specific ESLint configurations (
airbnb
,airbnb-base
) with more standard and widely adopted rule sets (eslint:recommended
,plugin:@typescript-eslint/recommended
,next/core-web-vitals
). - Dependency Updates: Removed
eslint-config-airbnb
andeslint-config-airbnb-base
packages and addedeslint-plugin-n
topackage.json
. - Node.js Linting Enhancement: Integrated
eslint-plugin-n
into the Node.js ESLint configuration (node.js
) to provide better linting for Node.js specific code.
Changelog
Click here to see the changelog
- next.js
- Removed 'airbnb' from the
extends
array (line 17).
- Removed 'airbnb' from the
- node.js
- Removed 'airbnb-base' from the
extends
array (line 16).
- Removed 'airbnb-base' from the
- package.json
- Added
eslint-plugin-n
dependency (line 33). - Removed
eslint-config-airbnb
andeslint-config-airbnb-base
dependencies (lines 41-42).
- Added
- pnpm-lock.yaml
- Removed entries related to
eslint-config-airbnb
andeslint-config-airbnb-base
(lines 20-25, 882-897, 3376-3394). - Added entry for
eslint-plugin-n
(lines 54-56, 967-971, 3626-3637). - Updated various dependency resolutions and structures reflecting the removal and addition of packages (e.g., lines 16, 28, 34, 37, 168-176, 627-628, 830-832, 890-894, 945-949, 967-971, 993-995, 1140-1141, 1187-1189, 1282-1284, 1621-1623, 1982-1985, 2412, 2475-2480, 2675, 2690-2691, 2703-2704, 2716-2717, 2738-2739, 2756-2757, 2771-2772, 3004-3005, 3170, 3272-3275, 3425-3428, 3437-3441, 3442-3443, 3468-3477, 3485-3500, 3505-3506, 3509-3510, 3517-3518, 3520-3521, 3527-3528, 3530-3531, 3538-3539, 3541-3542, 3545-3551, 3562-3563, 3569-3571, 3572-3573, 3589-3590, 3596-3598, 3599-3600, 3626-3637, 3669, 3878-3880, 3941, 4025, 4345-4347, 4720).
- Removed entries related to
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Airbnb rules depart,
Standard configs make a start.
Linting code anew,
With plugins fresh and true,
A cleaner, simpler art.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively simplifies the ESLint setup by removing the Airbnb configurations and opting for more standard rule sets like eslint:recommended
and plugin:@typescript-eslint/recommended
. The addition of eslint-plugin-n
for enhanced Node.js linting is a good move for projects using the generic Node.js configuration.
Overall, the changes are clear and align well with the stated objectives. I have one main point of feedback regarding the integration of eslint-plugin-n
.
Summary of Findings
- eslint-plugin-n not activated: The
eslint-plugin-n
dependency was added for enhanced Node.js linting but is not activated in thenode.js
ESLint configuration. It should be added to theextends
array (e.g.,plugin:n/recommended
) to take effect.
Merge Readiness
The pull request is a good step towards simplifying the ESLint configuration. However, there's a high-severity issue identified: the newly added eslint-plugin-n
is not actually configured for use in the node.js
ESLint setup.
I recommend addressing this by activating the plugin in the node.js
configuration file as suggested. Once this change is made, the PR should be in a much better state for merging. As a reviewer, I am not authorized to approve pull requests, so please ensure further review and approval from authorized maintainers after addressing the feedback.
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The eslint-plugin-n
package has been added to package.json
with the intent of providing enhanced Node.js linting, which is great. However, it doesn't seem to be activated in this ESLint configuration file for Node.js projects.
To leverage the rules from eslint-plugin-n
, you would typically add its recommended configuration to the extends
array. Could we update the extends
array to include plugin:n/recommended
?
For example:
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:n/recommended', // For Node.js specific rules
'prettier'
],
This will ensure that the rules from eslint-plugin-n
are applied, fulfilling the goal of enhanced Node.js linting.
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:n/recommended', // Activate Node.js specific linting rules
'prettier'
Removes
eslint-config-airbnb
andeslint-config-airbnb-base
and updates ESLint configurations (.eslintrc.js
,node.js
,next.js
) to useeslint:recommended
,plugin:@typescript-eslint/recommended
, andnext/core-web-vitals
as base rule sets.node.js
to removeairbnb-base
.next.js
to removeairbnb
.package.json
.eslint-plugin-n
for enhanced Node.js linting.This change aims to simplify the ESLint setup and rely on more standard, broadly adopted rule sets. Potential linting errors arising from this change will be addressed in subsequent commits if the pre-commit hooks detect them.