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: nuxt/eslint
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.5.1
Choose a base ref
...
head repository: nuxt/eslint
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.5.2
Choose a head ref
  • 2 commits
  • 6 files changed
  • 1 contributor

Commits on Aug 22, 2024

  1. fix(eslint-config): do not eagerly import ts-eslint parser, close #485

    antfu committed Aug 22, 2024
    1
    Copy the full SHA
    4b5d65c View commit details
  2. chore: release v0.5.2

    antfu committed Aug 22, 2024
    Copy the full SHA
    3f82383 View commit details
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"private": true,
"type": "module",
"packageManager": "pnpm@9.7.1",
"version": "0.5.1",
"version": "0.5.2",
"scripts": {
"build": "pnpm run -r build",
"stub": "pnpm run -r stub",
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nuxt/eslint-config",
"version": "0.5.1",
"version": "0.5.2",
"description": "ESLint config for Nuxt projects",
"repository": {
"type": "git",
2 changes: 2 additions & 0 deletions packages/eslint-config/src/flat/configs/typescript.ts
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@ import type { Linter } from 'eslint'
import type { NuxtESLintConfigOptions } from '@nuxt/eslint-config/flat'
import { resolveOptions } from '../utils'

export { parserTs, pluginTs }

export default function typescript(options: NuxtESLintConfigOptions): Linter.Config[] {
const resolved = resolveOptions(options)

10 changes: 6 additions & 4 deletions packages/eslint-config/src/flat/configs/vue.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import * as parserVue from 'vue-eslint-parser'
import parserTs from '@typescript-eslint/parser'

// @ts-expect-error missing types
import pluginVue from 'eslint-plugin-vue'
import type { Linter } from 'eslint'
@@ -10,10 +8,14 @@ import { removeUndefined, resolveOptions } from '../utils'
// imported from 'eslint-plugin-vue/lib/utils/inline-non-void-elements.json'
const INLINE_ELEMENTS = ['a', 'abbr', 'audio', 'b', 'bdi', 'bdo', 'canvas', 'cite', 'code', 'data', 'del', 'dfn', 'em', 'i', 'iframe', 'ins', 'kbd', 'label', 'map', 'mark', 'noscript', 'object', 'output', 'picture', 'q', 'ruby', 's', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'svg', 'time', 'u', 'var', 'video']

export default function vue(options: NuxtESLintConfigOptions): Linter.Config[] {
export default async function vue(options: NuxtESLintConfigOptions): Promise<Linter.Config[]> {
const resolved = resolveOptions(options)
const hasTs = resolved.features.typescript !== false

const parser = hasTs
? await import('./typescript').then(mod => mod.parserTs)
: undefined

const {
indent = 2,
commaDangle = 'always-multiline',
@@ -30,7 +32,7 @@ export default function vue(options: NuxtESLintConfigOptions): Linter.Config[] {
parserOptions: {
ecmaVersion: 'latest',
extraFileExtensions: ['.vue'],
parser: hasTs ? parserTs : undefined,
parser,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
2 changes: 1 addition & 1 deletion packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@nuxt/eslint-plugin",
"type": "module",
"version": "0.5.1",
"version": "0.5.2",
"description": "ESLint plugin for Nuxt",
"license": "MIT",
"repository": {
2 changes: 1 addition & 1 deletion packages/module/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@nuxt/eslint",
"type": "module",
"version": "0.5.1",
"version": "0.5.2",
"description": "Generate ESLint config from current Nuxt settings",
"license": "MIT",
"repository": {