Skip to content

Commit bf5ef9e

Browse files
committed
Remove tslint comments
1 parent 68dfa29 commit bf5ef9e

File tree

17 files changed

+25
-55
lines changed

17 files changed

+25
-55
lines changed

src/__tests__/block-scoping.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { test } from 'vitest'
22
import { Chapter } from '../langs'
33
import { stripIndent } from '../utils/formatters'
4-
import { expectParsedError, expectFinishedResult } from '../utils/testing'
4+
import { expectFinishedResult, expectParsedError } from '../utils/testing'
55

66
// This is bad practice. Don't do this!
77
test('standalone block statements', () => {
@@ -145,7 +145,6 @@ test('Error when accessing temporal dead zone', () => {
145145
`).toEqual("Line 3: ReferenceError: Cannot access 'a' before initialization")
146146
}, 30000)
147147

148-
// tslint:disable-next-line:max-line-length
149148
test('In a block, every going-to-be-defined variable in the block cannot be accessed until it has been defined in the block.', () => {
150149
return expectParsedError(stripIndent`
151150
const a = 1;

src/__tests__/stringify.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ test('Correctly handles circular structures with multiple entry points', async (
9797
})
9898

9999
// The interpreter runs into a MaximumStackLimitExceeded error on 1000, so reduced it to 100.
100-
// tslint:disable:max-line-length
101100
test('String representation of huge lists are nice', async () => {
102101
const {
103102
result: { value }
@@ -194,7 +193,6 @@ test('String representation of huge lists are nice', async () => {
194193
[89, [90, [91, [92, [93, [94, [95, [96, [97, [98, [99, [100, null]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]"
195194
`)
196195
})
197-
// tslint:enable:max-line-length
198196

199197
test('String representation of huge arrays are nice', async () => {
200198
const {
@@ -432,7 +430,6 @@ test('String representation of undefined is nice', () => {
432430
return expectFinishedResult(`stringify(undefined);`).toEqual('undefined')
433431
})
434432

435-
// tslint:disable:max-line-length
436433
test('String representation with no indent', async () => {
437434
const {
438435
result: { value }

src/createContext.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { call_with_current_continuation } from './cse-machine/continuations'
77
import Heap from './cse-machine/heap'
88
import { Transformers } from './cse-machine/interpreter'
99
import { cset_apply, cset_eval } from './cse-machine/scheme-macros'
10+
import { Chapter, Variant, type LanguageOptions } from './langs'
1011
import * as list from './stdlib/list'
1112
import { list_to_vector } from './stdlib/list'
1213
import { listPrelude } from './stdlib/list.prelude'
@@ -25,7 +26,6 @@ import * as stream from './stdlib/stream'
2526
import { streamPrelude } from './stdlib/stream.prelude'
2627
import { createTypeEnvironment, tForAll, tVar } from './typeChecker/utils'
2728
import type { Context, CustomBuiltIns, Environment, NativeStorage, Value } from './types'
28-
import { Chapter, Variant, type LanguageOptions } from './langs'
2929
import * as operators from './utils/operators'
3030
import { stringify } from './utils/stringify'
3131

@@ -366,7 +366,6 @@ export const importBuiltins = (context: Context, externalBuiltIns: CustomBuiltIn
366366
defineBuiltin(
367367
context,
368368
'apply_in_underlying_javascript(fun, args)',
369-
// tslint:disable-next-line:ban-types
370369
(fun: Function, args: Value) => fun.apply(fun, list_to_vector(args))
371370
)
372371

@@ -389,7 +388,6 @@ export const importBuiltins = (context: Context, externalBuiltIns: CustomBuiltIn
389388
defineBuiltin(context, 'is_NaN(val)', misc.is_NaN)
390389
defineBuiltin(context, 'has_own_property(obj, prop)', misc.has_own_property)
391390
defineBuiltin(context, 'alert(val)', alert)
392-
// tslint:disable-next-line:ban-types
393391
defineBuiltin(context, 'timed(fun)', (f: Function) =>
394392
misc.timed(context, f, context.externalContext, externalBuiltIns.rawDisplay)
395393
)

src/cse-machine/interpreter.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
* and the legacy interpreter
66
*/
77

8-
/* tslint:disable:max-classes-per-file */
98
import type es from 'estree'
109
import { isArray } from 'lodash'
1110

1211
import type { IOptions } from '..'
12+
import { isSchemeLanguage } from '../alt-langs/mapper'
1313
import { UNKNOWN_LOCATION } from '../constants'
1414
import * as errors from '../errors/errors'
1515
import { RuntimeSourceError } from '../errors/runtimeSourceError'
1616
import { checkEditorBreakpoints } from '../stdlib/inspector'
1717
import type {
1818
Context,
1919
ContiguousArrayElements,
20+
Node,
21+
NodeTypeToNode,
2022
Result,
21-
Value,
2223
StatementSequence,
23-
Node,
24-
NodeTypeToNode
24+
Value
2525
} from '../types'
2626
import * as ast from '../utils/ast/astCreator'
2727
import {
@@ -34,14 +34,16 @@ import { evaluateBinaryExpression, evaluateUnaryExpression } from '../utils/oper
3434
import * as rttc from '../utils/rttc'
3535
import * as seq from '../utils/statementSeqTransform'
3636
import { checkProgramForUndefinedVariables } from '../validator/validator'
37-
import { isSchemeLanguage } from '../alt-langs/mapper'
3837
import Closure from './closure'
3938
import {
4039
Continuation,
4140
isCallWithCurrentContinuation,
4241
makeDummyContCallExpression
4342
} from './continuations'
4443
import * as instr from './instrCreator'
44+
import { flattenList, isList } from './macro-utils'
45+
import { Transformer } from './patterns'
46+
import { isApply, isEval, schemeEval } from './scheme-macros'
4547
import { Stack } from './stack'
4648
import {
4749
type AppInstr,
@@ -83,9 +85,6 @@ import {
8385
setVariable,
8486
valueProducing
8587
} from './utils'
86-
import { isApply, isEval, schemeEval } from './scheme-macros'
87-
import { Transformer } from './patterns'
88-
import { flattenList, isList } from './macro-utils'
8988

9089
/**
9190
* The control is a list of commands that still needs to be executed by the machine.

src/editors/ace/modes/source.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import { Variant } from '../../../langs'
22
import { SourceDocumentation } from '../docTooltip'
33

4-
/* tslint:disable */
5-
64
/**
75
* Source Mode for Ace Editor
86
* (Modified from javascript mode in default brace package)
97
* The link to the original JavaScript mode can be found here:
108
* https://github.com/ajaxorg/ace-builds/blob/master/src/mode-javascript.js
119
*
1210
* Changes includes:
13-
* 1) change code styles so that it passes tslint test
11+
* 1) change code styles
1412
* 2) refactor some code to ES2015 class syntax
1513
* 3) Encapsulate the orginal mode and higlightrules in two selectors so as to change according to source chapter
1614
* 4) changed regex to mark certain operators in pink

src/errors/errors.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
/* tslint:disable: max-classes-per-file */
2-
/* tslint:disable:max-line-length */
31
import { baseGenerator, generate } from 'astring'
42
import type es from 'estree'
53

64
import { UNKNOWN_LOCATION } from '../constants'
75
import type { Node, Value } from '../types'
86
import { stringify } from '../utils/stringify'
9-
import { ErrorType, ErrorSeverity, type SourceError } from './base'
7+
import { ErrorSeverity, ErrorType, type SourceError } from './base'
108
import { RuntimeSourceError } from './runtimeSourceError'
119

1210
//Wrap build-in function error in SourceError

src/errors/timeoutErrors.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* tslint:disable:max-classes-per-file */
21
import { JSSLANG_PROPERTIES } from '../constants'
32
import type { Node } from '../types'
43
import { stripIndent } from '../utils/formatters'

src/errors/typeErrors.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import { generate } from 'astring'
22
import type es from 'estree'
3-
43
import { UNKNOWN_LOCATION } from '../constants'
54
import type * as tsEs from '../typeChecker/tsESTree'
65
import type { Node, NodeWithInferredType, SArray, Type } from '../types'
6+
import { getSourceVariableDeclaration } from '../utils/ast/helpers'
77
import { simplify, stripIndent } from '../utils/formatters'
88
import { typeToString } from '../utils/stringify'
9-
import { getSourceVariableDeclaration } from '../utils/ast/helpers'
10-
import { ErrorType, ErrorSeverity, type SourceError } from './base'
11-
12-
// tslint:disable:max-classes-per-file
9+
import { ErrorSeverity, ErrorType, type SourceError } from './base'
1310

1411
export class InvalidArrayIndexType implements SourceError {
1512
public type = ErrorType.TYPE

src/name-extractor/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import { memoizedGetModuleDocsAsync, memoizedGetModuleManifestAsync } from '../m
88
import type { ModuleDocsEntry } from '../modules/moduleTypes'
99
import { isSourceModule } from '../modules/utils'
1010
import syntaxBlacklist from '../parser/source/syntax'
11+
import type { Context, Node } from '../types'
1112
import { getImportedName, getModuleDeclarationSource } from '../utils/ast/helpers'
1213
import { isDeclaration, isImportDeclaration, isNamespaceSpecifier } from '../utils/ast/typeGuards'
13-
import type { Context, Node } from '../types'
1414

1515
export enum DeclarationKind {
1616
KIND_IMPORT = 'import',
@@ -173,7 +173,6 @@ export async function getProgramNames(
173173

174174
while (queue.length > 0) {
175175
// Workaround due to minification problem
176-
// tslint:disable-next-line
177176
const node = queue.shift()!
178177
if (isFunction(node)) {
179178
// This is the only time we want raw identifiers

src/stdlib/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import createContext from '../createContext'
2-
import type { Value } from '../types'
32
import { Chapter } from '../langs'
3+
import type { Value } from '../types'
44
import * as list from './list'
55
import * as misc from './misc'
66
import * as parser from './parser'
@@ -50,7 +50,6 @@ export const chapter_4 = {
5050
...chapter_3,
5151
parse: (str: string, chapter: Chapter) => parser.parse(str, createContext(chapter)),
5252
tokenize: (str: string, chapter: Chapter) => parser.tokenize(str, createContext(chapter)),
53-
// tslint:disable-next-line:ban-types
5453
apply_in_underlying_javascript: (fun: Function, args: Value) =>
5554
fun.apply(fun, list.list_to_vector(args))
5655
}
@@ -61,7 +60,6 @@ export const chapter_library_parser = {
6160
is_NaN: misc.is_NaN,
6261
has_own_property: misc.has_own_property
6362
// defineBuiltin(context, 'alert(val)', alert)
64-
// tslint:disable-next-line:ban-types
6563
// timed: (f: Function: context: Context) => misc.timed(context, f, context.externalContext, externalBuiltIns.rawDisplay),
6664
}
6765

0 commit comments

Comments
 (0)