Files
iot-dc3/dc3-web/eslint.config.mjs
pnoker 4ea339ba14 chore(web): remove prettier, use IDE formatter for code style
Drop prettier, eslint-config-prettier, eslint-plugin-prettier and related
configs. Code formatting is now controlled solely by the IDE (IDEA) via
.editorconfig, eliminating the two-formatter conflict.
2026-07-10 00:01:51 +08:00

151 lines
4.7 KiB
JavaScript

/*
* Copyright 2016-present the IoT DC3 original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import js from '@eslint/js';
import pluginVue from 'eslint-plugin-vue';
import tsparser from '@typescript-eslint/parser';
import {defineConfigWithVueTs, vueTsConfigs} from '@vue/eslint-config-typescript';
import vueParser from 'vue-eslint-parser';
import globals from 'globals';
export default [
{
ignores: [
'node_modules/**',
'dist/**',
'playwright-report/**',
'public/**',
'src/assets/**',
'test-results/**',
'.github/**',
'.vscode/**',
'.idea/**',
'dc3/**',
// auto-generated by unplugin-auto-import / unplugin-vue-components
'auto-imports.d.ts',
'components.d.ts',
'src/config/ambient/auto-imports.d.ts',
'src/config/ambient/components.d.ts',
'src/config/types/auto-imports.d.ts',
'src/config/types/components.d.ts',
],
},
js.configs.recommended,
...pluginVue.configs['flat/essential'],
...defineConfigWithVueTs(vueTsConfigs.recommended),
{
files: ['**/*.mjs'],
languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
},
},
rules: {
'no-console': 'off',
},
},
{
files: ['**/*.{ts,tsx,vue}'],
languageOptions: {
parser: vueParser,
parserOptions: {
parser: tsparser,
sourceType: 'module',
ecmaVersion: 'latest',
},
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
},
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'vue/custom-event-name-casing': 'off',
'vue/one-component-per-file': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/max-attributes-per-line': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/attribute-hyphenation': 'off',
'vue/html-self-closing': 'off',
'vue/no-multiple-template-root': 'off',
'vue/require-default-prop': 'off',
'vue/no-v-model-argument': 'off',
'vue/no-arrow-functions-in-watch': 'off',
'vue/no-template-key': 'off',
'vue/no-v-html': 'off',
'vue/comment-directive': 'off',
'vue/no-parsing-error': 'off',
'vue/no-deprecated-v-on-native-modifier': 'off',
'vue/multi-word-component-names': 'off',
'vue/block-lang': 'off',
'vue/attributes-order': [
'error',
{
order: [
'DEFINITION',
'LIST_RENDERING',
'CONDITIONALS',
'RENDER_MODIFIERS',
'GLOBAL',
['UNIQUE', 'SLOT'],
'TWO_WAY_BINDING',
'OTHER_DIRECTIVES',
'OTHER_ATTR',
'EVENTS',
'CONTENT',
],
alphabetical: false,
},
],
'no-useless-escape': 'off',
'no-sparse-arrays': 'off',
'no-prototype-builtins': 'off',
'no-constant-condition': 'off',
'no-use-before-define': 'off',
'no-restricted-globals': 'off',
'no-restricted-syntax': 'off',
'generator-star-spacing': 'off',
'no-unreachable': 'off',
'no-unused-vars': 'off',
'no-case-declarations': 'off',
'eol-last': 'off',
'no-console': 'off',
},
},
];