Skip to content

Commit

Permalink
fix(typescript): import/named errors when using TypeScript (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
odanado committed Oct 24, 2021
1 parent 035fbea commit 401d626
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
10 changes: 9 additions & 1 deletion packages/eslint-config-typescript/index.js
Expand Up @@ -14,5 +14,13 @@ module.exports = {

// https://github.com/typescript-eslint/typescript-eslint/blob/1cf9243/docs/getting-started/linting/FAQ.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
'no-undef': 'off'
}
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
},
},
}
3 changes: 2 additions & 1 deletion packages/eslint-config-typescript/package.json
Expand Up @@ -14,7 +14,8 @@
"dependencies": {
"@nuxtjs/eslint-config": "6.0.1",
"@typescript-eslint/eslint-plugin": "^4.26.1",
"@typescript-eslint/parser": "^4.26.1"
"@typescript-eslint/parser": "^4.26.1",
"eslint-import-resolver-typescript": "2.4.0"
},
"peerDependencies": {
"eslint": "^7.28.0"
Expand Down
13 changes: 12 additions & 1 deletion yarn.lock
Expand Up @@ -2773,6 +2773,17 @@ eslint-import-resolver-node@^0.3.4:
debug "^2.6.9"
resolve "^1.13.1"

eslint-import-resolver-typescript@2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.4.0.tgz#ec1e7063ebe807f0362a7320543aaed6fe1100e1"
integrity sha512-useJKURidCcldRLCNKWemr1fFQL1SzB3G4a0li6lFGvlc5xGe1hY343bvG07cbpCzPuM/lK19FIJB3XGFSkplA==
dependencies:
debug "^4.1.1"
glob "^7.1.6"
is-glob "^4.0.1"
resolve "^1.17.0"
tsconfig-paths "^3.9.0"

eslint-module-utils@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz#b51be1e473dd0de1c5ea638e22429c2490ea8233"
Expand Down Expand Up @@ -5926,7 +5937,7 @@ resolve-from@^5.0.0:
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"
integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==

resolve@^1.1.6, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.13.1, resolve@^1.20.0:
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.20.0:
version "1.20.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
Expand Down

0 comments on commit 401d626

Please sign in to comment.