Skip to content

Instantly share code, notes, and snippets.

@mrv1k
Last active September 23, 2022 16:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrv1k/f472db1054f35e1179b0eedd0d7fcb94 to your computer and use it in GitHub Desktop.
Save mrv1k/f472db1054f35e1179b0eedd0d7fcb94 to your computer and use it in GitHub Desktop.
Resolve path starting "@/*". eslint-plugin-import / eslint-import-resolver-webpack
/**
* Good article to read what is `@` in `.vue` files
* {@link https://www.jerriepelser.com/blog/til-at-symbol-javascript-import/}
*
* More on `import/no-unresolved` rule:
* {@link https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/no-unresolved.md#ignore}
*/
// `/` is just for sanity and can be ommited.
// Add this line to your .eslint.rc
'import/no-unresolved': [2, { ignore: ['^@\/'] }],
// If you import `.js` files using `@` import is gonna complain again. So you need to update `extensions` rule as well.
'import/extensions': [2, {
'js': 'never',
'vue': 'always'
}],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment