Skip to content
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

chore: remove .eslintrc.js #18011

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aladdin-add
Copy link
Member

@aladdin-add aladdin-add commented Jan 19, 2024

note: it's not to remove eslintrc support.

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain:

What changes did you make? (Give an overview)

Is there anything you'd like reviewers to focus on?

  • .eslintignore was not removed, as it was used in a test:
    it("should throw an error if no files match a glob", () => {
    // Relying here on the .eslintignore from the repo root
    const patterns = ["tests/fixtures/glob-util/ignored/**/*.js"];
    assert.throws(() => {
    listFiles(patterns);
    }, `All files matched by '${patterns[0]}' are ignored.`);
    });
  • do we need to add .vscode (as the flat config not enabled by default in vscode-eslint)?

@eslint-github-bot eslint-github-bot bot added the chore This change is not user-facing label Jan 19, 2024
Copy link

netlify bot commented Jan 19, 2024

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit 0208901
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/662dd611119bef0008ff0b0d

@aladdin-add aladdin-add marked this pull request as ready for review January 22, 2024 02:24
@aladdin-add aladdin-add requested a review from a team as a code owner January 22, 2024 02:24
@nzakas
Copy link
Member

nzakas commented Jan 22, 2024

Can you update the description of this PR with an explanation of what changes you made? It's not clear from the title what the intent of this PR is.

@aladdin-add
Copy link
Member Author

aladdin-add commented Jan 23, 2024

The ESLint repository currently contains two ESLint configurations: eslint.config.js (used by npm run lint) and .eslintrc.js (used by vscode-eslint). With the recent support for flat configuration in vscode-eslint, you can enable it by setting "eslint.experimental.useFlatConfig": true. Therefore, this pr removes '.eslintrc.js' and adds the configuration for vscode-eslint.

@aladdin-add aladdin-add marked this pull request as draft January 23, 2024 06:08
@aladdin-add
Copy link
Member Author

Coverting to a draft, as I think it's better to refactor the test to not relying on the.eslintignore in root dir.

@mdjermanovic
Copy link
Member

Coverting to a draft, as I think it's better to refactor the test to not relying on the.eslintignore in root dir.

I think it's fine to leave .eslintignore for now. Some 150-200 tests are using this file, so we'll need to check each before removing this file.

@mdjermanovic mdjermanovic mentioned this pull request Jan 23, 2024
1 task
@snitin315 snitin315 marked this pull request as ready for review January 23, 2024 12:05
@nzakas
Copy link
Member

nzakas commented Jan 23, 2024

The ESLint repository currently contains two ESLint configurations: eslint.config.js (used by npm run lint) and .eslintrc.js (used by vscode-eslint). With the recent support for flat configuration in vscode-eslint, you can enable it by setting "eslint.experimental.useFlatConfig": true. Therefore, this pr removes '.eslintrc.js' and adds the configuration for vscode-eslint.

It seems like we're at the point where we should be pushing VS Code to enable flat config by default? Potentially by using shouldUseFlatConfig()? I'd much rather do that then start incorporating VS Code settings into the repo (which we'll need to change later).

@aladdin-add
Copy link
Member Author

@nzakas there is a discussion: microsoft/vscode-eslint#1644

@aladdin-add
Copy link
Member Author

I think it's fine to leave .eslintignore for now. Some 150-200 tests are using this file, so we'll need to check each before removing this file.

it seems the ci is happy when removing .eslintignore(13daf5e), am i missing something? 🤔 @mdjermanovic

@mdjermanovic
Copy link
Member

it seems the ci is happy when removing .eslintignore(13daf5e), am i missing something?

A test might still be passing but not actually testing what it was intended to if the assertions aren't precise enough. Now, that might not be the case for those particular tests, but it would be good to check each at some point.

@aladdin-add
Copy link
Member Author

well, will remove the commit.

@aladdin-add aladdin-add changed the title chore: remove eslintrc in eslint repo chore: remove .eslintrc.js in eslint repo Jan 26, 2024
@aladdin-add aladdin-add changed the title chore: remove .eslintrc.js in eslint repo chore: remove .eslintrc.js Jan 26, 2024
JoshuaKGoldberg
JoshuaKGoldberg previously approved these changes Feb 2, 2024
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting!

.gitignore Outdated
@@ -19,7 +19,7 @@ jsdoc/
.cache
/packages/**/node_modules
/tools/internal-rules/node_modules
/.vscode
# /.vscode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Question] Is there any reason to keep this around? Since .vscode/settings.json is now intentional:

Suggested change
# /.vscode

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to add .vscode (as the flat config not enabled by default in vscode-eslint)?

Linking for reference: microsoft/vscode-eslint#1644

Looks like, yes for now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd still rather wait so we don't have to do this.
#18075

@aladdin-add aladdin-add marked this pull request as draft February 4, 2024 10:08
Copy link

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

@Rec0iL99
Copy link
Member

Rec0iL99 commented Feb 15, 2024

Not stale. Waiting for #18075 to resolve.

#18011 (comment) for reference.

@mdjermanovic
Copy link
Member

mdjermanovic commented Apr 25, 2024

So, we're waiting here for vscode-eslint v3, which will by default detect and use flat config. The last prerelease (https://github.com/microsoft/vscode-eslint/releases/tag/3.0.5-alpha.1) was about month ago and it's still alpha, so the final release might not be that soon.

@aladdin-add what do you think about splitting this PR into two PRs:

  1. Remove eslintrc from eslint-config-eslint
    • Copy & paste the content of packages/eslint-config-eslint/eslintrc.js into root .eslintrc.js.
    • Remove packages/eslint-config-eslint/eslintrc.js and its export from packages/eslint-config-eslint/package.json.
  2. Remove root .eslintrc.js and dev dependencies from the root package.json.

We could merge (1) as soon as it's ready, and then release eslint-config-eslint v10 to unblock eslint/generator-eslint#179 and switch to ESLint v9 in all our projects. Only (2) would wait for vscode-eslint.

@mdjermanovic
Copy link
Member

Here's (1): #18400

@aladdin-add
Copy link
Member Author

#18400 has been merged, I resubmitted the (2).

@mdjermanovic mdjermanovic added the accepted There is consensus among the team that this change meets the criteria for inclusion label Apr 28, 2024
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Just waiting for vscode-eslint v3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion chore This change is not user-facing
Projects
Status: Blocked
Development

Successfully merging this pull request may close these issues.

None yet

6 participants