diff --git a/.eslintrc.js b/.eslintrc.js index 288e497b178120..461db17e5bc181 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,9 +10,11 @@ module.exports = { parserOptions: detectDeprecations ? { - project: './tsconfig.json', + project: './tsconfig.eslint.json', } - : {}, + : { + project: './tsconfig.eslint.json' + }, globals: { require: false, @@ -22,6 +24,8 @@ module.exports = { jest: true, }, rules: { + '@typescript-eslint/consistent-type-exports': ['error'], + '@typescript-eslint/await-thenable': ['error'], 'react-hooks/exhaustive-deps': [ 'error', {additionalHooks: '(useEffectAfterFirstRender|useMemoWithPrevious)'}, diff --git a/package.json b/package.json index e586d93ae7c736..27d3ea1e10ed87 100644 --- a/package.json +++ b/package.json @@ -168,7 +168,7 @@ "terser-webpack-plugin": "^5.3.10", "ts-node": "^10.9.2", "tslib": "^2.6.3", - "typescript": "^5.5.2", + "typescript": "5.5.3", "u2f-api": "1.0.10", "url-loader": "^4.1.1", "webpack": "5.91.0", @@ -222,7 +222,7 @@ "test-precommit": "node scripts/test.js --bail --findRelatedTests -u", "test-staged": "node scripts/test.js --findRelatedTests $(git diff --name-only --cached)", "lint": "yarn lint:biome && yarn lint:prettier && yarn lint:js && yarn lint:css", - "lint:js": "eslint . --ext .js,.ts,.tsx", + "lint:js": "TSESTREE_SINGLE_RUN=\"true\" eslint ./static/app --ext .ts,.tsx", "lint:css": "stylelint '**/*.[jt]sx'", "lint:biome": "biome check .", "lint:prettier": "prettier \"**/*.md\" \"**/*.yaml\" \"**/*.[jt]s(x)?\" --check --log-level=error", diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json new file mode 100644 index 00000000000000..c775fe32fff00a --- /dev/null +++ b/tsconfig.eslint.json @@ -0,0 +1,24 @@ +{ + "extends": "./config/tsconfig.base.json", + "compilerOptions": { + "allowJs": true + }, + "include": + [ + ".eslintrc.js", + "static/app", + "tests/js", + "config", + "scripts", + "webpack.config.ts", + "babel.config.ts", + "jest.config.ts", + "src/sentry/templates/sentry/js-sdk-loader.ts", + "api-docs/watch.ts", + "api-docs/openapi-diff.ts", + "api-docs/index.ts", + "build-utils/sentry-instrumentation.ts", + "build-utils/last-built-plugin.ts", + ], + "exclude": ["**/node_modules"] +} diff --git a/yarn.lock b/yarn.lock index 6d91823204cd37..afd8310a03c2a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11612,7 +11612,12 @@ typescript-template-language-service-decorator@^2.3.2: resolved "https://registry.yarnpkg.com/typescript-template-language-service-decorator/-/typescript-template-language-service-decorator-2.3.2.tgz#095c1b5ea88c839d9b202fad3ec8c87c1b062953" integrity sha512-hN0zNkr5luPCeXTlXKxsfBPlkAzx86ZRM1vPdL7DbEqqWoeXSxplACy98NpKpLmXsdq7iePUzAXloCAoPKBV6A== -typescript@^5.3.3, typescript@^5.5.2: +typescript@5.5.3: + version "5.5.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.3.tgz#e1b0a3c394190838a0b168e771b0ad56a0af0faa" + integrity sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ== + +typescript@^5.3.3: version "5.5.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.2.tgz#c26f023cb0054e657ce04f72583ea2d85f8d0507" integrity sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==