Hint VS Code for eleventyConfig autocompletion

Duration
1 minute read
Last Updated
Oct 2021
Topics
  • code snippet
  • javascript
  • typescript

Allows VS Code to start offering intellisense and autocompletion options for the eleventyConfig object. Super useful when you’re trying to remember the capitalization on eleventy.addPassthroughCopy().

In .eleventy.js or eleventy.config.js:

/**
 *  @param {import("@11ty/eleventy/src/UserConfig")} eleventyConfig
 */
module.exports = (eleventyConfig) => {
  return {};
};

(Maybe obvious, but the /** ... */ comment is the important part for VSC.)

Hire me — I'm seeking my next full-time role.