remark-lint icon indicating copy to clipboard operation
remark-lint copied to clipboard

Give rules access to settings

Open jablko opened this issue 3 years ago • 10 comments

Initial checklist

  • [x] I read the support docs
  • [x] I read the contributing guide
  • [x] I agree to follow the code of conduct
  • [x] I searched issues and couldn’t find anything (or linked relevant results below)
  • [x] If applicable, I’ve added docs and tests

Description of changes

I'm interested in working on this: Giving rules access to settings.

Also, some rules might need access to the fileSet too? but from what I could gather, while settings is accessible via this (processor: this.data().settings), fileSet isn't? Consequently I've appended it to the rule arguments, symmetric with how the other (options) attacher parameter is appended to the rule arguments, roughly.

Fixes https://github.com/remarkjs/remark-lint/issues/263#issuecomment-903311532

jablko avatar Feb 17 '22 21:02 jablko

Hi! It seems some of the things asked in the template are missing? Please edit your post to fill out everything.

  • [ ] Initial checklist (todo)
  • [x] Description of changes

You won’t get any more notifications from me, but I’ll keep on updating this comment, and remove it when done!

If you need it, here’s the original template
<!--
  Please check the needed checkboxes ([ ] -> [x]). Leave the
  comments as they are, they won’t show on GitHub.
  We are excited about pull requests, but please try to limit the scope, provide
  a general description of the changes, and remember, it’s up to you to convince
  us to land it.
-->

### Initial checklist

*   [ ] I read the support docs <!-- https://github.com/remarkjs/.github/blob/main/support.md -->
*   [ ] I read the contributing guide <!-- https://github.com/remarkjs/.github/blob/main/contributing.md -->
*   [ ] I agree to follow the code of conduct <!-- https://github.com/remarkjs/.github/blob/main/code-of-conduct.md -->
*   [ ] I searched issues and couldn’t find anything (or linked relevant results below) <!-- https://github.com/search?q=user%3Aremarkjs&type=Issues -->
*   [ ] If applicable, I’ve added docs and tests

### Description of changes

TODO

<!--do not edit: pr-->

Thanks, — bb

github-actions[bot] avatar Feb 17 '22 21:02 github-actions[bot]

Codecov Report

Merging #279 (cad7332) into main (a9ef208) will not change coverage. The diff coverage is 100.00%.

:exclamation: Current head cad7332 differs from pull request most recent head 1f1c446. Consider uploading reports for the commit 1f1c446 to get more accurate results

@@            Coverage Diff             @@
##              main      #279    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           73        73            
  Lines         8447      8917   +470     
==========================================
+ Hits          8447      8917   +470     
Impacted Files Coverage Δ
...ckages/remark-lint-blockquote-indentation/index.js 100.00% <100.00%> (ø)
...ages/remark-lint-checkbox-character-style/index.js 100.00% <100.00%> (ø)
packages/remark-lint-code-block-style/index.js 100.00% <100.00%> (ø)
packages/remark-lint-emphasis-marker/index.js 100.00% <100.00%> (ø)
packages/remark-lint-fenced-code-flag/index.js 100.00% <100.00%> (ø)
packages/remark-lint-fenced-code-marker/index.js 100.00% <100.00%> (ø)
packages/remark-lint-file-extension/index.js 100.00% <100.00%> (ø)
packages/remark-lint-first-heading-level/index.js 100.00% <100.00%> (ø)
packages/remark-lint-heading-style/index.js 100.00% <100.00%> (ø)
packages/remark-lint-linebreak-style/index.js 100.00% <100.00%> (ø)
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a9ef208...1f1c446. Read the comment docs.

codecov-commenter avatar Feb 17 '22 22:02 codecov-commenter

@ChristianMurphy Thank you for the encouragement!

I started out aiming to give rules access to settings --- but to actually fix https://github.com/remarkjs/remark-lint/issues/263#issuecomment-903311532, I additionally made the remark-lint-emphasis-marker and remark-lint-strong-marker options default to settings.emphasis and settings.strong, respectively: https://github.com/remarkjs/remark-lint/blob/8b57de8fab406242e3327a7c34cf9b168e5fe5f3/packages/remark-lint-emphasis-marker/index.js#L108-L111

I've now added a commit to update those docs. :+1:

jablko avatar Feb 20 '22 20:02 jablko

unified-engine passes options and fileSet to the attacher function. Plugins use it. With this change, rules can too?

jablko avatar Feb 20 '22 21:02 jablko

I've added a commit to make the remaining rules' options default to their respective settings.

jablko avatar Feb 21 '22 00:02 jablko

I've added https://github.com/remarkjs/remark-lint/pull/282 and a commit so that the presets respect settings, same as the rules.

jablko avatar Feb 23 '22 19:02 jablko

@jablko How’s it going here? Can you let me know if you need help or if there’s anything in particular to review?

wooorm avatar Mar 24 '22 10:03 wooorm

Are we moving on this?

cc @wooorm

JounQin avatar Jul 26 '22 15:07 JounQin

It’s been a while!

@jablko Was this done? Ready for another review? Anything in particular I can help with?

wooorm avatar Jul 27 '22 16:07 wooorm

Any update on this 🤔

romgere avatar Mar 17 '23 09:03 romgere