chore: upgrade eslint 9 (#24002)
* add eslint package * upgrade lint * remove linting for generated files from trpc * ts imports * add missing features lint script * enable turbo ui * reference workspace deps correctly * fixes * Fix eslint test * Fix eslint test * npm run all back * fix e2e * fix e2e * fix e2e --------- Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
1 parent
57150d992e
commit
96855ea391
155 files changed
+1918
-1495
No files matched your search
@@ -1,2 +0,0 @@
|
||||
node_modules
|
||||
public/embed
|
||||
@@ -0,0 +1,3 @@
|
||||
import { nextJsConfig } from "@calcom/eslint-config/next-js";
|
||||
|
||||
export default [...nextJsConfig];
|
||||
+16
-15
@@ -20,8 +20,8 @@
|
||||
"copy-app-store-static": "node scripts/copy-app-store-static.js",
|
||||
"build": "turbo run copy-app-store-static && next build && yarn sentry:release",
|
||||
"start": "next start",
|
||||
"lint": "eslint . --ignore-path .gitignore",
|
||||
"lint:fix": "eslint . --ext .ts,.js,.tsx,.jsx --fix",
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"lint:report": "eslint . --format json --output-file ../../lint-results/web.json",
|
||||
"check-changed-files": "ts-node scripts/ts-check-changed-files.ts",
|
||||
"translate-locales": "ts-node scripts/check-missing-translations.ts",
|
||||
@@ -32,20 +32,20 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@boxyhq/saml-jackson": "1.52.2",
|
||||
"@calcom/app-store": "*",
|
||||
"@calcom/app-store-cli": "*",
|
||||
"@calcom/dayjs": "*",
|
||||
"@calcom/app-store": "workspace:*",
|
||||
"@calcom/app-store-cli": "workspace:*",
|
||||
"@calcom/dayjs": "workspace:*",
|
||||
"@calcom/embed-core": "workspace:*",
|
||||
"@calcom/embed-react": "workspace:*",
|
||||
"@calcom/embed-snippet": "workspace:*",
|
||||
"@calcom/features": "*",
|
||||
"@calcom/lib": "*",
|
||||
"@calcom/platform-enums": "*",
|
||||
"@calcom/platform-types": "*",
|
||||
"@calcom/prisma": "*",
|
||||
"@calcom/trpc": "*",
|
||||
"@calcom/tsconfig": "*",
|
||||
"@calcom/ui": "*",
|
||||
"@calcom/features": "workspace:*",
|
||||
"@calcom/lib": "workspace:*",
|
||||
"@calcom/platform-enums": "workspace:*",
|
||||
"@calcom/platform-types": "workspace:*",
|
||||
"@calcom/prisma": "workspace:*",
|
||||
"@calcom/trpc": "workspace:*",
|
||||
"@calcom/tsconfig": "workspace:*",
|
||||
"@calcom/ui": "workspace:*",
|
||||
"@daily-co/daily-js": "^0.83.1",
|
||||
"@daily-co/daily-react": "^0.23.2",
|
||||
"@dub/analytics": "^0.0.27",
|
||||
@@ -158,8 +158,9 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.19.6",
|
||||
"@calcom/config": "*",
|
||||
"@calcom/types": "*",
|
||||
"@calcom/config": "workspace:*",
|
||||
"@calcom/eslint-config": "workspace:*",
|
||||
"@calcom/types": "workspace:*",
|
||||
"@microsoft/microsoft-graph-types-beta": "0.15.0-preview",
|
||||
"@playwright/test": "^1.45.3",
|
||||
"@testing-library/react": "^13.3.0",
|
||||
|
||||
@@ -60,7 +60,6 @@ test.describe("Embed Code Generator Tests", () => {
|
||||
});
|
||||
|
||||
// To prevent early timeouts
|
||||
// eslint-disable-next-line playwright/no-wait-for-timeout
|
||||
await page.waitForTimeout(1000);
|
||||
await expectToContainValidPreviewIframe(page, {
|
||||
embedType: "inline",
|
||||
@@ -98,7 +97,6 @@ test.describe("Embed Code Generator Tests", () => {
|
||||
});
|
||||
|
||||
// To prevent early timeouts
|
||||
// eslint-disable-next-line playwright/no-wait-for-timeout
|
||||
await page.waitForTimeout(1000);
|
||||
await expectToContainValidPreviewIframe(page, {
|
||||
embedType: "floating-popup",
|
||||
@@ -136,7 +134,6 @@ test.describe("Embed Code Generator Tests", () => {
|
||||
});
|
||||
|
||||
// To prevent early timeouts
|
||||
// eslint-disable-next-line playwright/no-wait-for-timeout
|
||||
await page.waitForTimeout(1000);
|
||||
await expectToContainValidPreviewIframe(page, {
|
||||
embedType: "element-click",
|
||||
@@ -176,7 +173,6 @@ test.describe("Embed Code Generator Tests", () => {
|
||||
});
|
||||
|
||||
// To prevent early timeouts
|
||||
// eslint-disable-next-line playwright/no-wait-for-timeout
|
||||
await page.waitForTimeout(1000);
|
||||
await expectToContainValidPreviewIframe(page, {
|
||||
embedType: "inline",
|
||||
@@ -234,7 +230,6 @@ test.describe("Embed Code Generator Tests", () => {
|
||||
});
|
||||
|
||||
// To prevent early timeouts
|
||||
// eslint-disable-next-line playwright/no-wait-for-timeout
|
||||
await page.waitForTimeout(1000);
|
||||
await expectToContainValidPreviewIframe(page, {
|
||||
embedType: "inline",
|
||||
@@ -275,7 +270,6 @@ test.describe("Embed Code Generator Tests", () => {
|
||||
});
|
||||
|
||||
// To prevent early timeouts
|
||||
// eslint-disable-next-line playwright/no-wait-for-timeout
|
||||
await page.waitForTimeout(1000);
|
||||
await expectToContainValidPreviewIframe(page, {
|
||||
embedType: "floating-popup",
|
||||
@@ -315,7 +309,6 @@ test.describe("Embed Code Generator Tests", () => {
|
||||
});
|
||||
|
||||
// To prevent early timeouts
|
||||
// eslint-disable-next-line playwright/no-wait-for-timeout
|
||||
await page.waitForTimeout(1000);
|
||||
await expectToContainValidPreviewIframe(page, {
|
||||
embedType: "element-click",
|
||||
@@ -333,8 +326,7 @@ function chooseEmbedType(page: Page, embedType: EmbedType) {
|
||||
}
|
||||
|
||||
async function goToReactCodeTab(page: Page) {
|
||||
// To prevent early timeouts
|
||||
// eslint-disable-next-line playwright/no-wait-for-timeout
|
||||
// To prevent early timeo
|
||||
await page.waitForTimeout(1000);
|
||||
await page.locator("[data-testid=horizontal-tab-react]").click();
|
||||
}
|
||||
@@ -343,7 +335,7 @@ async function clickEmbedButton(page: Page) {
|
||||
const embedButton = page.locator("[data-testid=embed]");
|
||||
const embedUrl = await embedButton.getAttribute("data-test-embed-url");
|
||||
embedButton.click();
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
|
||||
return embedUrl!;
|
||||
}
|
||||
|
||||
@@ -439,18 +431,24 @@ async function expectValidHtmlEmbedSnippet(
|
||||
}
|
||||
|
||||
function assertThatCodeIsValidVanillaJsCode(code: string) {
|
||||
const lintResult = linter.verify(code, {
|
||||
env: {
|
||||
browser: true,
|
||||
const lintResult = linter.verify(code, [
|
||||
{
|
||||
languageOptions: {
|
||||
ecmaVersion: 2021,
|
||||
sourceType: "module",
|
||||
parserOptions: { ecmaFeatures: { jsx: true } },
|
||||
globals: {
|
||||
window: "readonly",
|
||||
document: "readonly",
|
||||
navigator: "readonly",
|
||||
Cal: "readonly",
|
||||
console: "readonly",
|
||||
},
|
||||
},
|
||||
rules: eslintRules,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2021,
|
||||
},
|
||||
globals: {
|
||||
Cal: "readonly",
|
||||
},
|
||||
rules: eslintRules,
|
||||
});
|
||||
]);
|
||||
|
||||
if (lintResult.length) {
|
||||
console.log(
|
||||
JSON.stringify({
|
||||
@@ -459,23 +457,35 @@ function assertThatCodeIsValidVanillaJsCode(code: string) {
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
expect(lintResult.length).toBe(0);
|
||||
}
|
||||
|
||||
function assertThatCodeIsValidReactCode(code: string) {
|
||||
const lintResult = linter.verify(code, {
|
||||
env: {
|
||||
browser: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2021,
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
const lintResult = linter.verify(code, [
|
||||
{
|
||||
languageOptions: {
|
||||
ecmaVersion: 2021,
|
||||
sourceType: "module",
|
||||
parserOptions: {
|
||||
ecmaFeatures: { jsx: true },
|
||||
},
|
||||
globals: {
|
||||
window: "readonly",
|
||||
document: "readonly",
|
||||
navigator: "readonly",
|
||||
console: "readonly",
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
...eslintRules,
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
"no-undef": "off",
|
||||
semi: "off",
|
||||
},
|
||||
sourceType: "module",
|
||||
},
|
||||
rules: eslintRules,
|
||||
});
|
||||
]);
|
||||
|
||||
if (lintResult.length) {
|
||||
console.log(
|
||||
JSON.stringify({
|
||||
@@ -484,6 +494,7 @@ function assertThatCodeIsValidReactCode(code: string) {
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
expect(lintResult.length).toBe(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user