Skip to content

bug(options): wrapLineLength: 0 not by default #64

@Kristinita

Description

@Kristinita

1. Summary

Default options documentation.

But wrapLineLength: 0 not default as it is written in documentation.

2. Environment

  • Operating systems:
    • Windows 10 Enterprise LTSB 64-bit EN (local)
    • Ubuntu 14.04.5 LTS (Travis CI)
  • Node.js 10.0.0
  • npm 5.8.0
  • js-beautify 1.7.5
  • grunt-jsbeautifier 0.2.13
  • eclint (tool, that check EditorConfig settings) 2.7.0

3. Configuration

See example configuration in SashaJsBeautifyTabs branch of my demo repository:

.travis.yml:

language: node_js

node_js:
- node

install:
- npm install -g eclint grunt-cli
- npm install

script:
- grunt jsbeautifier
- eclint check SashaJsBeautifyTabs.html

SashaJsBeautifyTabs.html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
But <a href="https://productforums.google.com/d/msg/docs/YJ09uwy-pWU/g_1AJTXZN6QJ" target="_blank">notifications are only sent to the email address associated with your Google account</a>. <a href="https://support.google.com/mail/answer/10957?hl=en" target="_blank">mail forwarding</a>
</body>
</html>

.editorconfig:

[*]
indent_style = tab
insert_final_newline = true

4. Steps to reproduce

grunt jsbeautifier

eclint check SashaJsBeautifyTabs.html

5. Expected behavior

If Gruntfile.coffee:

module.exports = (grunt) ->

    grunt.loadNpmTasks('grunt-jsbeautifier')
    grunt.initConfig
        jsbeautifier:
            options:
                html:
                    indentWithTabs: true
                    endWithNewline: true
                    wrapLineLength: 0
            files: ['SashaJsBeautifyTabs.html']

or:

js-beautify -rn SashaJsBeautify.html

Modified SashaJsBeautifyTabs.html:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>

<body>
    But <a href="https://productforums.google.com/d/msg/docs/YJ09uwy-pWU/g_1AJTXZN6QJ" target="_blank">notifications are only sent to the email address associated with your Google account</a>. <a href="https://support.google.com/mail/answer/10957?hl=en" target="_blank">mail forwarding</a>
</body>

</html>

See Travis CI build.

6. Actual behavior

Else Gruntfile.coffee:

module.exports = (grunt) ->

    grunt.loadNpmTasks('grunt-jsbeautifier')
    grunt.initConfig
        jsbeautifier:
            options:
                html:
                    indentWithTabs: true
                    endWithNewline: true
            files: ['SashaJsBeautifyTabs.html']

Modified SashaJsBeautifyTabs.html:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>

<body>
    But <a href="https://productforums.google.com/d/msg/docs/YJ09uwy-pWU/g_1AJTXZN6QJ" target="_blank">notifications are only sent to the email address associated with your Google account</a>. <a href="https://support.google.com/mail/answer/10957?hl=en"
        target="_blank">mail forwarding</a>
</body>

</html>

Spaces before target="_blank", despite the fact that indentWithTabs: true:

See Travis CI build.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions