diff --git a/gdn-app/eslint.config.js b/gdn-app/eslint.config.js index 75b7113..eaecbff 100644 --- a/gdn-app/eslint.config.js +++ b/gdn-app/eslint.config.js @@ -1,3 +1,5 @@ +// @ts-check + // https://eslint.org/docs/latest/use/configure/ // https://eslint.vuejs.org/user-guide/ @@ -7,15 +9,29 @@ import pluginVue from "eslint-plugin-vue"; import configPrettier from "eslint-config-prettier"; export default tseslint.config( - { ignores: ["dist/", "src/vite-env.d.ts"] }, + { ignores: ["dist/", "eslint.config.js", "vite.config.ts", "src/vite-env.d.ts"] }, + eslint.configs.recommended, - ...tseslint.configs.recommended, - ...tseslint.configs.stylistic, + ...tseslint.configs.strictTypeChecked, + ...tseslint.configs.stylisticTypeChecked, ...pluginVue.configs["flat/recommended"], - // We don't want prettier's formatting decisions being second-guessed by eslint. + // Prettier's formatting decisions should not be second-guessed by eslint. configPrettier, - // We need to tell the vue parser that it should use the ts parser instead of the js parser. + // Set up the ts parser to use type info and understand vue files. + { + languageOptions: { + parserOptions: { + projectService: true, + tsconfigRootDir: import.meta.dirname, + + // Otherwise the parser will complain that it doesn't know vue files. + extraFileExtensions: ["vue"], + }, + }, + }, + + // Tell the vue parser that it should use the ts parser instead of the js parser. { files: ["**/*.vue"], languageOptions: { parserOptions: { parser: tseslint.parser } } }, ); diff --git a/gdn-app/tsconfig.node.json b/gdn-app/tsconfig.node.json index 42872c5..481b5b3 100644 --- a/gdn-app/tsconfig.node.json +++ b/gdn-app/tsconfig.node.json @@ -6,5 +6,5 @@ "moduleResolution": "bundler", "allowSyntheticDefaultImports": true }, - "include": ["vite.config.ts"] + "include": ["vite.config.ts", "eslint.config.js"] }