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

Biome migration #2736

Merged
merged 76 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
534832b
Remove eslint in taiko
zabil Jul 26, 2024
8fc68cf
Functional tests biome migration
zabil Jul 26, 2024
5c31d54
Apply biome formatting
zabil Jul 31, 2024
ec19f4b
Disable linting till errors are fixed
zabil Jul 31, 2024
f580474
Unsafe formatting for actions
zabil Jul 31, 2024
ad159db
Optimize attach code to avoid re-assignment
zabil Jul 31, 2024
ccab92e
Remove comma
zabil Jul 31, 2024
f869825
Remove parameter re-assingment
zabil Jul 31, 2024
77ff417
Avoid parameter re-assignment
zabil Jul 31, 2024
61a0dea
Remove parameter re-assignment
zabil Jul 31, 2024
34e738d
Re-define variables
zabil Aug 7, 2024
1dc0fc4
Fix assignment
zabil Aug 7, 2024
ba99d91
Formating changes
zabil Aug 7, 2024
7de368e
Remove parameter re-assignment
zabil Aug 7, 2024
6929d1c
Do not re-assign options and into
zabil Aug 7, 2024
4849ac5
Rename variables
zabil Aug 7, 2024
24d2c75
Fix biome suggestions
zabil Aug 7, 2024
0b9836f
Change assignment expression
zabil Aug 7, 2024
551b751
For for of instead of forEach
zabil Aug 7, 2024
5cbbaba
Fix parameter re-assignment
zabil Aug 7, 2024
d20a8da
Fix parameter re-assignment
zabil Aug 7, 2024
f8923fd
Fix biome suggestions
zabil Aug 7, 2024
3e41e29
Fix biome suggestions
zabil Aug 7, 2024
4ea2e1b
More biome suggestions
zabil Aug 7, 2024
4362624
Use ternary operator
zabil Aug 7, 2024
cc01ba7
Avoid paramater re-assignment
zabil Aug 7, 2024
ca45790
Use optional chaining and literal keys
zabil Aug 7, 2024
af85636
Remove else clause
zabil Aug 7, 2024
a377e92
Ignore Number.isNaN
zabil Aug 7, 2024
2e17e0d
Add ts node and typescript dependencies
zabil Aug 8, 2024
170e385
Add package lock json
zabil Aug 9, 2024
3e66693
Run only on ubuntu
zabil Aug 9, 2024
6b9e599
Fix linting issues
zabil Aug 9, 2024
28af895
Fix lint issues
zabil Aug 9, 2024
9a7e1f6
Fix lint issues
zabil Aug 9, 2024
d1f1a20
Fix lint issues
zabil Aug 9, 2024
94804f7
Remove flakiness in test
zabil Aug 8, 2024
1be21e6
Fix formatting
zabil Aug 8, 2024
95ea4f6
Apply recommended lint fixes
zabil Aug 8, 2024
d6889cf
Formatting fixes
zabil Aug 8, 2024
acc8fe8
use for of instead of foreach
zabil Aug 8, 2024
6393099
Generic linting fixes
zabil Aug 12, 2024
3a81d52
Add the else if blocks
zabil Aug 13, 2024
7794957
Avoid paramater re-assignment
zabil Aug 13, 2024
5930989
Fix paramater re-assignment
zabil Aug 13, 2024
b28bf3e
Fix formatting
zabil Aug 13, 2024
69da4ff
Fix parameter re-assignment
zabil Aug 13, 2024
6b6437c
Fix lint suggestions
zabil Aug 13, 2024
8c554cb
Fix paramater re-assignments
zabil Aug 13, 2024
f691835
Fix paramater re-assignment in openTab
zabil Aug 13, 2024
13c419d
Avoid parameter re-assignment in open incognito
zabil Aug 13, 2024
3d7b6c4
Do not re-assign paramaters
zabil Aug 22, 2024
a3f9b71
Remove paramater re-assignment
zabil Aug 22, 2024
d8cc290
Remove paramameter re-assignment for keys
zabil Aug 22, 2024
8ac2509
Remove parameter re-assignment
zabil Aug 22, 2024
4de9022
Use function instead of eval
zabil Aug 22, 2024
ea93385
Ignore recommendation
zabil Aug 22, 2024
24302e3
Remove paramater re-assignment
zabil Aug 22, 2024
ea6e099
Optimize dialog handler
zabil Aug 22, 2024
6838613
Refactor to avoid paramater re-assignment
zabil Aug 22, 2024
ae52037
Refactor to remove re-assignment
zabil Aug 22, 2024
52548d3
Remove the parameter re-assignment
zabil Aug 22, 2024
5b833e8
Format fixes
zabil Aug 22, 2024
6094ae8
Remove use of eval
zabil Aug 22, 2024
4adf177
Ignore biome suggestions
zabil Aug 22, 2024
df43a57
Use for of
zabil Aug 22, 2024
acd4d83
Remove paramater re-assignment
zabil Aug 22, 2024
57dad3a
Remove paramater assignment
zabil Aug 22, 2024
aa67d42
Remove static methods
zabil Aug 22, 2024
fd6764c
Remove control characters from regex
zabil Aug 22, 2024
429f23c
Fix lint issues
zabil Aug 23, 2024
6900d3d
Fix lint issues
zabil Aug 23, 2024
d6e8937
Add linting to pipeline
zabil Aug 23, 2024
0ebb1bd
Ignore folders
zabil Aug 23, 2024
c44afba
Use biome action
zabil Aug 23, 2024
47ce6f9
Ignore api.json formatting
zabil Aug 23, 2024
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
59 changes: 29 additions & 30 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
const tocPlugin = require('eleventy-plugin-toc');
const tocPlugin = require("eleventy-plugin-toc");
const markdownIt = require("markdown-it");
const CleanCSS = require("clean-css");

