summaryrefslogtreecommitdiff
path: root/eslint.config.js
diff options
context:
space:
mode:
authorPascal Birchler <[email protected]>2025-07-22 00:22:13 +0100
committerGitHub <[email protected]>2025-07-21 23:22:13 +0000
commit97cf26ec5301f7b4552a5e89214a13e4b714b9eb (patch)
tree5d173310b3300fcbadf14388d8cdda283685d2a1 /eslint.config.js
parent01ea0b8657a748760de4919c2459a22bfdad4e46 (diff)
fix(eslint): remove custom rule in favor of `eslint-plugin-import` (#3012)
Co-authored-by: Sandy Tao <[email protected]>
Diffstat (limited to 'eslint.config.js')
-rw-r--r--eslint.config.js37
1 files changed, 15 insertions, 22 deletions
diff --git a/eslint.config.js b/eslint.config.js
index 29aa23dc..169bbd17 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -12,7 +12,6 @@ import prettierConfig from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import globals from 'globals';
import licenseHeader from 'eslint-plugin-license-header';
-import noRelativeCrossPackageImports from './eslint-rules/no-relative-cross-package-imports.js';
import path from 'node:path'; // Use node: prefix for built-ins
import url from 'node:url';
@@ -34,7 +33,6 @@ export default tseslint.config(
'packages/core/dist/**',
'packages/server/dist/**',
'packages/vscode-ide-companion/dist/**',
- 'eslint-rules/*',
'bundle/**',
],
},
@@ -72,6 +70,14 @@ export default tseslint.config(
{
// General overrides and rules for the project (TS/TSX files)
files: ['packages/*/src/**/*.{ts,tsx}'], // Target only TS/TSX in the cli package
+ plugins: {
+ import: importPlugin,
+ },
+ settings: {
+ 'import/resolver': {
+ node: true,
+ },
+ },
languageOptions: {
globals: {
...globals.node,
@@ -106,6 +112,13 @@ export default tseslint.config(
caughtErrorsIgnorePattern: '^_',
},
],
+ 'import/no-internal-modules': [
+ 'error',
+ {
+ allow: ['react-dom/test-utils', 'memfs/lib/volume.js', 'yargs/**'],
+ },
+ ],
+ 'import/no-relative-packages': 'error',
'no-cond-assign': 'error',
'no-debugger': 'error',
'no-duplicate-case': 'error',
@@ -213,24 +226,4 @@ export default tseslint.config(
],
},
},
- // Custom eslint rules for this repo
- {
- files: ['packages/**/*.{js,jsx,ts,tsx}'],
- plugins: {
- custom: {
- rules: {
- 'no-relative-cross-package-imports': noRelativeCrossPackageImports,
- },
- },
- },
- rules: {
- // Enable and configure your custom rule
- 'custom/no-relative-cross-package-imports': [
- 'error',
- {
- root: path.join(projectRoot, 'packages'),
- },
- ],
- },
- },
);