Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/eslint-plugin-vue
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.2.2
Choose a base ref
...
head repository: vuejs/eslint-plugin-vue
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.0.0
Choose a head ref
Loading
Showing 636 changed files with 51,081 additions and 7,143 deletions.
44 changes: 43 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ workflows:
- node-v8
- node-v10
- node-v12
- node-v14
- lint

version: 2
jobs:
@@ -31,9 +33,23 @@ jobs:
command: npm test

node-v8:
<<: *node-base
docker:
- image: node:8
steps:
- run:
name: Versions
command: npm version
- checkout
- run:
name: Install eslint@6
command: |
npm install -D eslint@6.2.0
- run:
name: Install dependencies
command: npm install
- run:
name: Test
command: npm test
node-v10:
<<: *node-base
docker:
@@ -42,3 +58,29 @@ jobs:
<<: *node-base
docker:
- image: node:12
node-v14:
<<: *node-base
docker:
- image: node:14

lint:
docker:
- image: node:14
steps:
- run:
name: Versions
command: npm version
- checkout
- restore_cache:
keys:
- v2-npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
- run:
name: Install dependencies
command: npm install
- save_cache:
key: v2-npm-lock-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }}
paths:
- node_modules
- run:
name: Test
command: npm run lint
150 changes: 128 additions & 22 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,144 @@
'use strict'

module.exports = {
// https://github.com/eslint/eslint/issues/11888
root: false,
root: true,
parserOptions: {
ecmaVersion: 6
ecmaVersion: 2018
},
env: {
es6: true,
node: true,
mocha: true
},
extends: [
'plugin:eslint-plugin/recommended',
'plugin:vue-libs/recommended'
],
plugins: [
'eslint-plugin'
],
extends: ['plugin:eslint-plugin/recommended', 'prettier'],
plugins: ['eslint-plugin', 'prettier'],
rules: {
'eslint-plugin/report-message-format': ['error', '^[A-Z`\'{].*\\.$'],
'accessor-pairs': 2,
camelcase: [2, { properties: 'never' }],
'constructor-super': 2,
eqeqeq: [2, 'allow-null'],
'handle-callback-err': [2, '^(err|error)$'],
'jsx-quotes': [2, 'prefer-single'],
'new-cap': [2, { newIsCap: true, capIsNew: false }],
'new-parens': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 2,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
'no-eval': 2,
'no-ex-assign': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-parens': [2, 'functions'],
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implied-eval': 2,
'no-inner-declarations': [2, 'functions'],
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': [2, { allowLoop: false, allowSwitch: false }],
'no-lone-blocks': 2,
'no-multi-spaces': [2, { ignoreEOLComments: true }],
'no-multi-str': 2,
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new-object': 2,
'no-new-require': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-return-assign': [2, 'except-parens'],
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-undef': 2,
'no-undef-init': 2,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': [2, { defaultAssignment: false }],
'no-unreachable': 2,
'no-unsafe-finally': 2,
'no-unused-vars': [2, { vars: 'all', args: 'none' }],
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-with': 2,
'one-var': [2, { initialized: 'never' }],
'use-isnan': 2,
'valid-typeof': 2,
'wrap-iife': [2, 'any'],
yoda: [2, 'never'],
'prefer-const': 2,

'prettier/prettier': 'error',
'eslint-plugin/report-message-format': ['error', "^[A-Z`'{].*\\.$"],
'eslint-plugin/prefer-placeholders': 'error',
'eslint-plugin/consistent-output': 'error',
'no-mixed-operators': 'error'

'no-debugger': 'error',
'no-console': 'error',
'no-alert': 'error',
'no-void': 'error',

'no-warning-comments': 'warn',
'no-var': 'error',
'prefer-template': 'error',
'object-shorthand': 'error',
'prefer-rest-params': 'error',
'prefer-arrow-callback': 'error',
'prefer-spread': 'error',

'dot-notation': 'error'
},
overrides: [
{
files: ['./**/*.vue'],
parser: require.resolve('vue-eslint-parser'),
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module'
}
},
{
files: ['lib/rules/*.js'],
rules: {
'consistent-docs-description': 'error',
'no-invalid-meta': 'error',
'no-invalid-meta-docs-categories': 'error',
'eslint-plugin/require-meta-type': 'error',
'require-meta-docs-url': [
'error',
{
pattern: `https://eslint.vuejs.org/rules/{{name}}.html`
}
],

overrides: [{
files: ['lib/rules/*.js'],
rules: {
"consistent-docs-description": "error",
"no-invalid-meta": "error",
'eslint-plugin/require-meta-type': 'error',
"require-meta-docs-url": ["error", {
"pattern": `https://eslint.vuejs.org/rules/{{name}}.html`
}]
'eslint-plugin/fixer-return': 'off'
}
}
}]
]
}
34 changes: 27 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
---
name: Bug report
about: Create a report to help us improve

