Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Suport JSX (react) notation #629

Open
aurium opened this issue Dec 10, 2017 · 1 comment
Open

Suport JSX (react) notation #629

aurium opened this issue Dec 10, 2017 · 1 comment

Comments

@aurium
Copy link

aurium commented Dec 10, 2017

The coffeelint's doc points to use coffee-react-transform, however it miss features and is deprecated. And, as the coffeelint's doc says, transformers may mess with the original source format.

Supporting JSX, coffeelint could test indentation of nested tags, line spliced tags, and more...

@aurium
Copy link
Author

aurium commented Dec 12, 2017

Vows test:

    topic:
        '''
        <div className="test">
            {value}
        </div>
        '''

    'do not missunderstand JSX': (source) ->
        config = { spacing_after_comma: { level: 'error' } }
        errors = coffeelint.lint(source, config)
        console.log errors

Outputs:

[ { name: 'spacing_after_comma',
    level: 'error',
    message: 'a space is required after commas',
    description: 'This rule checks to make sure you have a space after commas.',
    lineNumber: 1,
    line: '<div className="test">',
    rule: 'spacing_after_comma' },
  { name: 'spacing_after_comma',
    level: 'error',
    message: 'a space is required after commas',
    description: 'This rule checks to make sure you have a space after commas.',
    lineNumber: 1,
    line: '<div className="test">',
    rule: 'spacing_after_comma' } ]

Why it matches spacing_after_comma in a JSX tag notation?

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

No branches or pull requests

1 participant