Skip to content

Commit b7556f4

Browse files
authored
format js files in quickwit-ui (#5981)
* Add biome formatting for quickwit-ui js files * Fix quickwit-ui files formatting * Add ci step to check js file formatting
1 parent d6a1418 commit b7556f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1872
-1193
lines changed

.github/workflows/ui-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
yarn --cwd quickwit-ui cypress run
3939
- name: Lint
4040
command: yarn --cwd quickwit-ui lint
41+
- name: Check formatting
42+
command: yarn --cwd quickwit-ui check-formatting
4143
- name: Unit Test
4244
command: yarn --cwd quickwit-ui test
4345
services:

quickwit/quickwit-ui/.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

quickwit/quickwit-ui/.prettierrc.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

quickwit/quickwit-ui/biome.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"formatter": {
4+
"enabled": true,
5+
"indentStyle": "space",
6+
"includes": ["**", "!**/build"]
7+
},
8+
"linter": { "enabled": false }
9+
}

quickwit/quickwit-ui/config-overrides.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
15+
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
1616

1717
module.exports = function override(config, env) {
18-
config.plugins.push(new MonacoWebpackPlugin({
19-
languages: ['json']
20-
}));
18+
config.plugins.push(
19+
new MonacoWebpackPlugin({
20+
languages: ["json"],
21+
}),
22+
);
2123
return config;
22-
}
23-
24+
};

quickwit/quickwit-ui/cypress/e2e/homepage.spec.cy.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,23 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
describe('Home navigation', () => {
16-
it('Should display sidebar links', () => {
17-
cy.visit('http://127.0.0.1:7280/ui');
18-
cy.get('a')
19-
.should('be.visible')
20-
.should('contain.text', 'Query editor')
21-
.should('contain.text', 'Indexes')
22-
.should('contain.text', 'Cluster');
15+
describe("Home navigation", () => {
16+
it("Should display sidebar links", () => {
17+
cy.visit("http://127.0.0.1:7280/ui");
18+
cy.get("a")
19+
.should("be.visible")
20+
.should("contain.text", "Query editor")
21+
.should("contain.text", "Indexes")
22+
.should("contain.text", "Cluster");
2323
});
24-
it('Should navigate to cluster state', () => {
25-
cy.visit('http://127.0.0.1:7280/ui');
26-
cy.get('a').contains('Cluster').click();
27-
cy.get('p').should('contain.text', 'Cluster');
28-
cy.get('span').should('contain.text', 'cluster_id');
24+
it("Should navigate to cluster state", () => {
25+
cy.visit("http://127.0.0.1:7280/ui");
26+
cy.get("a").contains("Cluster").click();
27+
cy.get("p").should("contain.text", "Cluster");
28+
cy.get("span").should("contain.text", "cluster_id");
2929
});
30-
it('Should display otel logs index page', () => {
31-
cy.visit('http://127.0.0.1:7280/ui/indexes/otel-logs-v0_7');
32-
cy.get('a')
33-
.should('be.visible')
34-
.should('contain.text', 'Indexes')
30+
it("Should display otel logs index page", () => {
31+
cy.visit("http://127.0.0.1:7280/ui/indexes/otel-logs-v0_7");
32+
cy.get("a").should("be.visible").should("contain.text", "Indexes");
3533
});
36-
})
34+
});

quickwit/quickwit-ui/cypress/plugins/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
module.exports = (on, config) => {
2020
// `on` is used to hook into various events Cypress emits
2121
// `config` is the resolved Cypress config
22-
}
22+
};

quickwit/quickwit-ui/cypress/support/e2e.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// ***********************************************************
1515

1616
// Import commands.js using ES2015 syntax:
17-
import './commands'
17+
import "./commands";
1818

1919
// Alternatively you can use CommonJS syntax:
20-
// require('./commands')
20+
// require('./commands')

quickwit/quickwit-ui/cypress/support/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
// ***********************************************************
1515

1616
// Import commands.js using ES2015 syntax:
17-
import './commands'
17+
import "./commands";
1818

1919
// Alternatively you can use CommonJS syntax:
2020
// require('./commands')
2121

22-
Cypress.on('uncaught:exception', (err, runnable) => {
22+
Cypress.on("uncaught:exception", (err, runnable) => {
2323
// we expect a 3rd party library error with message 'list not defined'
2424
// and don't want to fail the test so we return false
25-
if (err.message.includes('monaco-editor')) {
26-
return false
25+
if (err.message.includes("monaco-editor")) {
26+
return false;
2727
}
2828
// we still want to ensure there are no other unexpected
2929
// errors, so we let them fail the test
30-
})
30+
});

quickwit/quickwit-ui/mocks/monacoMock.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import * as React from 'react';
15+
import * as React from "react";
1616

1717
// Mock MonocoEditor as the current jest setup does not work when Monaco JS files
1818
// are loaded.
1919
export default function MonacoEditor(props) {
2020
return <div>{props.value}</div>;
2121
}
22-

0 commit comments

Comments
 (0)