-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add fixes for block-lang rule #844
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
937acbc
feat: Add fixes for block-lang rule
Winter 989922a
Merge remote-tracking branch 'origin/main' into feat/block-lang-fix
baseballyama 22e440d
suggestion
baseballyama 8d30e32
update
baseballyama 988fe74
fix
baseballyama aab069b
revert
baseballyama 8ad1bf0
update fixture
baseballyama b4aa903
update fixture
baseballyama 0199ecf
update fixture
baseballyama 2e96f17
update fixture
baseballyama f67546e
support null
baseballyama a9c64a4
refactor
baseballyama 2d0b3ab
sentence
baseballyama 983a9f5
update
baseballyama 6dba947
add changeset
baseballyama File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'eslint-plugin-svelte': minor | ||
--- | ||
|
||
feat: Added suggestion to the `block-lang` rule. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
...ixtures/rules/block-lang/invalid/script/javascript/javascript-as-style-lang01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
- message: The lang attribute of the <script> block should be "javascript". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Add lang attribute to a <script> block with the value "javascript". | ||
output: | | ||
<script lang="javascript"></script> | ||
|
||
<style lang="javascript"></style> | ||
5 changes: 4 additions & 1 deletion
5
...-plugin-svelte/tests/fixtures/rules/block-lang/invalid/script/javascript/js01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
- message: The lang attribute of the <script> block should be "javascript". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Replace a <script> block with the lang attribute set to "javascript". | ||
output: | | ||
<script lang="javascript"></script> |
5 changes: 4 additions & 1 deletion
5
...lugin-svelte/tests/fixtures/rules/block-lang/invalid/script/javascript/null01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
- message: The lang attribute of the <script> block should be "javascript". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Add lang attribute to a <script> block with the value "javascript". | ||
output: | | ||
<script lang="javascript"></script> |
5 changes: 4 additions & 1 deletion
5
...-plugin-svelte/tests/fixtures/rules/block-lang/invalid/script/javascript/ts01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
- message: The lang attribute of the <script> block should be "javascript". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Replace a <script> block with the lang attribute set to "javascript". | ||
output: | | ||
<script lang="javascript"></script> |
5 changes: 4 additions & 1 deletion
5
...svelte/tests/fixtures/rules/block-lang/invalid/script/javascript/typescript01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
- message: The lang attribute of the <script> block should be "javascript". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Replace a <script> block with the lang attribute set to "javascript". | ||
output: | | ||
<script lang="javascript"></script> |
5 changes: 4 additions & 1 deletion
5
...-plugin-svelte/tests/fixtures/rules/block-lang/invalid/script/js/javascript01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
- message: The lang attribute of the <script> block should be "js". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Replace a <script> block with the lang attribute set to "js". | ||
output: | | ||
<script lang="js"></script> |
7 changes: 6 additions & 1 deletion
7
...n-svelte/tests/fixtures/rules/block-lang/invalid/script/js/js-as-style-lang01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
- message: The lang attribute of the <script> block should be "js". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Add lang attribute to a <script> block with the value "js". | ||
output: | | ||
<script lang="js"></script> | ||
|
||
<style lang="js"></style> |
5 changes: 4 additions & 1 deletion
5
...eslint-plugin-svelte/tests/fixtures/rules/block-lang/invalid/script/js/null01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
- message: The lang attribute of the <script> block should be "js". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Add lang attribute to a <script> block with the value "js". | ||
output: | | ||
<script lang="js"></script> |
5 changes: 4 additions & 1 deletion
5
...s/eslint-plugin-svelte/tests/fixtures/rules/block-lang/invalid/script/js/ts01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
- message: The lang attribute of the <script> block should be "js". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Replace a <script> block with the lang attribute set to "js". | ||
output: | | ||
<script lang="js"></script> |
5 changes: 4 additions & 1 deletion
5
...-plugin-svelte/tests/fixtures/rules/block-lang/invalid/script/js/typescript01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
- message: The lang attribute of the <script> block should be "js". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Replace a <script> block with the lang attribute set to "js". | ||
output: | | ||
<script lang="js"></script> |
7 changes: 6 additions & 1 deletion
7
...te/tests/fixtures/rules/block-lang/invalid/script/module-context/javascript01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
- message: The lang attribute of the <script> block should be "ts". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Replace a <script> block with the lang attribute set to "ts". | ||
output: | | ||
<script context="module" lang="ts"></script> | ||
|
||
<script lang="ts"></script> |
7 changes: 6 additions & 1 deletion
7
...gin-svelte/tests/fixtures/rules/block-lang/invalid/script/module-context/js01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
- message: The lang attribute of the <script> block should be "ts". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Replace a <script> block with the lang attribute set to "ts". | ||
output: | | ||
<script context="module" lang="ts"></script> | ||
|
||
<script lang="ts"></script> |
7 changes: 6 additions & 1 deletion
7
...n-svelte/tests/fixtures/rules/block-lang/invalid/script/module-context/null01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
- message: The lang attribute of the <script> block should be "ts". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Add lang attribute to a <script> block with the value "ts". | ||
output: | | ||
<script lang="ts" context="module"></script> | ||
|
||
<script lang="ts"></script> |
9 changes: 8 additions & 1 deletion
9
...ts/fixtures/rules/block-lang/invalid/script/module-context/ts-as-style-lang01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
- message: The lang attribute of the <script> block should be "ts". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Add lang attribute to a <script> block with the value "ts". | ||
output: | | ||
<script lang="ts" context="module"></script> | ||
|
||
<script lang="ts"></script> | ||
|
||
<style lang="ts"></style> |
7 changes: 6 additions & 1 deletion
7
...te/tests/fixtures/rules/block-lang/invalid/script/module-context/typescript01-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
- message: The lang attribute of the <script> block should be "ts". | ||
line: 1 | ||
column: 1 | ||
suggestions: null | ||
suggestions: | ||
- desc: Replace a <script> block with the lang attribute set to "ts". | ||
output: | | ||
<script context="module" lang="ts"></script> | ||
|
||
<script lang="ts"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong. I will fix this but I need to go outside now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon carefully reviewing the test cases, this is correct.😇