diff --git a/frontend/.oxlintrc.json b/frontend/.oxlintrc.json index b5ef63ba9d..da3e94f832 100644 --- a/frontend/.oxlintrc.json +++ b/frontend/.oxlintrc.json @@ -265,7 +265,8 @@ "shared/**/*.{js,mjs,jsx,ts,tsx}" ], "rules": { - "typescript/no-explicit-any": "error" + "typescript/no-explicit-any": "error", + "typescript/no-unnecessary-type-assertion": "error" }, "env": { "browser": true @@ -285,7 +286,8 @@ "editor/src/core/utils/**/*.{js,mjs,jsx,ts,tsx}" ], "rules": { - "typescript/no-explicit-any": "off" + "typescript/no-explicit-any": "off", + "typescript/no-unnecessary-type-assertion": "off" } }, { diff --git a/frontend/eslint.config.mjs b/frontend/eslint.config.mjs index 81698ddde6..642d17a9e3 100644 --- a/frontend/eslint.config.mjs +++ b/frontend/eslint.config.mjs @@ -161,7 +161,7 @@ export default defineConfig( ], }, }, - // Stricter rules that not all sub-folders are conformant to yet. + // Stricter rules that not all sub-folders are conformant to yet { files: srcGlobs, ignores: [ @@ -195,8 +195,15 @@ export default defineConfig( "editor/src/core/types/*.{js,mjs,jsx,ts,tsx}", "editor/src/core/utils/*.{js,mjs,jsx,ts,tsx}", ], + languageOptions: { + parserOptions: { + project: true, + tsconfigRootDir: import.meta.dirname, + }, + }, rules: { "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/no-unnecessary-type-assertion": "error", }, }, // Config for browser scripts diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 30a0cb2556..5bc12a35cb 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -123,6 +123,7 @@ "msw-storybook-addon": "^2.0.7", "oxfmt": "0.55.0", "oxlint": "1.70.0", + "oxlint-tsgolint": "0.23.0", "postcss": "^8.5.12", "postcss-cli": "^11.0.1", "postcss-preset-mantine": "^1.18.0", @@ -3487,6 +3488,90 @@ "node": "^20.19.0 || >=22.12.0" } }, + "node_modules/@oxlint-tsgolint/darwin-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@oxlint-tsgolint/darwin-arm64/-/darwin-arm64-0.23.0.tgz", + "integrity": "sha512-gOs9PVr2wEg4ox9z0aJo+RKhhImW86YL5N6yav8BK/rgPsIrwN/igSZ+pbRr723NFvUNKde9fgMhRA6JrXAOZw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxlint-tsgolint/darwin-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@oxlint-tsgolint/darwin-x64/-/darwin-x64-0.23.0.tgz", + "integrity": "sha512-kjJ8B+7n4tB9VJdxS5A9GdJt6/bYpzbu4lXp2uO1S3sRmCB5gDEABlGoiePNApRWaW+xqL4b4xgiE727jSLhuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxlint-tsgolint/linux-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@oxlint-tsgolint/linux-arm64/-/linux-arm64-0.23.0.tgz", + "integrity": "sha512-6dCZuKNu135seMXilkRk9SpCx6i1XgmiipYGalLij5WVRX6ZYS8c4xI7preN/zv9fCXhsQclTIMDu2Y/cytTjw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxlint-tsgolint/linux-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@oxlint-tsgolint/linux-x64/-/linux-x64-0.23.0.tgz", + "integrity": "sha512-3bdilnyA7kmSTjK27rvjIjSxL5SIg3wt7vwNiRkouWB83ytssyKnuGvxSYJxgMEmFpSutzaBzcCUM2jDtPGcgA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxlint-tsgolint/win32-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@oxlint-tsgolint/win32-arm64/-/win32-arm64-0.23.0.tgz", + "integrity": "sha512-j+OEp44SVYiQ+ZD+uttsX7u6L9SvmbbQ77SO1pSFCcJlsVMeCk8qZsjhKfGKuT/jIA+ipOJMVs/+pqUfObBWNw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@oxlint-tsgolint/win32-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@oxlint-tsgolint/win32-x64/-/win32-x64-0.23.0.tgz", + "integrity": "sha512-5MyjFuqf+g8OUPJBSGWHJtmoWnzFJYyOg4To9WMQshZYEWig/vtu7JtJ03VWnzHv9LJkAUeApY0gVCOywFR/iQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@oxlint/binding-android-arm-eabi": { "version": "1.70.0", "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.70.0.tgz", @@ -13407,6 +13492,24 @@ } } }, + "node_modules/oxlint-tsgolint": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/oxlint-tsgolint/-/oxlint-tsgolint-0.23.0.tgz", + "integrity": "sha512-3mBv3CoPbh8dFbzfDGIWa2ytZjn2v+3EX4aKRXjIhsoGFzG8GCjfRirz3rwZf1wYbZzsNLTSgpw8VjQuWdp/jA==", + "dev": true, + "license": "MIT", + "bin": { + "tsgolint": "bin/tsgolint.js" + }, + "optionalDependencies": { + "@oxlint-tsgolint/darwin-arm64": "0.23.0", + "@oxlint-tsgolint/darwin-x64": "0.23.0", + "@oxlint-tsgolint/linux-arm64": "0.23.0", + "@oxlint-tsgolint/linux-x64": "0.23.0", + "@oxlint-tsgolint/win32-arm64": "0.23.0", + "@oxlint-tsgolint/win32-x64": "0.23.0" + } + }, "node_modules/p-cancelable": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-4.0.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index 780327fe6a..606bc0b787 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -144,6 +144,7 @@ "msw-storybook-addon": "^2.0.7", "oxfmt": "0.55.0", "oxlint": "1.70.0", + "oxlint-tsgolint": "0.23.0", "postcss": "^8.5.12", "postcss-cli": "^11.0.1", "postcss-preset-mantine": "^1.18.0",