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: antfu/eslint-config
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.8.0
Choose a base ref
...
head repository: antfu/eslint-config
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.8.1
Choose a head ref
  • 3 commits
  • 15 files changed
  • 1 contributor

Commits on Mar 11, 2024

  1. chore: update deps

    antfu committed Mar 11, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    dtolnay David Tolnay
    Copy the full SHA
    4c9adaa View commit details

Commits on Mar 12, 2024

  1. Copy the full SHA
    e36ed66 View commit details
  2. chore: release v2.8.1

    antfu committed Mar 12, 2024
    Copy the full SHA
    cda35da View commit details
2 changes: 1 addition & 1 deletion fixtures/input/vue-ts.vue
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
import { ref } from 'vue';
const greeting = ref('Hello, Vue 3!');
let counter = ref<number | string>(0);
let counter = ref<number | 1>(0);
// Define a function
const incrementCounter = () => {
3 changes: 3 additions & 0 deletions fixtures/input/vue.vue
Original file line number Diff line number Diff line change
@@ -13,9 +13,12 @@ import { ref } from '@vue/reactivity';
const greeting = ref('Hello, Vue 3!' + 1);
let counter = ref(0)
let doubled = computed(() => counter.value * 2);
// Define a function
const incrementCounter = () => {
counter.value++;
};
let _zero = doubled + counter
</script>
2 changes: 1 addition & 1 deletion fixtures/output/all/vue-ts.vue
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
import { ref } from 'vue'
const greeting = ref('Hello, Vue 3!')
const counter = ref<number | string>(0)
const counter = ref<number | 1>(0)
// Define a function
function incrementCounter() {
3 changes: 3 additions & 0 deletions fixtures/output/all/vue.vue
Original file line number Diff line number Diff line change
@@ -4,11 +4,14 @@ import { ref } from 'vue'
const greeting = ref(`Hello, Vue 3!${1}`)
const counter = ref(0)
const doubled = computed(() => counter.value * 2)
// Define a function
function incrementCounter() {
counter.value++
}
const _zero = doubled.value + counter.value
</script>

<template>
2 changes: 1 addition & 1 deletion fixtures/output/no-style/vue-ts.vue
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
import { ref } from 'vue';
const greeting = ref('Hello, Vue 3!');
const counter = ref<number | string>(0);
const counter = ref<number | 1>(0);
// Define a function
const incrementCounter = () => {
3 changes: 3 additions & 0 deletions fixtures/output/no-style/vue.vue
Original file line number Diff line number Diff line change
@@ -4,11 +4,14 @@ import { ref } from 'vue';
const greeting = ref(`Hello, Vue 3!${ 1}`);
const counter = ref(0)
const doubled = computed(() => counter.value * 2);
// Define a function
const incrementCounter = () => {
counter.value++;
};
const _zero = doubled.value + counter.value
</script>

<template>
2 changes: 1 addition & 1 deletion fixtures/output/tab-double-quotes/vue-ts.vue
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
import { ref } from "vue"
const greeting = ref("Hello, Vue 3!")
const counter = ref<number | string>(0)
const counter = ref<number | 1>(0)
// Define a function
function incrementCounter() {
3 changes: 3 additions & 0 deletions fixtures/output/tab-double-quotes/vue.vue
Original file line number Diff line number Diff line change
@@ -4,11 +4,14 @@ import { ref } from "vue"
const greeting = ref(`Hello, Vue 3!${1}`)
const counter = ref(0)
const doubled = computed(() => counter.value * 2)
// Define a function
function incrementCounter() {
counter.value++
}
const _zero = doubled.value + counter.value
</script>

<template>
2 changes: 1 addition & 1 deletion fixtures/output/ts-override/vue-ts.vue
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
import { ref } from 'vue'
const greeting = ref('Hello, Vue 3!')
const counter = ref<number | string>(0)
const counter = ref<number | 1>(0)
// Define a function
function incrementCounter() {
3 changes: 3 additions & 0 deletions fixtures/output/ts-override/vue.vue
Original file line number Diff line number Diff line change
@@ -4,11 +4,14 @@ import { ref } from 'vue'
const greeting = ref(`Hello, Vue 3!${1}`)
const counter = ref(0)
const doubled = computed(() => counter.value * 2)
// Define a function
function incrementCounter() {
counter.value++
}
const _zero = doubled.value + counter.value
</script>

<template>
2 changes: 1 addition & 1 deletion fixtures/output/with-formatters/vue-ts.vue
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
import { ref } from 'vue'
const greeting = ref('Hello, Vue 3!')
const counter = ref<number | string>(0)
const counter = ref<number | 1>(0)
// Define a function
function incrementCounter() {
3 changes: 3 additions & 0 deletions fixtures/output/with-formatters/vue.vue
Original file line number Diff line number Diff line change
@@ -4,11 +4,14 @@ import { ref } from 'vue'
const greeting = ref(`Hello, Vue 3!${1}`)
const counter = ref(0)
const doubled = computed(() => counter.value * 2)
// Define a function
function incrementCounter() {
counter.value++
}
const _zero = doubled.value + counter.value
</script>

<template>
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@antfu/eslint-config",
"type": "module",
"version": "2.8.0",
"version": "2.8.1",
"packageManager": "pnpm@8.15.4",
"description": "Anthony's ESLint config",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
@@ -92,24 +92,24 @@
"@eslint-types/typescript-eslint": "^7.0.2",
"@eslint-types/unicorn": "^51.0.1",
"@stylistic/eslint-plugin": "^1.6.3",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"eslint-config-flat-gitignore": "^0.1.3",
"eslint-merge-processors": "^0.1.0",
"eslint-plugin-antfu": "^2.1.2",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-i": "^2.29.1",
"eslint-plugin-jsdoc": "^48.2.0",
"eslint-plugin-jsdoc": "^48.2.1",
"eslint-plugin-jsonc": "^2.13.0",
"eslint-plugin-markdown": "^3.0.1",
"eslint-plugin-markdown": "^4.0.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-perfectionist": "^2.5.0",
"eslint-plugin-perfectionist": "^2.6.0",
"eslint-plugin-toml": "^0.9.2",
"eslint-plugin-unicorn": "^51.0.1",
"eslint-plugin-unused-imports": "^3.1.0",
"eslint-plugin-vitest": "^0.3.22",
"eslint-plugin-vue": "^9.22.0",
"eslint-plugin-vitest": "^0.3.25",
"eslint-plugin-vue": "^9.23.0",
"eslint-plugin-yml": "^1.12.2",
"eslint-processor-vue-blocks": "^0.1.1",
"globals": "^14.0.0",
@@ -130,7 +130,7 @@
"@stylistic/eslint-plugin-migrate": "^1.6.3",
"@types/eslint": "^8.56.5",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.11.24",
"@types/node": "^20.11.26",
"@types/prompts": "^2.4.9",
"@types/yargs": "^17.0.32",
"@unocss/eslint-plugin": "^0.58.5",
@@ -157,7 +157,7 @@
"svelte": "^4.2.12",
"svelte-eslint-parser": "^0.33.1",
"tsup": "^8.0.2",
"typescript": "^5.3.3",
"typescript": "^5.4.2",
"vitest": "^1.3.1",
"vue": "^3.4.21"
},
315 changes: 191 additions & 124 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions src/configs/vue.ts
Original file line number Diff line number Diff line change
@@ -34,6 +34,26 @@ export async function vue(

return [
{
// This allows Vue plugin to work with auto imports
// https://github.com/vuejs/eslint-plugin-vue/pull/2422
languageOptions: {
globals: {
computed: 'readonly',
defineEmits: 'readonly',
defineExpose: 'readonly',
defineProps: 'readonly',
onMounted: 'readonly',
onUnmounted: 'readonly',
reactive: 'readonly',
ref: 'readonly',
shallowReactive: 'readonly',
shallowRef: 'readonly',
toRef: 'readonly',
toRefs: 'readonly',
watch: 'readonly',
watchEffect: 'readonly',
},
},
name: 'antfu:vue:setup',
plugins: {
vue: pluginVue,