diff --git a/apps/site/eslint.config.js b/apps/site/eslint.config.js index 0b037775a849a..c4f873a2ae4ad 100644 --- a/apps/site/eslint.config.js +++ b/apps/site/eslint.config.js @@ -1,4 +1,5 @@ import { FlatCompat } from '@eslint/eslintrc'; +import importX from 'eslint-plugin-import-x'; import * as mdx from 'eslint-plugin-mdx'; import react from 'eslint-plugin-react'; import storybook from 'eslint-plugin-storybook'; @@ -22,9 +23,17 @@ const compatConfig = compat.config({ export default tseslint.config( ...baseConfig, { - extends: [react.configs.flat['jsx-runtime'], ...compatConfig], + extends: [ + react.configs.flat['jsx-runtime'], + ...tseslint.configs.recommended, + importX.flatConfigs.typescript, + ...compatConfig, + ], files: ['**/*.{js,md,mdx,mjs,ts,tsx}'], rules: { + '@typescript-eslint/array-type': ['error', { default: 'generic' }], + '@typescript-eslint/consistent-type-imports': 'error', + '@typescript-eslint/no-require-imports': 'off', '@next/next/no-duplicate-head': 'off', }, settings: { @@ -48,7 +57,7 @@ export default tseslint.config( { files: ['**/*.{mdx,tsx}'], rules: { - // '@typescript-eslint/consistent-type-definitions': ['error', 'type'], + '@typescript-eslint/consistent-type-definitions': ['error', 'type'], 'react/no-unescaped-entities': 'off', 'react/function-component-definition': [ 'error', diff --git a/apps/site/package.json b/apps/site/package.json index 121fa2fe3c47d..6a8c96f255997 100644 --- a/apps/site/package.json +++ b/apps/site/package.json @@ -104,6 +104,7 @@ "@types/react-dom": "^18.3.0", "@types/semver": "~7.5.8", "eslint-config-next": "~14.2.11", + "eslint-import-resolver-typescript": "~3.6.3", "eslint-plugin-mdx": "~3.1.5", "eslint-plugin-react": "~7.36.1", "eslint-plugin-react-hooks": "5.1.0-rc-4c58fce7-20240904", @@ -120,6 +121,7 @@ "stylelint-order": "6.0.4", "stylelint-selector-bem-pattern": "4.0.1", "typescript": "~5.5.4", + "typescript-eslint": "~8.5.0", "user-agent-data-types": "0.4.2" } } diff --git a/eslint.config.js b/eslint.config.js index afbbd233c9c24..a0bc7ab6b65ac 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -17,20 +17,12 @@ export default tseslint.config( ], }, { - extends: [ - js.configs.recommended, - importX.flatConfigs.recommended, - importX.flatConfigs.typescript, - ...tseslint.configs.recommended, - ], + extends: [js.configs.recommended, importX.flatConfigs.recommended], files: ['**/*.{js,mjs,ts,tsx}'], plugins: { 'no-relative-import-paths': noRelativeImportPaths, }, rules: { - '@typescript-eslint/array-type': ['error', { default: 'generic' }], - '@typescript-eslint/consistent-type-imports': 'error', - '@typescript-eslint/no-require-imports': 'off', 'import-x/namespace': 'off', 'import-x/no-named-as-default-member': 'off', 'import-x/no-unresolved': 'off', diff --git a/package-lock.json b/package-lock.json index a7be76573fe87..81568c53ca372 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,13 +21,10 @@ "commitizen": "4.3.0", "cz-conventional-changelog": "3.3.0", "eslint": "~9.10.0", - "eslint-import-resolver-typescript": "~3.6.3", "eslint-plugin-import-x": "~4.2.1", "eslint-plugin-no-relative-import-paths": "~1.5.5", "prettier": "3.3.3", - "prettier-plugin-tailwindcss": "0.6.6", - "typescript": "~5.5.4", - "typescript-eslint": "~8.5.0" + "prettier-plugin-tailwindcss": "0.6.6" }, "engines": { "node": "v20" @@ -105,6 +102,7 @@ "@types/react-dom": "^18.3.0", "@types/semver": "~7.5.8", "eslint-config-next": "~14.2.11", + "eslint-import-resolver-typescript": "~3.6.3", "eslint-plugin-mdx": "~3.1.5", "eslint-plugin-react": "~7.36.1", "eslint-plugin-react-hooks": "5.1.0-rc-4c58fce7-20240904", @@ -121,6 +119,7 @@ "stylelint-order": "6.0.4", "stylelint-selector-bem-pattern": "4.0.1", "typescript": "~5.5.4", + "typescript-eslint": "~8.5.0", "user-agent-data-types": "0.4.2" }, "engines": { @@ -30496,7 +30495,9 @@ "packages/i18n": { "name": "@node-core/website-i18n", "devDependencies": { - "typescript": "~5.5.4" + "eslint-import-resolver-typescript": "~3.6.3", + "typescript": "~5.5.4", + "typescript-eslint": "~8.5.0" }, "engines": { "node": ">=20" diff --git a/package.json b/package.json index f2d51a4de6793..d6093abd1562c 100644 --- a/package.json +++ b/package.json @@ -46,13 +46,10 @@ "commitizen": "4.3.0", "cz-conventional-changelog": "3.3.0", "eslint": "~9.10.0", - "eslint-import-resolver-typescript": "~3.6.3", "eslint-plugin-import-x": "~4.2.1", "eslint-plugin-no-relative-import-paths": "~1.5.5", "prettier": "3.3.3", - "prettier-plugin-tailwindcss": "0.6.6", - "typescript": "~5.5.4", - "typescript-eslint": "~8.5.0" + "prettier-plugin-tailwindcss": "0.6.6" }, "overrides": { "eslint-config-next": { diff --git a/packages/i18n/eslint.config.js b/packages/i18n/eslint.config.js index 22a0f2751b254..d5146991db352 100644 --- a/packages/i18n/eslint.config.js +++ b/packages/i18n/eslint.config.js @@ -1,4 +1,17 @@ +import importX from 'eslint-plugin-import-x'; +import tseslint from 'typescript-eslint'; + // eslint-disable-next-line no-relative-import-paths/no-relative-import-paths import baseConfig from '../../eslint.config.js'; -export default [...baseConfig]; +export default [ + ...baseConfig, + ...tseslint.configs.recommended, + importX.flatConfigs.typescript, + { + rules: { + '@typescript-eslint/array-type': ['error', { default: 'generic' }], + '@typescript-eslint/consistent-type-imports': 'error', + }, + }, +]; diff --git a/packages/i18n/package.json b/packages/i18n/package.json index c19c38ba616eb..dbb6e98bd303a 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -19,6 +19,8 @@ "node": ">=20" }, "devDependencies": { - "typescript": "~5.5.4" + "eslint-import-resolver-typescript": "~3.6.3", + "typescript": "~5.5.4", + "typescript-eslint": "~8.5.0" } }