ESLint не работает над новым приложением vueJavascript

Форум по Javascript
Ответить Пред. темаСлед. тема
Anonymous
 ESLint не работает над новым приложением vue

Сообщение Anonymous »

Я настраивал новый проект vue3 + typscript со всеми необходимыми настройками prettier и lint. Я пробовал свои конфигурации, но ничего, если это сработало. Ниже вы увидите мой скрипт, ответ и конфигурацию.
это скрипт lint в моем package.json

Код: Выделить всё

"lint": "eslint \"./src/**/*.{js,ts,vue}\"",
"lint:fix": "eslint \"./src/**/*.{js,ts,vue}\" --fix",
и когда я запускаю это, я получаю эту ошибку:

Код: Выделить всё

eslint "src/**/*.{js,ts,vue}"

Oops! Something went wrong! :(

ESLint: 9.18.0

You are linting "src/**/*.{js,ts,vue}", but all of the files matching the glob pattern "src/**/*.{js,ts,vue}" are ignored.

If you don't want to lint these files, remove the pattern "src/**/*.{js,ts,vue}" from the list of arguments passed to ESLint.

If you do want to lint these files, explicitly list one or more of the files from this glob that you'd like to lint to see more details about why they are ignored.

* If the file is ignored because of a matching ignore pattern, check global ignores in your config file.
https://eslint.org/docs/latest/use/configure/ignore

* If the file is ignored because no matching configuration was supplied, check file patterns in your config file.
https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-with-arbitrary-extensions

* If the file is ignored because it is located outside of the base path, change the location of your config file to be in a parent directory.
Ниже мой eslint.config.js:

Код: Выделить всё

import { defineConfig } from 'eslint-define-config';
import pluginJs from '@eslint/js';
import pluginVue from 'eslint-plugin-vue';
import tseslint from '@typescript-eslint/eslint-plugin';

export default defineConfig({
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2021,
sourceType: 'module',
},
plugins: ['vue', '@typescript-eslint', 'prettier'],
rules: {
'prettier/prettier': 'error',
'no-console': 'warn',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-module-boundary-types': 'warn',
'eqeqeq': ['error', 'always'],
'consistent-return': 'warn',
'no-undef': 'error',
'vue/require-default-prop': 'warn',
'vue/no-v-html': 'warn',
},
ignorePatterns: ['node_modules/', 'dist/', 'build/', '**/*.min.js'],
overrides: [
{
files: ['*.vue'],
rules: {
'max-len': 'off',
},
},
],
});

Я пробовал добавить

Код: Выделить всё

{ ignores: ['*.d.ts', '**/coverage', '**/dist'] },
и я ожидаю, что ворс будет работать отлично

Подробнее здесь: https://stackoverflow.com/questions/793 ... pplication
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение