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

🛠 Repo: Enable ESLint's recommended rules for JS #5281

Open
5 tasks done
JoshuaKGoldberg opened this issue Jan 2, 2025 · 7 comments · May be fixed by #5282
Open
5 tasks done

🛠 Repo: Enable ESLint's recommended rules for JS #5281

JoshuaKGoldberg opened this issue Jan 2, 2025 · 7 comments · May be fixed by #5282
Labels
area: repository tooling concerning ease of contribution status: in discussion Let's talk about it!

Comments

@JoshuaKGoldberg
Copy link
Member

Tooling Suggestion Checklist

Overview

Back in #5060, I'd added an ESLint config but not enabled any of the recommended rules from js.configs.recommended. The rules object is overridden by our custom settings:

mocha/eslint.config.js

Lines 11 to 26 in 3c191c0

module.exports = [
{
...js.configs.recommended,
languageOptions: {
ecmaVersion: 2020,
globals: {
...globals.browser,
...globals.node
},
sourceType: 'script'
},
rules: {
'no-var': 'off',
strict: ['error', 'global']
}
},

Additional Info

The fact that I missed this and no reviewers caught it is a testament to the ... joy of being new adopters of flat config. 🙃

@JoshuaKGoldberg JoshuaKGoldberg added area: repository tooling concerning ease of contribution status: in triage a maintainer should (re-)triage (review) this issue status: accepting prs Mocha can use your help with this one! and removed status: in triage a maintainer should (re-)triage (review) this issue labels Jan 2, 2025
@JoshuaKGoldberg JoshuaKGoldberg linked a pull request Jan 2, 2025 that will close this issue
3 tasks
@voxpelli
Copy link
Member

voxpelli commented Jan 2, 2025

Perhaps we could go with https://github.com/neostandard/neostandard as a base? Considering that semistandard was what was used before #5060 and neostandard now is an option?

@JoshuaKGoldberg
Copy link
Member Author

I'm tentatively in favor, but haven't dug into neostandard enough to have a super informed opinion. Is it a superset of ESLint's recommended JS rules, roughly? From what I've seen it seems like it'd be a good next step after this?

@Uzlopak
Copy link
Member

Uzlopak commented Jan 2, 2025

I think we should move to neostandard.

@JoshuaKGoldberg
Copy link
Member Author

Following up: since we're already on ESLint, I'm going to go ahead and push #5282 forward. But if someone wants to file an issue around moving to Neostandard I'd be very interested in hearing more. I don't use it myself and haven't kept good track of its latest happenings.

@voxpelli
Copy link
Member

Thoughts on neostandard @mark-wiemer?

@mark-wiemer
Copy link
Member

neostandard is foreign to me but I've skimmed through their readme and whatnot. Biggest concerns are that it's not in v1 and doesn't get super frequent updates nowadays. I do think it's worth exploring more, hence #5301, but I think the "ESLint recommended" ruleset will solve 90% of our problems, so we should merge that for now as an incremental improvement

@voxpelli
Copy link
Member

Biggest concerns are that it's not in v1 and doesn't get super frequent updates nowadays.

I'm the lead maintainer of it 😜

@JoshuaKGoldberg JoshuaKGoldberg added status: in discussion Let's talk about it! and removed status: accepting prs Mocha can use your help with this one! labels Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: repository tooling concerning ease of contribution status: in discussion Let's talk about it!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants