UNPKG

1.82 kBMarkdownView Raw
1# `@vue/eslint-config-standard`
2
3ESLint [Shareable Configs](https://eslint.org/docs/latest/extend/shareable-configs) for [JavaScript Standard Style](http://standardjs.com) in [Vue.js](https://vuejs.org/) Projects
4
5This config is specifically designed to be used by `create-vue` setups
6and is not meant for outside use (it can be used but some adaptations
7on the user side might be needed - for details see the config file).
8
9A part of its design is that this config may implicitly depend on
10other parts of `create-vue` setups, such as `eslint-plugin-vue` being
11extended in the same resulting config.
12
13> [!NOTE]
14> The current version doesn't support the legacy `.eslintrc*` configuration format. For that you need to use version 13 or earlier. See the [corresponding README](https://www.npmjs.com/package/@vue/eslint-config-standard/v/legacy-eslintrc) for more usage instructions.
15
16## Installation
17
18```sh
19npm add --dev @vue/eslint-config-standard
20```
21
22## Usage
23
24An example `eslint.config.js`:
25
26```js
27import pluginVue from "eslint-plugin-vue";
28import standard from "@vue/eslint-config-standard";
29
30export default [
31 ...pluginVue.configs["flat/essential"],
32 ...standard,
33]
34```
35
36## Aliases
37
38By default, none of the built-in rules require you to configure aliases in ESLint.
39
40But if you want to enable some additional rules that need to actually resolve the imported module on the filesystem (e.g. [`import-x/no-unresolved`](https://github.com/import-js/eslint-plugin-import/blob/v2.26.0/docs/rules/no-unresolved.md)) by yourself and need path aliases to be resolved, please make sure configure them in your `jsconfig.json` or `tsconfig.json` file. We use [eslint-import-resolver-next](https://github.com/kuoruan/eslint-import-resolver-next) as the default resolver, which will automatically detect path aliases in these files.