Skip to content

Commit e05fa1b

Browse files
committed
style: lower stylelint version
See csstree/stylelint-validator#59
1 parent 26a6b32 commit e05fa1b

File tree

7 files changed

+361
-114
lines changed

7 files changed

+361
-114
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@
8080
"rimraf": "^5.0.5",
8181
"source-map-loader": "^5.0.0",
8282
"style-loader": "^3.3.4",
83-
"stylelint": "^16.2.0",
84-
"stylelint-config-recommended": "^14.0.0",
85-
"stylelint-config-standard": "^36.0.0",
83+
"stylelint": "^15.10.1",
84+
"stylelint-config-recommended": "^13.0.0",
85+
"stylelint-config-standard": "^34.0.0",
8686
"stylelint-csstree-validator": "^3.0.0",
87-
"stylelint-prettier": "^5.0.0",
87+
"stylelint-prettier": "^4.0.0",
8888
"typescript": "^5.3.3",
8989
"yjs": "^13.6.11"
9090
},

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
2121
notebooks: INotebookTracker,
2222
editors: IEditorTracker,
2323
settingRegistry: ISettingRegistry | null,
24-
statusBar: IStatusBar | null,
24+
statusBar: IStatusBar | null
2525
) => {
2626
console.log('JupyterLab extension jupyterlab-wakatime is activated!')
2727
const statusModel = new StatusModel()
@@ -69,7 +69,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
6969
const wakatimeStatus = new WakaTimeStatus(statusModel)
7070
statusBar.registerStatusItem('wakatime-status', {
7171
item: wakatimeStatus,
72-
align: 'right',
72+
align: 'right'
7373
})
7474
pollStatus(statusModel)
7575
}

src/status.tsx

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { GroupItem, TextItem } from '@jupyterlab/statusbar'
55

66
import wakatimeSVG from '../style/icons/wakatime.svg'
77

8-
98
export const wakatimeIcon = new LabIcon({
109
name: 'jupyterlab-wakatime:wakatime',
1110
svgstr: wakatimeSVG
@@ -32,17 +31,27 @@ export class StatusModel extends VDomModel {
3231
get errorMsg() {
3332
switch (this._error) {
3433
// extension-defined error codes
35-
case 0: return "WakaTime is working"
36-
case 127: return "wakatime-cli not found"
37-
case 400: return "Plugin error"
34+
case 0:
35+
return 'WakaTime is working'
36+
case 127:
37+
return 'wakatime-cli not found'
38+
case 400:
39+
return 'Plugin error'
3840
// wakatime-cli error codes
39-
case 112: return "Rate limited"
40-
case 102: return "API or network error"
41-
case 104: return "Invalid API key"
42-
case 103: return "Config file parse error"
43-
case 110: return "Config file read error"
44-
case 111: return "Config file write error"
45-
default: return "Unknown error"
41+
case 112:
42+
return 'Rate limited'
43+
case 102:
44+
return 'API or network error'
45+
case 104:
46+
return 'Invalid API key'
47+
case 103:
48+
return 'Config file parse error'
49+
case 110:
50+
return 'Config file read error'
51+
case 111:
52+
return 'Config file write error'
53+
default:
54+
return 'Unknown error'
4655
}
4756
}
4857

@@ -62,7 +71,7 @@ export class StatusModel extends VDomModel {
6271
export class WakaTimeStatus extends VDomRenderer<StatusModel> {
6372
constructor(model: StatusModel) {
6473
super(model)
65-
this.addClass("jp-wakatime-status")
74+
this.addClass('jp-wakatime-status')
6675
}
6776

6877
render() {

src/typings.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
declare module "\*.svg" {
2-
const content: string;
3-
export default content;
1+
declare module '*.svg' {
2+
const content: string
3+
export default content
44
}

src/watch.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ export class Heart {
2020
this.statusModel = statusModel
2121
this.debug = debug
2222
}
23-
async beat(
24-
filepath: string,
25-
type: 'switch' | 'change' | 'write'
26-
) {
23+
async beat(filepath: string, type: 'switch' | 'change' | 'write') {
2724
console.log(type, filepath)
2825
const now = Date.now()
2926
if (type === 'change' && now - lastBeat < wakaInterval) {
@@ -33,7 +30,7 @@ export class Heart {
3330
filepath: filepath,
3431
timestamp: now / 1e3,
3532
iswrite: type === 'write',
36-
debug: this.debug,
33+
debug: this.debug
3734
}
3835
lastBeat = now
3936
const { code } = await requestAPI<{ code: number }>('heartbeat', {
@@ -51,7 +48,7 @@ const immediateInterval = (callback: () => void, ms: number) => {
5148

5249
export const pollStatus = (model: StatusModel) => {
5350
immediateInterval(async () => {
54-
const { time } = await requestAPI<{ time: string, error: number }>('status')
51+
const { time } = await requestAPI<{ time: string; error: number }>('status')
5552
model.time = time
5653
}, 6e4)
5754
}

style/base.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
*/
66

77
.jp-wakatime-status:has([data-error]) {
8-
background-color: var(--jp-warn-color3)
8+
background-color: var(--jp-warn-color3);
99
}

0 commit comments

Comments
 (0)