module.exports = function (eleventyConfig) {

module.exports = (eleventyConfig) => {
eleventyConfig.addPassthroughCopy("docs/assets");
eleventyConfig.addFilter("cssmin", function(code) {
return new CleanCSS({}).minify(code).styles;
});
eleventyConfig.addFilter(
"cssmin",
(code) => new CleanCSS({}).minify(code).styles,
);
// This filter is used for deriving the chapter names
// from data in chapters.json
eleventyConfig.addFilter('heading', function (str) {
return str.replace(/[_;\\/:*?\"<>|&']/g, " ");
});
eleventyConfig.addFilter("heading", (str) =>
str.replace(/[_;\\/:*?\"<>|&']/g, " "),
);

// Filter for linking to section headers
// and displaying chapters in a page
let markdownItAnchor = require("markdown-it-anchor");
let mdIt = markdownIt({
html: true,
linkify: true
})
.use(markdownItAnchor, {
permalink: true,
permalinkBefore: false,
permalinkClass: "direct-link",
permalinkSymbol: "#",
level: [1, 2]
});
eleventyConfig.addFilter("markdown", function(code) {
if(code) {
return mdIt.render(code);
}
const markdownItAnchor = require("markdown-it-anchor");
const mdIt = markdownIt({
html: true,
linkify: true,
}).use(markdownItAnchor, {
permalink: true,
permalinkBefore: false,
permalinkClass: "direct-link",
permalinkSymbol: "#",
level: [1, 2],
});
eleventyConfig.addFilter("markdown", (code) => {
if (code) {
return mdIt.render(code);
}
});
eleventyConfig.setLibrary("md", mdIt);
eleventyConfig.addPlugin(tocPlugin);

return {
dir: {
input: 'docs',
output: 'docs/_site'
}
}
};
input: "docs",
output: "docs/_site",
},
};
};
13 changes: 8 additions & 5 deletions .github/workflows/taiko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: install
run: npm install
- name: install browser dependencies
Expand All @@ -41,7 +45,7 @@ jobs:
libasound-dev
- name: unit-tests
run: |
npm run lint:check
biome ci
npm test

functional-tests:
Expand Down Expand Up @@ -139,7 +143,7 @@ jobs:

docs-tests:
needs: unit-tests
name: Docs tests - ${{ matrix.os }}
name: Docs tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -150,7 +154,6 @@ jobs:
- name: install
run: npm install
- name: install browser dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
Expand All @@ -171,11 +174,11 @@ jobs:
uses: actions/upload-artifact@v1
if: failure()
with:
name: docs-tests-reports-${{ matrix.os }}
name: docs-tests-reports
path: test/docs-tests/gauge/reports/html-report
- name: Upload logs
uses: actions/upload-artifact@v1
if: failure()
with:
name: docs-tests-logs-${{ matrix.os }}
name: docs-tests-logs
path: test/docs-tests/gauge/logs
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ test-script.js
test/docs-tests/tmp/
test/docs-tests/lib/
test/docs-tests/gauge/.vscode
test/docs-tests/gauge/package-lock.json
test/docs-tests/gauge/reports/
test/docs-tests/gauge/.gauge/
test/package-lock.json
38 changes: 22 additions & 16 deletions bin/runFile.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
const path = require('path');
const util = require('util');
const recorder = require('../recorder');
const path = require("node:path");
const util = require("node:util");
const recorder = require("../recorder");

const { removeQuotes } = require('../lib/util');
const { removeQuotes } = require("../lib/util");
module.exports = async (taiko, file, observe, observeTime, continueRepl) => {
const realFuncs = {};
for (let func in taiko) {
for (const func in taiko) {
realFuncs[func] = taiko[func];
if (realFuncs[func].constructor.name === 'AsyncFunction') {
if (realFuncs[func].constructor.name === "AsyncFunction") {
global[func] = async function () {
let res,
args = arguments;
if (func === 'openBrowser' && (observe || continueRepl)) {
if (args['0']) {
args['0'].headless = !observe;
// biome-ignore lint/style/noArguments: Cannot use rest paramaters
let args = arguments;
if (func === "openBrowser" && (observe || continueRepl)) {
if (args["0"]) {
args["0"].headless = !observe;
args[0].observe = observe;
args['0'].observeTime = observeTime;
args["0"].observeTime = observeTime;
} else if (continueRepl) {
args = [
{
Expand All @@ -35,11 +35,12 @@ module.exports = async (taiko, file, observe, observeTime, continueRepl) => {
}
}

res = await realFuncs[func].apply(this, args);
const res = await realFuncs[func].apply(this, args);
return res;
};
} else if (realFuncs[func].constructor.name === 'Function') {
} else if (realFuncs[func].constructor.name === "Function") {
global[func] = function () {
// biome-ignore lint/style/noArguments: Cannot use rest paramaters
return realFuncs[func].apply(this, arguments);
};
} else {
Expand All @@ -48,15 +49,20 @@ module.exports = async (taiko, file, observe, observeTime, continueRepl) => {
if (continueRepl) {
recorder.repl = async () => {
console.log(
removeQuotes(util.inspect('Starting REPL..', { colors: true }), 'Starting REPL..'),
removeQuotes(
util.inspect("Starting REPL..", { colors: true }),
"Starting REPL..",
),
);
await continueRepl(file);
};
}
require.cache[path.join(__dirname, 'taiko.js')].exports[func] = global[func];
require.cache[path.join(__dirname, "taiko.js")].exports[func] =
global[func];
}
const oldNodeModulesPaths = module.constructor._nodeModulePaths;
module.constructor._nodeModulePaths = function () {
// biome-ignore lint/style/noArguments: Cannot use rest paramaters
const ret = oldNodeModulesPaths.apply(this, arguments);
ret.push(__dirname);
ret.push(path.dirname(path.dirname(__dirname)));
Expand Down
Loading