<style> block is treated as JS
See original GitHub issueHi,
After upgrading to eslint-plugin-vue
v3 and finally figuring out to turn off eslint-plugin-html
, I got some max-len
errors in style block - mostly background
rules.
Is this expected that eslint-plugin-vue
will lint CSS?
ESLint version: 4.4.1 eslint-plugin-vue: 3.11.0 vue-eslint-parser: 2.0.0-beta.6
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
JavaScript: Element style.display = 'block' is not working
For some reason, the CSS was overriding the JavaScript. Would like to know why. Solved. var textAreaDiv1 = document.
Read more >JavaScript-Based Style Sheets - W3C
With a value of 'left' or 'right', the element is treated as block-level (so, e.g. the 'text-align' property can be set). This property...
Read more >Custom Block Rendering - Draft.js
This article discusses how to customize Draft default block rendering. ... by the block rendering mapping will be treated as unstyled ...
Read more >Block Manager - GrapesJS
Avoid non serializable properties; Avoid styles ... By default, Block Manager UI is considered a hidden component.
Read more >display - CSS: Cascading Style Sheets - MDN Web Docs
The display CSS property sets whether an element is treated as a block or inline element and the layout used for its children,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for this issue.
However, this is one of known limitations. The rule checks source code texts instead of AST trees, so lines which are on outside of
<script>
causesmax-len
errors.There is no workaround for now. I can refactor the rule as using AST instead of texts.
As a side note, this plugin uses a different mechanism to
eslint-plugin-html
.eslint-plugin-html
is using preprocessors. It transforms source codes before parsers and rules use the source codes. Ineslint-plugin-html
case, it extracts only inside of<script>
, then parsers and rules use it.eslint-plugin-vue
does not use the preprocessor. This parser parses whole source code of.vue
files and rules use the whole source code. Ifeslint-plugin-vue
uses the preprocessors, it removes outside of<script>
, this parser cannot generate AST of<template>
, soeslint-plugin-vue
cannot use the preprocessors.Thanks for clarifying. I only got
max-len
errors and most of the affected rules can be spread over multiple lines and with airbnb config long urls are ignored. So overall I easily fixed those fewmax-len
ones.