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

🚀 Feature: Don't include n/no-missing-import allowModules if README.md doesn't violate it #1850

Closed
2 tasks done
JoshuaKGoldberg opened this issue Jan 14, 2025 · 0 comments · Fixed by #1862
Closed
2 tasks done
Assignees
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request

Comments

@JoshuaKGoldberg
Copy link
Owner

JoshuaKGoldberg commented Jan 14, 2025

Bug Report Checklist

Overview

Right now, the generated ESLint config for repos always configures n/no-missing-import's allowModules to include options.repository:

rules: {
"n/no-missing-import": [
"error",
{ allowModules: ["${options.repository}"] },
],
},

This is necessary because created repos by default have a Getting Started / Usage section like:

import { greet } from "create-typescript-app";

But, in the create Blocks version, that's not always true. Repositories may customize that section. This repo does it and removes the offending code altogether.

So, I'd like to have the ESLint Block only include that allowModules setting if options.usage actually includes code that would make it useful.

Additional Info

I don't plan on adding this to the legacy engine, just create blocks.

Prototyped in #1839.

💖

@JoshuaKGoldberg JoshuaKGoldberg added type: feature New enhancement or request status: accepting prs Please, send a pull request to resolve this! labels Jan 14, 2025
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Jan 14, 2025
@JoshuaKGoldberg JoshuaKGoldberg removed this from the Create Engine Onboarding milestone Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant