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

chore(supersearch, lxl-querylang): Format and lint code (missed by husky) #1162

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion packages/codemirror-lang-lxlquery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"test": "vitest",
"prepare": "cd ../../ && husky && cd ./packages/codemirror-lang-lxlquery && rollup -c",
"lint": "eslint . && prettier --check .",
"lint": "eslint . && prettier --check .",
"format": "prettier --write ."
},
"lint-staged": {
Expand Down
5 changes: 4 additions & 1 deletion packages/codemirror-lang-lxlquery/test/grammar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ for (const file of fs.readdirSync(caseDir)) {
const name = /^[^.]*/.exec(file)?.[0];
if (name) {
describe(name, () => {
for (const { name, run } of fileTests(fs.readFileSync(path.join(caseDir, file), 'utf8'), file))
for (const { name, run } of fileTests(
fs.readFileSync(path.join(caseDir, file), 'utf8'),
file
))
it(name, () => run(lxlQueryLanguage.parser));
});
}
Expand Down
6 changes: 3 additions & 3 deletions packages/codemirror-lang-lxlquery/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
include: ['**/*.{test,spec}.{js,ts}']
}
test: {
include: ['**/*.{test,spec}.{js,ts}']
}
});
22 changes: 15 additions & 7 deletions packages/supersearch/e2e/supersearch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@ test.beforeEach(async ({ page }) => {
});

test('submits closest form on enter key press', async ({ page }) => {
await page.locator('[data-test-id="test1"]').getByRole('textbox').locator('div').fill('hello world')
await page.keyboard.press('Enter');
await expect(page).toHaveURL('/test1?q=hello+world')
await page
.locator('[data-test-id="test1"]')
.getByRole('textbox')
.locator('div')
.fill('hello world');
await page.keyboard.press('Enter');
await expect(page).toHaveURL('/test1?q=hello+world');
});

test('submits form identified by form attribute on enter key press', async ({ page }) => {
await page.locator('[data-test-id="test2"]').getByRole('textbox').locator('div').fill('hello world')
await page.keyboard.press('Enter');
await expect(page).toHaveURL('/test2?q=hello+world')
});
await page
.locator('[data-test-id="test2"]')
.getByRole('textbox')
.locator('div')
.fill('hello world');
await page.keyboard.press('Enter');
await expect(page).toHaveURL('/test2?q=hello+world');
});
2 changes: 1 addition & 1 deletion packages/supersearch/src/lib/components/CodeMirror.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
};

let {
value = '', // value isn't bindable as it can easily cause undo/redo history issues when changing the value from outside – it's preferable to dispatch changes instead
value = '', // value isn't bindable as it can easily cause undo/redo history issues when changing the value from outside – it's preferable to dispatch changes instead
extensions = [],
onchange = () => {},
editorView = $bindable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EditorView, keymap } from '@codemirror/view';

/**
* CodeMirror extension that submits form elements (either the closest or by specified id using the `form` attribute) on enter keypresses.
*
*
* @param {string} form Optional id of the `<form>` element with which the form control should be associated with (equivalent with
* the [form attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#form) on HTML Input elements).
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/supersearch/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import SuperSearch from '$lib/components/SuperSearch.svelte';

export { SuperSearch }
export { SuperSearch };
2 changes: 1 addition & 1 deletion packages/supersearch/src/routes/test1/+page.svelte
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<h1>A test route</h1>
<h1>A test route</h1>
2 changes: 1 addition & 1 deletion packages/supersearch/src/routes/test2/+page.svelte
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<h1>Another test route</h1>
<h1>Another test route</h1>
Loading