diff --git a/.eslintignore b/.eslintignore index 9bb8b51c8..e0072d13e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,4 @@ node_modules -lib/recommended-rules.js +lib/*-rules.js coverage .nyc_output diff --git a/.gitignore b/.gitignore index f5ee9df9b..a56cde83a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /tests/integrations/*/node_modules /node_modules /test.* +yarn.lock diff --git a/README.md b/README.md index 62121c2e1..1803aff7b 100644 --- a/README.md +++ b/README.md @@ -75,87 +75,109 @@ Vue.component('AsyncComponent', (resolve, reject) => { ## :gear: Configs This plugin provides two predefined configs: -- `plugin:vue/base` - contains necessary settings for this plugin to work properly -- `plugin:vue/recommended` - extends base config with recommended rules (the ones with check mark :white_check_mark: in the table below) +- `plugin:vue/base` - Settings and rules to enable correct ESLint parsing +- `plugin:vue/essential` - Above, plus rules to prevent errors or unintended behavior +- `plugin:vue/strongly-recommended` - Above, plus rules to considerably improve code readability and/or dev experience +- `plugin:vue/recommended` - Above, plus rules to enforce subjective community defaults to ensure consistency ## :bulb: Rules -Rules are grouped by category to help you understand their purpose. +Rules are grouped by priority to help you understand their purpose. The `--fix` option on the command line automatically fixes problems reported by rules which have a wrench :wrench: below. -No rules are enabled by `plugin:vue/base` config. The `plugin:vue/recommended` config enables rules that report common problems, which have a check mark :white_check_mark: below. + -The `--fix` option on the command line automatically fixes problems reported by rules which have a wrench :wrench: below. +### Base Rules (Enabling Correct ESLint Parsing) - +Enforce all the rules in this category, as well as all higher priority rules, with: -### Possible Errors +``` json +"extends": "plugin:vue/base" +``` | | Rule ID | Description | |:---|:--------|:------------| +| | [jsx-uses-vars](./docs/rules/jsx-uses-vars.md) | prevent variables used in JSX to be marked as unused | + + +### Priority A: Essential (Error Prevention) + +Enforce all the rules in this category, as well as all higher priority rules, with: + +``` json +"extends": "plugin:vue/essential" +``` + +| | Rule ID | Description | +|:---|:--------|:------------| +| | [no-async-in-computed-properties](./docs/rules/no-async-in-computed-properties.md) | disallow asynchronous actions in computed properties | | | [no-dupe-keys](./docs/rules/no-dupe-keys.md) | disallow duplication of field names | -| :white_check_mark: | [no-parsing-error](./docs/rules/no-parsing-error.md) | disallow parsing errors in ` + + +