Skip to content

Commit

Permalink
parser や resolver を require.resolve で解決する
Browse files Browse the repository at this point in the history
  • Loading branch information
susisu committed Oct 6, 2024
1 parent f70fffd commit 83522f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ function config(options, configs) {
'import/extensions': ['.js', '.jsx', '.cjs', '.mjs', '.ts', '.tsx', '.cts', '.mts'],
'import/external-module-folders': ['node_modules', 'node_modules/@types'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx', '.cts', '.mts'],
[require.resolve('@typescript-eslint/parser')]: ['.ts', '.tsx', '.cts', '.mts'],
},
'import/resolver': {
node: {
[require.resolve('eslint-import-resolver-node')]: {
extensions: ['.js', '.jsx', '.cjs', '.mjs', '.ts', '.tsx', '.cts', '.mts'],
},
typescript: {
[require.resolve('eslint-import-resolver-typescript')]: {
alwaysTryTypes: true,
},
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"@typescript-eslint/eslint-plugin": "^8.8.0",
"@typescript-eslint/parser": "^8.8.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-node": "^0.3.9",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
Expand Down
15 changes: 9 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 83522f8

Please sign in to comment.