Skip to content
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

Linting support for hds-code-editor modifier and component #2715

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b7395f6
working on initial linting plugin
zamoore Feb 19, 2025
1eb850b
working on linting
zamoore Feb 20, 2025
6ea4d16
Add `lintGutter`
alex-ju Feb 21, 2025
3397427
cleaning up after debugging linting issues
zamoore Feb 21, 2025
10f22f0
json linting works pretty well
zamoore Feb 21, 2025
d2f0293
working on the json linter
zamoore Feb 24, 2025
05ac3c9
linting logic is in
zamoore Feb 27, 2025
d6d1d9e
the linting drawer opens with the key command now
zamoore Feb 28, 2025
fb36cb7
working on lint tooltip styling
zamoore Feb 28, 2025
06ea6ad
working on styline the linting elements
zamoore Mar 3, 2025
b9b0d44
updating tooltip styles
zamoore Mar 3, 2025
2855192
updating styles for linting drawer
zamoore Mar 4, 2025
f34eb02
working on styles for the panel close button
zamoore Mar 4, 2025
dadccec
drawer diagnostic finished styling
zamoore Mar 4, 2025
876ca47
styling the selected panel
zamoore Mar 4, 2025
c9f9cee
finalized code editor UI
zamoore Mar 4, 2025
24692fa
enable the minimum height of the editor only if linting is enabled
zamoore Mar 4, 2025
900be46
increased close button size
zamoore Mar 4, 2025
3115abd
added unit tests for linting methods
zamoore Mar 4, 2025
9d49d90
working on documentation
zamoore Mar 4, 2025
399b6a7
updating docs
zamoore Mar 4, 2025
f4d245a
responding to design feedback
zamoore Mar 5, 2025
f684452
revert changest to website
zamoore Mar 6, 2025
f601cf0
added missing dependency to showcase for tests
zamoore Mar 6, 2025
f13e484
fixing test
zamoore Mar 6, 2025
ac8596f
pr cleanup
zamoore Mar 7, 2025
7755ad1
cleaning up types and imports
zamoore Mar 7, 2025
5cfcab9
cleaned up PR
zamoore Mar 7, 2025
9996115
added changeset
zamoore Mar 7, 2025
b3fff15
cleaned up PR
zamoore Mar 7, 2025
3897372
fixed linting drawer display issue
zamoore Mar 7, 2025
c7194b6
fixing border colors
zamoore Mar 7, 2025
62711d0
Apply suggestions from code review
zamoore Mar 13, 2025
e13e01d
added extra padding to linter bottom for accessibility reasons
zamoore Mar 18, 2025
544180e
stacking the linting panel
zamoore Mar 18, 2025
4ca5444
merging main
zamoore Mar 19, 2025
2818a5f
responding to pr feedback
zamoore Mar 19, 2025
de61c19
added new behavior and tests when closing the linting panel
zamoore Mar 20, 2025
d994b8f
addressing pr feedback
zamoore Mar 20, 2025
2fb5574
merge main
zamoore Mar 21, 2025
680fc2e
fixed focus issue
zamoore Mar 21, 2025
a42869b
responding to pr feedback
zamoore Mar 21, 2025
42295a9
fixing test
zamoore Mar 21, 2025
69d8817
fixing test
zamoore Mar 21, 2025
563a4ed
removed test that didn't work in CI
zamoore Mar 21, 2025
1ca241a
removed test that didn't work in CI
zamoore Mar 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/odd-flowers-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@hashicorp/design-system-components": minor
---

`hds-code-editor` modifier - Added `isLintingEnabled` and `onLint` named arguments. Linting is supported for the JSON language.

`CodeEditor` - Added `@isLintingEnabled` and `@onLint` arguments that are passed to the `hds-code-editor` modifier

Dependencies - Added `@codemirror/lint`
2 changes: 2 additions & 0 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@
"@codemirror/lang-yaml": "^6.1.2",
"@codemirror/language": "^6.10.3",
"@codemirror/legacy-modes": "^6.4.2",
"@codemirror/lint": "^6.8.4",
"@codemirror/state": "^6.5.0",
"@codemirror/view": "^6.36.2",
"@ember/render-modifiers": "^2.1.0",
@@ -334,6 +335,7 @@
"./modifiers/hds-code-editor/highlight-styles/hds-dark-highlight-style.js": "./dist/_app_/modifiers/hds-code-editor/highlight-styles/hds-dark-highlight-style.js",
"./modifiers/hds-code-editor/languages/rego.js": "./dist/_app_/modifiers/hds-code-editor/languages/rego.js",
"./modifiers/hds-code-editor/languages/sentinel.js": "./dist/_app_/modifiers/hds-code-editor/languages/sentinel.js",
"./modifiers/hds-code-editor/linters/json-linter.js": "./dist/_app_/modifiers/hds-code-editor/linters/json-linter.js",
"./modifiers/hds-code-editor/palettes/hds-dark-palette.js": "./dist/_app_/modifiers/hds-code-editor/palettes/hds-dark-palette.js",
"./modifiers/hds-code-editor/themes/hds-dark-theme.js": "./dist/_app_/modifiers/hds-code-editor/themes/hds-dark-theme.js",
"./modifiers/hds-code-editor/types.js": "./dist/_app_/modifiers/hds-code-editor/types.js",
Original file line number Diff line number Diff line change
@@ -57,11 +57,13 @@
ariaLabelledBy=this.ariaLabelledBy
extraKeys=@extraKeys
hasLineWrapping=@hasLineWrapping
isLintingEnabled=@isLintingEnabled
language=@language
value=@value
onBlur=@onBlur
onInput=this.onInput
onSetup=this.onSetup
onLint=@onLint
}}
/>

Loading
Oops, something went wrong.