feat: setup unplugin-vue-router, fixed eslnt config, SmartLink for type-safe internal/external links
This commit is contained in:
parent
3c0e46c9ab
commit
60ce6d75f7
15 changed files with 435 additions and 311 deletions
|
|
@ -1,24 +1,44 @@
|
|||
import js from '@eslint/js';
|
||||
import globals from 'globals';
|
||||
import ts from 'typescript-eslint';
|
||||
import vue from 'eslint-plugin-vue';
|
||||
import js from "@eslint/js";
|
||||
import globals from "globals";
|
||||
import ts from "typescript-eslint";
|
||||
import vue from "eslint-plugin-vue";
|
||||
import { defineConfig, globalIgnores } from "eslint/config";
|
||||
import vueParser from "vue-eslint-parser";
|
||||
|
||||
export default ts.config(
|
||||
{ ignores: ['dist'] },
|
||||
{
|
||||
extends: [
|
||||
js.configs.recommended,
|
||||
...ts.configs.recommendedTypeChecked,
|
||||
...vue.configs.recommendedTypeChecked,
|
||||
],
|
||||
files: ['**/*.{js,ts,vue}'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: globals.browser,
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
export default defineConfig([
|
||||
globalIgnores(["dist"]),
|
||||
{
|
||||
extends: [
|
||||
js.configs.recommended,
|
||||
ts.configs.strictTypeChecked,
|
||||
...vue.configs["flat/essential"],
|
||||
],
|
||||
files: ["./src/**/*.{js,ts,vue}"],
|
||||
languageOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
globals: globals.browser,
|
||||
parser: vueParser,
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
parser: ts.parser,
|
||||
extraFileExtensions: [".vue"],
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
"vue/no-restricted-component-names": [
|
||||
"error",
|
||||
{
|
||||
name: "RouterLink",
|
||||
message: "Use SmartLink instead of RouterLink.",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
// disable multi-word-component-names for unplugin-vue-router
|
||||
{
|
||||
files: ["src/pages/**/*.vue"],
|
||||
rules: { "vue/multi-word-component-names": "off" },
|
||||
},
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue