Repository: stylelint/vscode-stylelint (ts)

Issue:
[Bug]: Updating the Stylelint configuration in a workspace doesn't cause files to be re-linted
### How did you encounter this bug?

Updating the Stylelint configuration in a workspace doesn't cause files to be re-linted.

### Code Snippet

_No response_

### Stylelint Configuration

_No response_

### Extension Configuration

_No response_

### Actual Behaviour

Files are not re-linted when configuration files are updated.

### Expected Behaviour

Files should be re-linted when configuration files are updated.

### Logs

_No response_

### Stylelint Version

v14.1.0

### vscode-stylelint Version

v1.2.1

### Node.js Version

v17.1.0

### Operating System

Windows 11 21H2

### Windows Subsystem for Linux

_No response_

### Code of Conduct

- [X] I agree to follow vscode-stylelint's Code of Conduct

Pull request description:
fix: de-nest globs used for watching config files
Closes #343

Patch:
diff --git a/src/extension/extension.ts b/src/extension/extension.ts
index 85a62b4..489e2f7 100644
--- a/src/extension/extension.ts
+++ b/src/extension/extension.ts
@@ -34,9 +34,10 @@ export function activate({ subscriptions }: vscode.ExtensionContext): PublicApi
 			documentSelector: [{ scheme: 'file' }, { scheme: 'untitled' }],
 			diagnosticCollectionName: 'Stylelint',
 			synchronize: {
-				fileEvents: workspace.createFileSystemWatcher(
-					'**/{.stylelintrc{,.js,.json,.yaml,.yml},stylelint.config.js,.stylelintignore}',
-				),
+				fileEvents: [
+					workspace.createFileSystemWatcher('**/.stylelintrc{,.js,.json,.yaml,.yml}'),
+					workspace.createFileSystemWatcher('**/{stylelint.config.js,.stylelintignore}'),
+				],
 			},
 		},
 	);


Test patch:
diff --git a/src/extension/__tests__/__snapshots__/extension.ts.snap b/src/extension/__tests__/__snapshots__/extension.ts.snap
index 55ff3e2..69d1b0e 100644
--- a/src/extension/__tests__/__snapshots__/extension.ts.snap
+++ b/src/extension/__tests__/__snapshots__/extension.ts.snap
@@ -28,7 +28,10 @@ Array [
       },
     ],
     "synchronize": Object {
-      "fileEvents": undefined,
+      "fileEvents": Array [
+        undefined,
+        undefined,
+      ],
     },
   },
 ]
diff --git a/src/extension/__tests__/extension.ts b/src/extension/__tests__/extension.ts
index c80b36b..c4323ab 100644
--- a/src/extension/__tests__/extension.ts
+++ b/src/extension/__tests__/extension.ts
@@ -117,10 +117,15 @@ describe('Extension entry point', () => {
 	it('should watch for changes to Stylelint configuration files', () => {
 		activate(mockExtensionContext);
 
-		expect(mockWorkspace.createFileSystemWatcher).toHaveBeenCalled();
+		expect(mockWorkspace.createFileSystemWatcher).toHaveBeenCalledTimes(2);
 		expect(mockWorkspace.createFileSystemWatcher.mock.calls[0]).toMatchInlineSnapshot(`
 		Array [
-		  "**/{.stylelintrc{,.js,.json,.yaml,.yml},stylelint.config.js,.stylelintignore}",
+		  "**/.stylelintrc{,.js,.json,.yaml,.yml}",
+		]
+	`);
+		expect(mockWorkspace.createFileSystemWatcher.mock.calls[1]).toMatchInlineSnapshot(`
+		Array [
+		  "**/{stylelint.config.js,.stylelintignore}",
 		]
 	`);
 	});