Skip to content

Commit 0e0ecd7

Browse files
authored
Give a proper type to .pug files on the client (compiler-explorer#7828)
1 parent d054958 commit 0e0ecd7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

static/client.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,17 @@
2222
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2323
// POSSIBILITY OF SUCH DAMAGE.
2424

25+
// These .pug files are different from the ones on the server. Our webpack
26+
// config will translate the .pug files into JS objects that are importable
27+
// with `hash` and `text` properties.
28+
//
29+
// See the code in `/etc/scripts/parsed-pug/parsed_pug_file.js` for details.
2530
declare module '*.pug' {
26-
const content: any;
31+
type WebpackBuiltPugFile = {
32+
hash: string;
33+
text: string;
34+
};
35+
declare const content: WebpackBuiltPugFile;
2736
export default content;
2837
}
2938

0 commit comments

Comments
 (0)