Skip to content

Commit 60f3ef9

Browse files
committed
Continue to fix linting and documentation issues
1 parent ae77abd commit 60f3ef9

File tree

6 files changed

+47
-40
lines changed

6 files changed

+47
-40
lines changed

eslint.config.js

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,12 @@ export default tseslint.config(
121121
{
122122
extends: [js.configs.recommended],
123123
name: 'Global JS/TS Stylistic Rules',
124+
plugins: {
125+
jsdoc: jsdocPlugin,
126+
},
124127
files: [
125-
'**/*.*js',
126-
'**/*.ts',
127-
'**/*.tsx',
128+
'**/*.{js,cjs,mjs}',
129+
'**/*.{ts,cts,tsx}',
128130
],
129131
languageOptions: {
130132
globals: {
@@ -133,7 +135,13 @@ export default tseslint.config(
133135
}
134136
},
135137
rules: {
138+
'jsdoc/check-alignment': 'warn',
139+
'jsdoc/no-blank-blocks': 'warn',
140+
'jsdoc/no-multi-asterisks': ['warn', { allowWhitespace: true }],
141+
'jsdoc/require-asterisk-prefix': 'warn',
142+
136143
'object-shorthand': ['warn', 'properties'],
144+
137145
'@stylistic/arrow-spacing': 'warn',
138146
'@stylistic/block-spacing': 'warn',
139147
'@stylistic/brace-style': ['warn', '1tbs', { allowSingleLine: true }],
@@ -212,18 +220,22 @@ export default tseslint.config(
212220
{
213221
name: 'Global JS/TS Functional Rules',
214222
files: [
215-
'**/*.*js',
216-
'**/*.ts',
217-
'**/*.cts',
218-
'**/*.tsx',
223+
'**/*.{js,cjs,mjs}',
224+
'**/*.{ts,cts,tsx}',
219225
],
226+
// Markdown virtual files are ignored because these 'functional' rules
227+
// aren't required for them
220228
ignores: ['**/*.md/**/*.{js,ts,tsx}'],
221229
plugins: {
222230
import: importPlugin,
223-
jsdoc: jsdocPlugin,
224231
'@sourceacademy': saLintPlugin
225232
},
226233
rules: {
234+
'jsdoc/check-param-names': ['error', {
235+
checkDestructured: false,
236+
disableMissingParamChecks: true
237+
}],
238+
227239
'import/first': 'warn',
228240
'import/newline-after-import': 'warn',
229241
// This rule is very time intensive.
@@ -245,13 +257,6 @@ export default tseslint.config(
245257
}
246258
],
247259

248-
'jsdoc/check-alignment': 'warn',
249-
'jsdoc/check-param-names': ['error', {
250-
checkDestructured: false,
251-
disableMissingParamChecks: true
252-
}],
253-
'jsdoc/require-asterisk-prefix': 'warn',
254-
255260
'no-empty': ['error', { allowEmptyCatch: true }],
256261
'no-restricted-imports': [
257262
'error',
@@ -305,6 +310,7 @@ export default tseslint.config(
305310
// This rule doesn't seem to fail locally but fails on the CI
306311
// '@typescript-eslint/no-unnecessary-type-assertion': 'error',
307312
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], // Was 'error'
313+
'@typescript-eslint/only-throw-error': 'error'
308314
}
309315
},
310316
// #endregion typescript
@@ -451,12 +457,12 @@ export default tseslint.config(
451457
'vitest/expect-expect': ['error', {
452458
assertFunctionNames: ['expect*'],
453459
}],
454-
'vitest/no-alias-methods': 'off',
455-
'vitest/no-conditional-expect': 'off',
460+
'vitest/no-alias-methods': 'off', // was 'error'
461+
'vitest/no-conditional-expect': 'off', // was 'error'
456462
'vitest/no-focused-tests': ['warn', { fixable: false }],
457463
'vitest/prefer-describe-function-title': 'warn',
458-
'vitest/require-top-level-describe': 'off',
459-
'vitest/valid-describe-callback': 'off',
464+
'vitest/require-top-level-describe': 'off', // was 'error'
465+
'vitest/valid-describe-callback': 'off', // was 'error'
460466
'vitest/valid-expect-in-promise': 'error',
461467
'vitest/valid-title': ['error', { ignoreTypeOfDescribeName: true }],
462468

lib/modules-lib/src/specialErrors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* When called, the frontend will notify that the program has ended successfully
44
* and display a message that the program is stopped by a module.
55
*/
6-
export function interrupt() {
6+
export function interrupt(): never {
7+
// eslint-disable-next-line @typescript-eslint/only-throw-error
78
throw 'source_academy_interrupt';
89
}

lib/vitest-reporter/build/test-reporter.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/vitest-reporter/src/coverage-reporter.cts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,4 @@ module.exports = class GithubActionsCoverageReporter extends report.ReportBase {
184184
this.cw.write('</tbody></table>');
185185
this.cw.close();
186186
}
187-
}
187+
};

src/bundles/rune/src/runes_ops.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function throwIfNotRune(name: string, rune: unknown): asserts rune is Run
1717

1818
/**
1919
* primitive Rune in the rune of a full square
20-
* */
20+
*/
2121
export function getSquare() {
2222
const vertexList: number[] = [];
2323
const colorList: number[] = [];
@@ -46,7 +46,7 @@ export function getBlank() {
4646
* smallsquare inside a large square,
4747
* each diagonally split into a
4848
* black and white half
49-
* */
49+
*/
5050
export function getRcross() {
5151
const vertexList: number[] = [];
5252
const colorList: number[] = [];
@@ -82,7 +82,7 @@ export function getRcross() {
8282

8383
/**
8484
* primitive Rune in the rune of a sail
85-
* */
85+
*/
8686
export function getSail() {
8787
const vertexList: number[] = [];
8888
const colorList: number[] = [];
@@ -101,7 +101,7 @@ export function getSail() {
101101

102102
/**
103103
* primitive Rune in the rune of a triangle
104-
* */
104+
*/
105105
export function getTriangle() {
106106
const vertexList: number[] = [];
107107
const colorList: number[] = [];
@@ -121,7 +121,7 @@ export function getTriangle() {
121121
/**
122122
* primitive Rune with black triangle,
123123
* filling upper right corner
124-
* */
124+
*/
125125
export function getCorner() {
126126
const vertexList: number[] = [];
127127
const colorList: number[] = [];
@@ -141,7 +141,7 @@ export function getCorner() {
141141
* primitive Rune in the rune of two overlapping
142142
* triangles, residing in the upper half
143143
* of
144-
* */
144+
*/
145145
export function getNova() {
146146
const vertexList: number[] = [];
147147
const colorList: number[] = [];
@@ -163,7 +163,7 @@ export function getNova() {
163163

164164
/**
165165
* primitive Rune in the rune of a circle
166-
* */
166+
*/
167167
export function getCircle() {
168168
const vertexList: number[] = [];
169169
const colorList: number[] = [];
@@ -185,7 +185,7 @@ export function getCircle() {
185185

186186
/**
187187
* primitive Rune in the rune of a heart
188-
* */
188+
*/
189189
export function getHeart() {
190190
const vertexList: number[] = [];
191191
const colorList: number[] = [];
@@ -246,7 +246,7 @@ export function getHeart() {
246246

247247
/**
248248
* primitive Rune in the rune of a pentagram
249-
* */
249+
*/
250250
export function getPentagram() {
251251
const vertexList: number[] = [];
252252
const colorList: number[] = [];
@@ -281,7 +281,7 @@ export function getPentagram() {
281281
/**
282282
* primitive Rune in the rune of a ribbon
283283
* winding outwards in an anticlockwise spiral
284-
* */
284+
*/
285285
export function getRibbon() {
286286
const vertexList: number[] = [];
287287
const colorList: number[] = [];

src/bundles/rune_in_words/src/runes_ops.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function throwIfNotRune(name: string, ...runes: any) {
1515

1616
/**
1717
* primitive Rune in the rune of a full square
18-
* */
18+
*/
1919
export const getSquare: () => string = () => 'square';
2020

2121
export const getBlank: () => string = () => 'blank';

0 commit comments

Comments
 (0)