diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index f5ed0bfd..bdaf3295 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -15,14 +15,15 @@
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
- "dbaeumer.vscode-eslint"
+ "dbaeumer.vscode-eslint",
+ "svelte.svelte-vscode"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
- "postCreateCommand": "npm install",
+ "postCreateCommand": "yarn install",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
diff --git a/explorer-v2/src/lib/ESLintPlayground.svelte b/explorer-v2/src/lib/ESLintPlayground.svelte
index 3a27fcf4..7404fa86 100644
--- a/explorer-v2/src/lib/ESLintPlayground.svelte
+++ b/explorer-v2/src/lib/ESLintPlayground.svelte
@@ -141,7 +141,7 @@
{#each messages as msg, i (`${msg.line}:${msg.column}:${msg.ruleId}@${i}`)}
[{msg.line}:{msg.column}]:
- {msg.message} (
+ {msg.message} (
{msg.ruleId}
)
diff --git a/explorer-v2/src/lib/RulesSettings.svelte b/explorer-v2/src/lib/RulesSettings.svelte
index 8173953c..82d78f9c 100644
--- a/explorer-v2/src/lib/RulesSettings.svelte
+++ b/explorer-v2/src/lib/RulesSettings.svelte
@@ -88,7 +88,7 @@
/>
{rule.ruleId}
-
+...
diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02.1-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02.1-output.json
new file mode 100644
index 00000000..e09986ee
--- /dev/null
+++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02.1-output.json
@@ -0,0 +1,570 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "SvelteHTMLComment",
+ "value": " Styles can be marked as important ",
+ "range": [
+ 0,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ }
+ },
+ {
+ "type": "SvelteText",
+ "value": "\n",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "SvelteElement",
+ "kind": "html",
+ "name": {
+ "type": "SvelteName",
+ "name": "div",
+ "range": [
+ 44,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 1
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ }
+ },
+ "startTag": {
+ "type": "SvelteStartTag",
+ "attributes": [
+ {
+ "type": "SvelteStyleDirective",
+ "key": {
+ "type": "SvelteDirectiveKey",
+ "name": {
+ "type": "SvelteName",
+ "name": "color",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ }
+ },
+ "modifiers": [
+ "important"
+ ],
+ "range": [
+ 48,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ }
+ },
+ "shorthand": false,
+ "value": [
+ {
+ "type": "SvelteLiteral",
+ "value": "red",
+ "range": [
+ 71,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ }
+ }
+ ],
+ "range": [
+ 48,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ }
+ }
+ ],
+ "selfClosing": false,
+ "range": [
+ 43,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ }
+ },
+ "children": [
+ {
+ "type": "SvelteText",
+ "value": "...",
+ "range": [
+ 76,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ }
+ }
+ ],
+ "endTag": {
+ "type": "SvelteEndTag",
+ "range": [
+ 79,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 36
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ }
+ },
+ "range": [
+ 43,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ }
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "HTMLComment",
+ "value": "",
+ "range": [
+ 0,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 42
+ }
+ }
+ },
+ {
+ "type": "HTMLText",
+ "value": "\n",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 42
+ },
+ "end": {
+ "line": 2,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "<",
+ "range": [
+ 43,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 0
+ },
+ "end": {
+ "line": 2,
+ "column": 1
+ }
+ }
+ },
+ {
+ "type": "HTMLIdentifier",
+ "value": "div",
+ "range": [
+ 44,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 1
+ },
+ "end": {
+ "line": 2,
+ "column": 4
+ }
+ }
+ },
+ {
+ "type": "HTMLIdentifier",
+ "value": "style",
+ "range": [
+ 48,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ":",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "HTMLIdentifier",
+ "value": "color",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 11
+ },
+ "end": {
+ "line": 2,
+ "column": 16
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "|",
+ "range": [
+ 59,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ }
+ },
+ {
+ "type": "HTMLIdentifier",
+ "value": "important",
+ "range": [
+ 60,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 17
+ },
+ "end": {
+ "line": 2,
+ "column": 26
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "range": [
+ 69,
+ 70
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 26
+ },
+ "end": {
+ "line": 2,
+ "column": 27
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "\"",
+ "range": [
+ 70,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 27
+ },
+ "end": {
+ "line": 2,
+ "column": 28
+ }
+ }
+ },
+ {
+ "type": "HTMLText",
+ "value": "red",
+ "range": [
+ 71,
+ 74
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 28
+ },
+ "end": {
+ "line": 2,
+ "column": 31
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "\"",
+ "range": [
+ 74,
+ 75
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 31
+ },
+ "end": {
+ "line": 2,
+ "column": 32
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ">",
+ "range": [
+ 75,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 32
+ },
+ "end": {
+ "line": 2,
+ "column": 33
+ }
+ }
+ },
+ {
+ "type": "HTMLText",
+ "value": "...",
+ "range": [
+ 76,
+ 79
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 33
+ },
+ "end": {
+ "line": 2,
+ "column": 36
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "<",
+ "range": [
+ 79,
+ 80
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 36
+ },
+ "end": {
+ "line": 2,
+ "column": 37
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "/",
+ "range": [
+ 80,
+ 81
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 37
+ },
+ "end": {
+ "line": 2,
+ "column": 38
+ }
+ }
+ },
+ {
+ "type": "HTMLIdentifier",
+ "value": "div",
+ "range": [
+ 81,
+ 84
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 38
+ },
+ "end": {
+ "line": 2,
+ "column": 41
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ">",
+ "range": [
+ 84,
+ 85
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 41
+ },
+ "end": {
+ "line": 2,
+ "column": 42
+ }
+ }
+ }
+ ],
+ "range": [
+ 0,
+ 86
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02.1-scope-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02.1-scope-output.json
new file mode 100644
index 00000000..d392ca4b
--- /dev/null
+++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02.1-scope-output.json
@@ -0,0 +1,34 @@
+{
+ "type": "global",
+ "variables": [
+ {
+ "name": "$$slots",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "$$props",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "$$restProps",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ }
+ ],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "module",
+ "variables": [],
+ "references": [],
+ "childScopes": [],
+ "through": []
+ }
+ ],
+ "through": []
+}
\ No newline at end of file
diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/03-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/03-output.json
index 336eb384..34d295a4 100644
--- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/03-output.json
+++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/03-output.json
@@ -103,6 +103,7 @@
}
}
},
+ "modifiers": [],
"range": [
26,
37
diff --git a/tests/fixtures/parser/ast/style-directive01-output.json b/tests/fixtures/parser/ast/style-directive01-output.json
index 6ce30f30..e86699c9 100644
--- a/tests/fixtures/parser/ast/style-directive01-output.json
+++ b/tests/fixtures/parser/ast/style-directive01-output.json
@@ -47,6 +47,7 @@
}
}
},
+ "modifiers": [],
"range": [
5,
19
@@ -196,6 +197,7 @@
}
}
},
+ "modifiers": [],
"range": [
36,
50
@@ -345,6 +347,7 @@
}
}
},
+ "modifiers": [],
"range": [
67,
81
@@ -494,6 +497,7 @@
}
}
},
+ "modifiers": [],
"range": [
96,
107
diff --git a/tests/fixtures/parser/ast/style-directive02-output.json b/tests/fixtures/parser/ast/style-directive02-output.json
index 219529ea..6f154776 100644
--- a/tests/fixtures/parser/ast/style-directive02-output.json
+++ b/tests/fixtures/parser/ast/style-directive02-output.json
@@ -47,6 +47,7 @@
}
}
},
+ "modifiers": [],
"range": [
5,
16
@@ -248,6 +249,7 @@
}
}
},
+ "modifiers": [],
"range": [
45,
56
@@ -449,6 +451,7 @@
}
}
},
+ "modifiers": [],
"range": [
85,
96
@@ -650,6 +653,7 @@
}
}
},
+ "modifiers": [],
"range": [
123,
134
diff --git a/tests/fixtures/parser/ast/style-directive03-input.svelte b/tests/fixtures/parser/ast/style-directive03-input.svelte
new file mode 100644
index 00000000..3ecabd6e
--- /dev/null
+++ b/tests/fixtures/parser/ast/style-directive03-input.svelte
@@ -0,0 +1,4 @@
+
+
diff --git a/tests/fixtures/parser/ast/style-directive03-output.json b/tests/fixtures/parser/ast/style-directive03-output.json
new file mode 100644
index 00000000..c6c16285
--- /dev/null
+++ b/tests/fixtures/parser/ast/style-directive03-output.json
@@ -0,0 +1,751 @@
+{
+ "type": "Program",
+ "body": [
+ {
+ "type": "SvelteScriptElement",
+ "name": {
+ "type": "SvelteName",
+ "name": "script",
+ "range": [
+ 1,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ },
+ "startTag": {
+ "type": "SvelteStartTag",
+ "attributes": [],
+ "selfClosing": false,
+ "range": [
+ 0,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "kind": "const",
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "id": {
+ "type": "Identifier",
+ "name": "color",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "init": {
+ "type": "Literal",
+ "raw": "'red'",
+ "value": "red",
+ "range": [
+ 27,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ }
+ },
+ "range": [
+ 19,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ }
+ }
+ ],
+ "range": [
+ 13,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ }
+ }
+ ],
+ "endTag": {
+ "type": "SvelteEndTag",
+ "range": [
+ 33,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ }
+ },
+ "range": [
+ 0,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ }
+ },
+ {
+ "type": "SvelteText",
+ "value": "\n",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "SvelteElement",
+ "kind": "html",
+ "name": {
+ "type": "SvelteName",
+ "name": "div",
+ "range": [
+ 44,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 1
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ }
+ },
+ "startTag": {
+ "type": "SvelteStartTag",
+ "attributes": [
+ {
+ "type": "SvelteStyleDirective",
+ "key": {
+ "type": "SvelteDirectiveKey",
+ "name": {
+ "type": "Identifier",
+ "name": "color",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ }
+ },
+ "modifiers": [
+ "important"
+ ],
+ "range": [
+ 48,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 5
+ },
+ "end": {
+ "line": 4,
+ "column": 26
+ }
+ }
+ },
+ "shorthand": true,
+ "value": [],
+ "range": [
+ 48,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 5
+ },
+ "end": {
+ "line": 4,
+ "column": 26
+ }
+ }
+ }
+ ],
+ "selfClosing": false,
+ "range": [
+ 43,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 28
+ }
+ }
+ },
+ "children": [],
+ "endTag": {
+ "type": "SvelteEndTag",
+ "range": [
+ 71,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 28
+ },
+ "end": {
+ "line": 4,
+ "column": 34
+ }
+ }
+ },
+ "range": [
+ 43,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 34
+ }
+ }
+ }
+ ],
+ "sourceType": "module",
+ "comments": [],
+ "tokens": [
+ {
+ "type": "Punctuator",
+ "value": "<",
+ "range": [
+ 0,
+ 1
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 1,
+ "column": 1
+ }
+ }
+ },
+ {
+ "type": "HTMLIdentifier",
+ "value": "script",
+ "range": [
+ 1,
+ 7
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 1
+ },
+ "end": {
+ "line": 1,
+ "column": 7
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ">",
+ "range": [
+ 7,
+ 8
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 7
+ },
+ "end": {
+ "line": 1,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Keyword",
+ "value": "const",
+ "range": [
+ 13,
+ 18
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 4
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "=",
+ "range": [
+ 25,
+ 26
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 16
+ },
+ "end": {
+ "line": 2,
+ "column": 17
+ }
+ }
+ },
+ {
+ "type": "String",
+ "value": "'red'",
+ "range": [
+ 27,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "<",
+ "range": [
+ 33,
+ 34
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 1
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "/",
+ "range": [
+ 34,
+ 35
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 1
+ },
+ "end": {
+ "line": 3,
+ "column": 2
+ }
+ }
+ },
+ {
+ "type": "HTMLIdentifier",
+ "value": "script",
+ "range": [
+ 35,
+ 41
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 2
+ },
+ "end": {
+ "line": 3,
+ "column": 8
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ">",
+ "range": [
+ 41,
+ 42
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 8
+ },
+ "end": {
+ "line": 3,
+ "column": 9
+ }
+ }
+ },
+ {
+ "type": "HTMLText",
+ "value": "\n",
+ "range": [
+ 42,
+ 43
+ ],
+ "loc": {
+ "start": {
+ "line": 3,
+ "column": 9
+ },
+ "end": {
+ "line": 4,
+ "column": 0
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "<",
+ "range": [
+ 43,
+ 44
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 0
+ },
+ "end": {
+ "line": 4,
+ "column": 1
+ }
+ }
+ },
+ {
+ "type": "HTMLIdentifier",
+ "value": "div",
+ "range": [
+ 44,
+ 47
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 1
+ },
+ "end": {
+ "line": 4,
+ "column": 4
+ }
+ }
+ },
+ {
+ "type": "HTMLIdentifier",
+ "value": "style",
+ "range": [
+ 48,
+ 53
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 5
+ },
+ "end": {
+ "line": 4,
+ "column": 10
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ":",
+ "range": [
+ 53,
+ 54
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 10
+ },
+ "end": {
+ "line": 4,
+ "column": 11
+ }
+ }
+ },
+ {
+ "type": "Identifier",
+ "value": "color",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "|",
+ "range": [
+ 59,
+ 60
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 16
+ },
+ "end": {
+ "line": 4,
+ "column": 17
+ }
+ }
+ },
+ {
+ "type": "HTMLIdentifier",
+ "value": "important",
+ "range": [
+ 60,
+ 69
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 17
+ },
+ "end": {
+ "line": 4,
+ "column": 26
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ">",
+ "range": [
+ 70,
+ 71
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 27
+ },
+ "end": {
+ "line": 4,
+ "column": 28
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "<",
+ "range": [
+ 71,
+ 72
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 28
+ },
+ "end": {
+ "line": 4,
+ "column": 29
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": "/",
+ "range": [
+ 72,
+ 73
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 29
+ },
+ "end": {
+ "line": 4,
+ "column": 30
+ }
+ }
+ },
+ {
+ "type": "HTMLIdentifier",
+ "value": "div",
+ "range": [
+ 73,
+ 76
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 30
+ },
+ "end": {
+ "line": 4,
+ "column": 33
+ }
+ }
+ },
+ {
+ "type": "Punctuator",
+ "value": ">",
+ "range": [
+ 76,
+ 77
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 33
+ },
+ "end": {
+ "line": 4,
+ "column": 34
+ }
+ }
+ }
+ ],
+ "range": [
+ 0,
+ 78
+ ],
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 5,
+ "column": 0
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/fixtures/parser/ast/style-directive03-scope-output.json b/tests/fixtures/parser/ast/style-directive03-scope-output.json
new file mode 100644
index 00000000..c6111112
--- /dev/null
+++ b/tests/fixtures/parser/ast/style-directive03-scope-output.json
@@ -0,0 +1,298 @@
+{
+ "type": "global",
+ "variables": [
+ {
+ "name": "$$slots",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "$$props",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ },
+ {
+ "name": "$$restProps",
+ "identifiers": [],
+ "defs": [],
+ "references": []
+ }
+ ],
+ "references": [],
+ "childScopes": [
+ {
+ "type": "module",
+ "variables": [
+ {
+ "name": "color",
+ "identifiers": [
+ {
+ "type": "Identifier",
+ "name": "color",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ }
+ ],
+ "defs": [
+ {
+ "type": "Variable",
+ "name": {
+ "type": "Identifier",
+ "name": "color",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "node": {
+ "type": "VariableDeclarator",
+ "id": {
+ "type": "Identifier",
+ "name": "color",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "init": {
+ "type": "Literal",
+ "raw": "'red'",
+ "value": "red",
+ "range": [
+ 27,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 18
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ }
+ },
+ "range": [
+ 19,
+ 32
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 23
+ }
+ }
+ }
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "color",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "from": "module",
+ "init": true,
+ "resolved": {
+ "type": "Identifier",
+ "name": "color",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ }
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "color",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ }
+ },
+ "from": "module",
+ "init": null,
+ "resolved": {
+ "type": "Identifier",
+ "name": "color",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "references": [
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "color",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ },
+ "from": "module",
+ "init": true,
+ "resolved": {
+ "type": "Identifier",
+ "name": "color",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ }
+ },
+ {
+ "identifier": {
+ "type": "Identifier",
+ "name": "color",
+ "range": [
+ 54,
+ 59
+ ],
+ "loc": {
+ "start": {
+ "line": 4,
+ "column": 11
+ },
+ "end": {
+ "line": 4,
+ "column": 16
+ }
+ }
+ },
+ "from": "module",
+ "init": null,
+ "resolved": {
+ "type": "Identifier",
+ "name": "color",
+ "range": [
+ 19,
+ 24
+ ],
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 15
+ }
+ }
+ }
+ }
+ ],
+ "childScopes": [],
+ "through": []
+ }
+ ],
+ "through": []
+}
\ No newline at end of file