---

<!--
❗Please don't ignore this template.❗
If you ignore it, we're just going to respond asking you to fill it out, which wastes everyone's time.
The more relevant information you can include, the faster we can find the issue and fix it without asking you for more info.
-->

<!--
Before posting the issue, please confirm that the problem you're getting
is not related with your code editor configuration.
To make sure it's not, run: yarn eslint src/your-file.vue
-->

**Tell us about your environment**
* **ESLint version:**
* **eslint-plugin-vue version:**
* **Node version:**
**Checklist**

- [ ] I have tried restarting my IDE and the issue persists.
- [ ] I have read the [FAQ](https://eslint.vuejs.org/user-guide/#faq) and my problem is not listed.
<!-- If you do not read the FAQ and open an issue that is listed in the FAQ, we may silently close the issue. -->

**Tell us about your environment**

- **ESLint version:**
- **eslint-plugin-vue version:**
- **Node version:**
- **Operating System:**

**Please show your full configuration:**
<!-- Paste content of your .eslintrc file -->
```json
```json5

```

@@ -31,4 +45,10 @@ about: Create a report to help us improve


**What actually happened?**
<!-- Please include the actual, raw output from ESLint. -->
<!--
Please include the actual, raw output from ESLint.
If you are only looking at the results of your editor extension, also check the CLI results.
-->

**Repository to reproduce this issue**

26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: "Non-rule change request"
about: Request a change that is not a bug fix, rule change, or new rule
---

<!--
Before proposing changes, please make sure it hasn't been posted already.
You can see all open propositions here:
https://github.com/vuejs/eslint-plugin-vue/issues?q=is%3Aopen+is%3Aissue+label%3A%22new+rule+proposition%22
-->

**Tell us about your environment**

- **ESLint version:**
- **eslint-plugin-vue version:**
- **Node version:**

**The problem you want to solve.**


**Your take on the correct solution to problem.**


**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->

31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/rule-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: "Rule change request"
about: Request a change to an existing rule
---

<!--
Before proposing rule changes, please make sure it hasn't been posted already.
You can see all open propositions here:
https://github.com/vuejs/eslint-plugin-vue/issues?q=is%3Aopen+is%3Aissue+label%3A%22new+rule+proposition%22
-->

**What rule do you want to change?**

**Does this change cause the rule to produce more or fewer warnings?**

**How will the change be implemented? (New option, new default behavior, etc.)?**

**Please provide some example code that this change will affect:**

<!-- Put your code examples here -->
```vue
```

**What does the rule currently do for this code?**

**What will the rule do after it's changed?**

**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->

11 changes: 6 additions & 5 deletions .github/ISSUE_TEMPLATE/rule-proposal.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Rule Proposal
about: Suggest an idea for a new rule

---

<!--
@@ -15,15 +14,17 @@ about: Suggest an idea for a new rule

**What category should the rule belong to?**
<!-- (place an "X" next to just one item) -->
- [ ] Enforces code style
- [ ] Warns about a potential error
- [ ] Suggests an alternate way of doing something
- [ ] Other (please specify:)
[ ] Enforces code style (layout)
[ ] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)

**Provide 2-3 code examples that this rule should warn about:**

```vue
```

**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,3 +8,4 @@
yarn.lock
yarn-error.log
docs/.vuepress/dist
typings/eslint/lib/rules
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
semi: false
singleQuote: true
printWidth: 80
trailingComma: none
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@
"eslint.validate": [
"javascript",
"javascriptreact",
{ "language": "vue", "autoFix": true }
]
"vue"
],
"typescript.tsdk": "node_modules/typescript/lib",
"vetur.validation.script": false
}
Loading