diff --git a/.vscode/settings.json b/.vscode/settings.json index b8142104e..e798012f9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,7 @@ // Formatting "eslint.enable": true, - "eslint.experimental.useFlatConfig": true, + "eslint.useFlatConfig": true, "eslint.format.enable": true, "eslint.nodePath": "../node_modules/.bin", "prettier.configPath": "prettier.config.js", @@ -28,11 +28,11 @@ "editor.defaultFormatter": "dbaeumer.vscode-eslint", "editor.formatOnSave": true }, + "[xml]": { + "editor.defaultFormatter": "redhat.vscode-xml" + }, // This corresponds to the `lib` we're using everywhere. Setting it here // helps to address editor-only type errors in tooling files, where VSCode // doesn't pick up the top-level `tsconfig.tools.json`. - "js/ts.implicitProjectConfig.target": "ES2022", - "[xml]": { - "editor.defaultFormatter": "redhat.vscode-xml" - } + "js/ts.implicitProjectConfig.target": "ES2022" } diff --git a/eslint.config.js b/eslint.config.js index b3da70733..f92ba0c3b 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -8,7 +8,6 @@ // annotating with a date, but it'd be nice if we could just derive that from // git history or whatever. -/// /// /// /// @@ -18,7 +17,6 @@ /// /// -import { FlatCompat } from '@eslint/eslintrc'; import eslint from '@eslint/js'; import eslintConfigPrettier from 'eslint-config-prettier'; import jsdoc from 'eslint-plugin-jsdoc'; @@ -30,19 +28,8 @@ import vue3Recommended from 'eslint-plugin-vue/lib/configs/vue3-recommended.js'; import vue3StronglyRecommended from 'eslint-plugin-vue/lib/configs/vue3-strongly-recommended.js'; import vueProcessor from 'eslint-plugin-vue/lib/processor.js'; import { builtinModules } from 'node:module'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; import tseslint from 'typescript-eslint'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - -const compat = new FlatCompat({ - baseDirectory: __dirname, - resolvePluginsRelativeTo: __dirname, - recommendedConfig: eslint.configs.recommended, - allConfig: eslint.configs.all, -}); +import vueESLintParser from 'vue-eslint-parser'; /** * @param {string} pathSansExtension @@ -147,14 +134,11 @@ export default tseslint.config( * Note: Contrary to the defaults provided in a Vue template project, it * was found that linting applies most consistently by applying * Vue-specific parsing **after** TypeScript. - * - * TODO: after breaking up the parser and rule aspects, it seemed likely - * that we could stop using `FlatCompat` for this. For reasons that are - * unclear, I wasn't able to find a way to get that working. */ - ...compat - .config({ - parser: 'vue-eslint-parser', + { + files: [vuePackageGlob], + languageOptions: { + parser: vueESLintParser, parserOptions: { /** * @see {@link https://github.com/vuejs/vue-eslint-parser/issues/173#issuecomment-1367298274} @@ -172,17 +156,13 @@ export default tseslint.config( '