Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stylelint 16 to ci #633

Draft
wants to merge 4 commits into
base: add-stylelint-16-to-ci
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.15.0
22.13.1
5,772 changes: 2,891 additions & 2,881 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"devDependencies": {
"@stylelint/postcss-css-in-js": "^0.38.0",
"@stylelint/prettier-config": "^3.0.0",
"@types/jest": "^27.0.3",
"@types/jest": "^29.5.14",
"@types/path-is-inside": "^1.0.0",
"@types/semver": "^7.5.8",
"@types/vscode": "1.82.0",
Expand All @@ -232,19 +232,19 @@
"eslint-config-stylelint": "^21.0.0",
"eslint-plugin-jest": "^27.9.0",
"fast-glob": "^3.2.7",
"jest": "^27.4.3",
"jest-runner-vscode": "^2.1.0",
"jest": "^29.7.0",
"jest-runner-vscode": "^3.0.1",
"npm-run-all": "^4.1.5",
"p-wait-for": "^3.1.0",
"postcss": "^8.4.31",
"postcss-sass": "^0.5.0",
"postcss-scss": "^4.0.9",
"prettier": "^3.2.5",
"prettier": "^3.4.2",
"stylelint": "^16.2.1",
"stylelint-processor-glamorous": "^0.3.0",
"stylelint-processor-styled-components": "^1.10.0",
"stylelint-scss": "^6.2.1",
"ts-jest": "^27.0.7",
"ts-jest": "^29.2.5",
"ts-node": "^10.4.0",
"typed-emitter": "^2.1.0",
"typescript": "^4.9.5"
Expand Down Expand Up @@ -273,7 +273,7 @@
},
"prettier": "@stylelint/prettier-config",
"volta": {
"node": "18.15.0",
"npm": "9.9.2"
"node": "22.13.1",
"npm": "11.0.0"
}
}
32 changes: 16 additions & 16 deletions src/extension/__tests__/__snapshots__/extension.ts.snap
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Extension entry point should create a language client 1`] = `
Array [
[
"Stylelint",
Object {
"debug": Object {
{
"debug": {
"module": "mock-path",
"options": Object {
"execArgv": Array [
"options": {
"execArgv": [
"--nolazy",
"--inspect=6004",
],
},
},
"run": Object {
"run": {
"module": "mock-path",
},
},
Object {
{
"diagnosticCollectionName": "Stylelint",
"documentSelector": Array [
Object {
"documentSelector": [
{
"scheme": "file",
},
Object {
{
"scheme": "untitled",
},
],
"synchronize": Object {
"fileEvents": Array [
"synchronize": {
"fileEvents": [
undefined,
undefined,
],
Expand All @@ -38,11 +38,11 @@ Array [
`;

exports[`Extension entry point with an active text editor, should send auto-fix commands to the language server 1`] = `
Array [
[
"executeCommand",
Object {
"arguments": Array [
Object {
{
"arguments": [
{
"uri": "file:///path/to/file.ts",
"version": 1,
},
Expand Down
22 changes: 12 additions & 10 deletions src/extension/__tests__/extension.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
jest.doMock('vscode', () => ({ workspace: {}, window: {}, commands: {} }), { virtual: true });
jest.doMock('vscode', () => ({ workspace: {}, window: {}, commands: {} }), {
virtual: true,
});
jest.mock('vscode-languageclient/node', () => ({
LanguageClient: jest.fn(),
SettingMonitor: jest.fn(),
Expand Down Expand Up @@ -117,12 +119,12 @@ describe('Extension entry point', () => {

expect(mockWorkspace.createFileSystemWatcher).toHaveBeenCalledTimes(2);
expect(mockWorkspace.createFileSystemWatcher.mock.calls[0]).toMatchInlineSnapshot(`
Array [
[
"**/.stylelintrc{,.js,.json,.yaml,.yml}",
]
`);
expect(mockWorkspace.createFileSystemWatcher.mock.calls[1]).toMatchInlineSnapshot(`
Array [
[
"**/{stylelint.config.js,.stylelintignore}",
]
`);
Expand All @@ -140,7 +142,7 @@ describe('Extension entry point', () => {
expect(mockCommands.registerCommand).toHaveBeenCalled();
// cspell:disable
expect(mockCommands.registerCommand.mock.calls[0]).toMatchInlineSnapshot(`
Array [
[
"stylelint.executeAutofix",
[Function],
]
Expand Down Expand Up @@ -184,7 +186,7 @@ describe('Extension entry point', () => {
expect(sendRequest).toHaveBeenCalledTimes(1);
expect(mockWindow.showErrorMessage).toHaveBeenCalledTimes(1);
expect(mockWindow.showErrorMessage.mock.calls[0]).toMatchInlineSnapshot(`
Array [
[
"Failed to apply Stylelint fixes to the document. Please consider opening an issue with steps to reproduce.",
]
`);
Expand All @@ -201,7 +203,7 @@ describe('Extension entry point', () => {

expect(mockCommands.registerCommand).toHaveBeenCalled();
expect(mockCommands.registerCommand.mock.calls[1]).toMatchInlineSnapshot(`
Array [
[
"stylelint.restart",
[Function],
]
Expand Down Expand Up @@ -334,12 +336,12 @@ describe('Extension entry point', () => {

expect(mockWindow.showErrorMessage).toHaveBeenCalledTimes(2);
expect(mockWindow.showErrorMessage.mock.calls[0]).toMatchInlineSnapshot(`
Array [
[
"Stylelint: Problem!",
]
`);
expect(mockWindow.showErrorMessage.mock.calls[1]).toMatchInlineSnapshot(`
Array [
[
"Stylelint: String problem!",
]
`);
Expand All @@ -364,12 +366,12 @@ describe('Extension entry point', () => {

expect(mockWindow.showErrorMessage).toHaveBeenCalledTimes(2);
expect(mockWindow.showErrorMessage.mock.calls[0]).toMatchInlineSnapshot(`
Array [
[
"Stylelint: Problem!",
]
`);
expect(mockWindow.showErrorMessage.mock.calls[1]).toMatchInlineSnapshot(`
Array [
[
"Stylelint: String problem!",
]
`);
Expand Down
4 changes: 3 additions & 1 deletion src/extension/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ let client: LanguageClient;
export async function activate({ subscriptions }: ExtensionContext): Promise<PublicApi> {
const serverPath = path.join(__dirname, 'start-server.js');

const api = Object.assign(new EventEmitter(), { codeActionReady: false }) as PublicApi;
const api = Object.assign(new EventEmitter(), {
codeActionReady: false,
}) as PublicApi;

client = new LanguageClient(
'Stylelint',
Expand Down
Loading
Loading