BenoitZugmeyer / eslint-plugin-html

An ESLint plugin to extract and lint scripts from HTML files.
ISC License
430 stars 51 forks source link

xhtml files report trailing spaces not allowed and newline required at end of file #64

Closed Standard8 closed 7 years ago

Standard8 commented 7 years ago

Using a test xhtml file as follows:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Test page</title>
  <script type="application/javascript"><![CDATA[
    document.write("Hello world!");
  ]]></script>
</head>
<body>
</body>
</html>

This reports:

test.xhtml
   7:1  error  Trailing spaces not allowed.                    no-trailing-spaces (eslint)
  12:1  error  Newline required at end of file but not found.  eol-last (eslint)

The only way I can seem to fix it is to remove the indent before the ]]></script>