-
Notifications
You must be signed in to change notification settings - Fork 62
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
Configure file name based on block meta #226
Comments
How would we guarantee a unique filename for each chunk? That's the main purpose of using the index. |
Hmm yes - so, |
Can you flesh out what exactly it is that you're requesting here? Should people be able to completely override the filename? (Like, if a block is |
On second thought: I think having it directly take the file name would be preferable. If an override wants to be configured for just So I'm suggesting:
I would be satisfied with ignoring |
Is this already a convention that exists? You've shared bits and pieces in this discussion, but I'd like to see a complete proposal, mini-RFC style, that explains exactly what you're envisioning, including how such a |
Sorry for the delay - sent #230 so we can chat in a bit more structured of a format. I tried pulling in references to related ecosystem projects but doubt I got all the potentially relevant ones. |
Thanks. We are pretty deep in v9 work right now, so this may end up sitting for a while until we can get our heads above water. |
Some projects use ESLint
overrides
to run different lint rules on files based on their file name. It'd be nice if the meta for a code block was respected in some way to retrieve file name, so thatoverrides
can be used for code blocks too.Right now,
eslint-plugin-markdown
always uses a name in this format:https://github.com/eslint/eslint-plugin-markdown/blob/4d9f36f5c5fd1b5d3b1957913118cd76a92750f2/lib/processor.js#L299
Proposal: use a file name described by the code block's meta instead of
index
when possible?Pending investigation: I don't know that there's a standard way to describe that file name. https://astexplorer.net/#/gist/0cce3ae28ac100aa5d78e3a88fdbf15e/e79a0e179def1bad1d8d7771f789709177c28a9a shows that the following codeblock's
meta
is the raw string"example abc=def"
in remark:Context/example: in https://github.com/JoshuaKGoldberg/create-typescript-app,
*.json
files exceptpackage.json
files havejsonc/sort-keys
run: https://github.com/JoshuaKGoldberg/create-typescript-app/blob/76a75186fd89fc3f66e4c1254c717c28d70afe0d/.eslintrc.cjs#L94. In https://github.com/JoshuaKGoldberg/create-typescript-app/pull/986/files#diff-cc908ca4b57d59e44123c8b13deee7af64523aa40e21f69f11d4c604af276ff6R19 a codeblock intended to be apackage.json
iscreate-typescript-app/docs/FAQs.md/0_0.jsonc
even with the meta. I had to manually disable the lint rule. I'd have preferred to instead extend the ESLint config'soverride
to something like**/package.json
.I think this is a separate ask from #208. Not sure.
The text was updated successfully, but these errors were encountered: