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

An idea to modify the messages and examples a little #180

Open
DopustimVladimir opened this issue Nov 7, 2021 · 4 comments
Open

An idea to modify the messages and examples a little #180

DopustimVladimir opened this issue Nov 7, 2021 · 4 comments

Comments

@DopustimVladimir
Copy link
Contributor

I have an idea to modify the properties "message" and "description" a little.

May be it will be cool to use a Markdown syntax instead of HTML. At this pull request the website will translate existing descriptions into HTML anyway.

For example...

From this:

rule:
    name: 'arrow_spacing'
    level: 'ignore'
    message: 'Function arrows (-> and =>) must be spaced properly'
    description: '''
        <p>This rule checks to see that there is spacing before and after
        the arrow operator that declares a function. This rule is disabled
        by default.</p> <p>Note that if arrow_spacing is enabled, and you
        pass an empty function as a parameter, arrow_spacing will accept
        either a space or no space in-between the arrow operator and the
        parenthesis</p>
        <pre><code># Both of this will not trigger an error,
        # even with arrow_spacing enabled.
        x(-> 3)
        x( -> 3)
        # However, this will trigger an error
        x((a,b)-> 3)
        </code>
        </pre>
         '''

To this:

rule:
    name: 'arrow_spacing'
    level: 'ignore'
    message: 'The arrow in arrow function must be spaced properly'
    description: '''
        This rule checks to see that there is spacing before and after the arrow operator
        that declares a function. This rule is disabled by default.

        Note that if `arrow_spacing` is enabled, and you pass an empty function as a
        parameter, `arrow_spacing` will accept either a space or no space in-between the
        arrow operator and the parenthesis.

        Examples of ***incorrect*** code for this rule:

        ```coffee
        x((a, b)->3)
        x((a, b)-> 3)
        x((a, b) ->3)
        x( ->3)
        x(->3)
        ```

        Examples of ***correct*** code for this rule:

        ```coffee
        x((a, b) -> 3)
        x(-> 3)
        x( -> 3)
        ```
        '''
@sibiraj-s
Copy link
Member

Yeah definitely better I think. Easier to write and maintain markdowns.

I totally didn't see the UI PR, can't wait to check that out.

@sibiraj-s
Copy link
Member

sibiraj-s commented Nov 7, 2021

@UziTech. can we turn on Github discussions? we can move these topics there. Once an idea is accepted, we can move that to an issue.

@UziTech
Copy link
Member

UziTech commented Nov 7, 2021

Sounds good to me.

@sibiraj-s
Copy link
Member

We can have this. Markdown is good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants