Set up typed eslint
This commit is contained in:
parent
dbdb3c66a3
commit
7ea8ac6715
5 changed files with 95 additions and 56 deletions
|
|
@ -10,9 +10,19 @@ export default tseslint.config(
|
|||
|
||||
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
|
||||
|
||||
{
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
extraFileExtensions: ["vue"],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
eslint.configs.recommended,
|
||||
...tseslint.configs.strict,
|
||||
...tseslint.configs.stylistic,
|
||||
...tseslint.configs.strictTypeChecked,
|
||||
...tseslint.configs.stylisticTypeChecked,
|
||||
...vue.configs["flat/recommended"],
|
||||
prettier,
|
||||
|
||||
|
|
@ -14,12 +14,14 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.21.0",
|
||||
"@types/eslint-config-prettier": "^6.11.3",
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"@vue/tsconfig": "^0.7.0",
|
||||
"eslint": "^9.21.0",
|
||||
"eslint-config-prettier": "^10.0.2",
|
||||
"eslint-plugin-vue": "^9.32.0",
|
||||
"globals": "^16.0.0",
|
||||
"jiti": "^2.4.2",
|
||||
"typescript": "~5.7.3",
|
||||
"typescript-eslint": "^8.25.0",
|
||||
"vite": "^6.2.0",
|
||||
|
|
|
|||
|
|
@ -2,4 +2,11 @@ import { createApp } from "vue";
|
|||
import "./style.css";
|
||||
import App from "./App.vue";
|
||||
|
||||
// The type of App contains any in its type parameters, according to vscode.
|
||||
// Presumably, this is what triggers the lint.
|
||||
//
|
||||
// @vue/eslint-config-typescript turns this option off entirely.
|
||||
// https://github.com/vuejs/eslint-config-typescript/blob/bcdeb741521a718d44dfe77aadcf6d0702b1fd21/src/internals.ts#L139
|
||||
//
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
createApp(App).mount("#app");
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@
|
|||
"moduleDetection": "force",
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
"include": ["vite.config.ts", "eslint.config.ts"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue