Skip to content

Commit 868769d

Browse files
Add support for .mts and .cts config files (#1025)
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
1 parent 437bf3a commit 868769d

File tree

6 files changed

+29
-5
lines changed

6 files changed

+29
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export const CONFIG_GLOB =
2-
'{tailwind,tailwind.config,tailwind.*.config,tailwind.config.*}.{js,cjs,ts,mjs}'
2+
'{tailwind,tailwind.config,tailwind.*.config,tailwind.config.*}.{js,cjs,ts,mjs,mts,cts}'
33
export const PACKAGE_LOCK_GLOB = '{package-lock.json,yarn.lock,pnpm-lock.yaml}'
44
export const CSS_GLOB = '*.{css,scss,sass,less,pcss}'

packages/tailwindcss-language-server/src/project-locator.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ testFixture('v3/ts-config', [
8686
{ config: 'tailwind.config.ts' },
8787
])
8888

89+
testFixture('v3/cts-config', [
90+
//
91+
{ config: 'tailwind.config.cts' },
92+
])
93+
94+
testFixture('v3/mts-config', [
95+
//
96+
{ config: 'tailwind.config.mts' },
97+
])
98+
8999
testFixture('v4/basic', [
90100
//
91101
{ config: 'app.css' },
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
theme: {
3+
colors: { cool: 'blue' },
4+
},
5+
} satisfies {
6+
theme: Record<string, any>
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
theme: {
3+
colors: { cool: 'blue' },
4+
},
5+
} satisfies {
6+
theme: Record<string, any>
7+
}

packages/vscode-tailwindcss/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Prerelease
44

5-
- Nothing yer!
5+
- Add support for `.cts` and `.mts` config files ([#1025](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1025))
66

77
## 0.12.10
88

packages/vscode-tailwindcss/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Tailwind CSS IntelliSense enhances the Tailwind development experience by provid
66

77
**[Install via the Visual Studio Code Marketplace →](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)**
88

9-
In order for the extension to activate you must have [`tailwindcss` installed](https://tailwindcss.com/docs/installation) and a [Tailwind config file](https://tailwindcss.com/docs/installation#create-your-configuration-file) named `tailwind.config.{js,cjs,mjs,ts}` in your workspace.
9+
In order for the extension to activate you must have [`tailwindcss` installed](https://tailwindcss.com/docs/installation) and a [Tailwind config file](https://tailwindcss.com/docs/installation#create-your-configuration-file) named `tailwind.config.{js,cjs,mjs,ts,cts,mts}` in your workspace.
1010

1111
## Features
1212

@@ -164,7 +164,7 @@ Enable the Node.js inspector agent for the language server and listen on the spe
164164

165165
**Default: `null`**
166166

167-
By default the extension will automatically use the first `tailwind.config.{js,cjs,mjs,ts}` file that it can find to provide Tailwind CSS IntelliSense. Use this setting to manually specify the config file(s) yourself instead.
167+
By default the extension will automatically use the first `tailwind.config.{js,cjs,mjs,ts,cts,mts}` file that it can find to provide Tailwind CSS IntelliSense. Use this setting to manually specify the config file(s) yourself instead.
168168

169169
If your project contains a single Tailwind config file you can specify a string value:
170170

@@ -185,7 +185,7 @@ For projects with multiple config files use an object where each key is a config
185185

186186
If you’re having issues getting the IntelliSense features to activate, there are a few things you can check:
187187

188-
- Ensure that you have a Tailwind config file in your workspace and that this is named `tailwind.config.{js,cjs,mjs,ts}`. Check out the Tailwind documentation for details on [creating a config file](https://tailwindcss.com/docs/installation#create-your-configuration-file).
188+
- Ensure that you have a Tailwind config file in your workspace and that this is named `tailwind.config.{js,cjs,mjs,ts,cts,mts}`. Check out the Tailwind documentation for details on [creating a config file](https://tailwindcss.com/docs/installation#create-your-configuration-file).
189189
- Ensure that the `tailwindcss` module is installed in your workspace, via `npm`, `yarn`, or `pnpm`.
190190
- Make sure your VS Code settings aren’t causing your Tailwind config file to be hidden/ignored, for example via the `files.exclude` or `files.watcherExclude` settings.
191191
- Take a look at the language server output by running the `Tailwind CSS: Show Output` command from the command palette. This may show errors that are preventing the extension from activating.

0 commit comments

Comments
 (0)