Skip to content

Commit c7bd070

Browse files
committed
renaming from 'Typl' to 'TypL' to emphasize the linter part
1 parent 88b4722 commit c7bd070

File tree

8 files changed

+34
-34
lines changed

8 files changed

+34
-34
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Typl
1+
# TypL
22

3-
Coming Soon
3+
The JavaScript Type Linter. Coming Soon.
44

55
## License
66

lib/cli.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var path = require("path");
44
var fs = require("fs");
55

6-
var Typl = require(path.join(__dirname,".."));
6+
var TL = require(path.join(__dirname,".."));
77

88
var args = require("minimist")(process.argv.slice(2),{
99
boolean: ["help",],
@@ -16,7 +16,7 @@ if (args.help) {
1616
}
1717
else if (args.file) {
1818
let contents = fs.readFileSync(path.resolve(args.file),"utf-8");
19-
Typl.Checker.check(contents);
19+
TL.Checker.check(contents);
2020
}
2121
else {
2222
reportError("Incorrect usage.",/*showHelp=*/true);
@@ -37,7 +37,7 @@ function reportError(err,showHelp = false) {
3737
}
3838

3939
function outputHelp() {
40-
console.log("Typl Usage:");
40+
console.log("TypL Usage:");
4141
console.log(" typl --file={FILENAME}");
4242
console.log("");
4343
console.log("--help show this help");

lib/copyright-header.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! typl.js
1+
/*! TypL
22
v${version} (c) ${year} Kyle Simpson
33
MIT License: http://getify.mit-license.org
44
*/

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "typl",
33
"version": "0.3.0",
4-
"description": "Optional type annotations and type-check linting",
4+
"description": "Optional type annotations and type-check linting in standard JS",
55
"main": "./lib/index.js",
66
"scripts": {
77
"test": "node scripts/node-tests.js",
@@ -27,15 +27,15 @@
2727
"qunit": "~2.9.1",
2828
"terser": "~3.14.1"
2929
},
30-
"repository": "getify/Typl",
30+
"repository": "getify/TypL",
3131
"keywords": [
3232
"types"
3333
],
3434
"bugs": {
35-
"url": "https://github.com/getify/Typl/issues",
35+
"url": "https://github.com/getify/TypL/issues",
3636
"email": "[email protected]"
3737
},
38-
"homepage": "https://github.com/getify/Typl",
38+
"homepage": "https://github.com/getify/TypL",
3939
"author": "Kyle Simpson <[email protected]>",
4040
"license": "MIT"
4141
}

scripts/build-core.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ var fs = require("fs"),
2222

2323
// ***************************
2424

25-
console.log("*** Building Typl ***");
25+
console.log("*** Building TypL ***");
2626

2727
// read version number from package.json
2828
var packageJSON = JSON.parse(
2929
fs.readFileSync(
3030
path.join(ROOT_DIR,"package.json"),
31-
{ encoding: "utf8" }
31+
{ encoding: "utf8", }
3232
)
3333
);
3434
var version = packageJSON.version;
3535

3636
// read copyright-header text, render with version and year
3737
var copyrightHeader = fs.readFileSync(
3838
path.join(SRC_DIR,"copyright-header.txt"),
39-
{ encoding: "utf8" }
39+
{ encoding: "utf8", }
4040
).replace(/`/g,"");
4141
copyrightHeader = Function("version","year",`return \`${copyrightHeader}\`;`)( version, year );
4242

@@ -49,26 +49,26 @@ try {
4949
}
5050
catch (err) { }
5151

52-
for (let [idx,SRC] of LIB_SRC.entries()) {
52+
for (let [idx,SRC,] of LIB_SRC.entries()) {
5353
let DIST = LIB_DIST[idx];
5454

5555
console.log(`Building: ${DIST}`);
5656

5757
try {
5858
let result = "";
5959

60-
result += fs.readFileSync(SRC,{ encoding: "utf8" });
60+
result += fs.readFileSync(SRC,{ encoding: "utf8", });
6161

6262
result = ugly.minify(result,{
6363
mangle: {
64-
keep_fnames: true
64+
keep_fnames: true,
6565
},
6666
compress: {
67-
keep_fnames: true
67+
keep_fnames: true,
6868
},
6969
output: {
70-
comments: /^!/
71-
}
70+
comments: /^!/,
71+
},
7272
});
7373

7474
// was compression successful?
@@ -81,7 +81,7 @@ for (let [idx,SRC] of LIB_SRC.entries()) {
8181
result = `${copyrightHeader}${result.code}`;
8282

8383
// write dist
84-
fs.writeFileSync( DIST, result, { encoding: "utf8" } );
84+
fs.writeFileSync( DIST, result, { encoding: "utf8", } );
8585
}
8686
catch (err) {
8787
console.error(err);

tests/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5-
<title>Typl-Runtime Test Suite</title>
5+
<title>TypL: Runtime Test Suite</title>
66
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.9.1.css">
77
</head>
88
<body>

tests/qunit.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ function begin(details){
1313
printEnvNotification();
1414

1515
if (details.totalTests > 0) {
16-
console.log(`Typl Test Suite (${details.totalTests})`);
16+
console.log(`TypL Test Suite (${details.totalTests})`);
1717
console.log("");
1818
}
1919
else {
20-
console.log(`Typl Test Suite: empty!`);
20+
console.log("TypL Test Suite: empty!");
2121
process.exit(1);
2222
}
2323
}
@@ -26,7 +26,7 @@ function testLog(details) {
2626
var testId = details.testId;
2727

2828
testLogEntries[testId] = testLogEntries[testId] || {};
29-
testLogEntries[testId][details.message] = {...details};
29+
testLogEntries[testId][details.message] = { ...details, };
3030
}
3131

3232
function testDone(results){
@@ -36,7 +36,7 @@ function testDone(results){
3636
console.log(`Failed: '${results.name}' (${results.failed}/${results.total})`);
3737
for (let i = 0; i < results.assertions.length; i++) {
3838
if (results.assertions[i].result === false) {
39-
let { message, expected, actual, source } = testLogEntries[testId][results.assertions[i].message];
39+
let { message, expected, actual, source, } = testLogEntries[testId][results.assertions[i].message];
4040
console.log(` ${message}`);
4141
// is there a JS exception stack trace included?
4242
if (source && /^\w*Error: .+/.test(source)) {

tests/tests.checker.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"use strict";
22

33
var path = require("path");
4-
var Typl = require(path.join(__dirname,"..","lib"));
4+
var TL = require(path.join(__dirname,"..","lib"));
55

66
QUnit.test( "Checker: API", function test(assert){
77
assert.expect( 1 );
8-
assert.ok( _isFunction( Typl.Checker.check ), "check(..)" );
8+
assert.ok( _isFunction( TL.Checker.check ), "check(..)" );
99
} );
1010

1111
QUnit.test( "Checker: #6 number sub-types", function test(assert){
@@ -22,7 +22,7 @@ QUnit.test( "Checker: #6 number sub-types", function test(assert){
2222
c = b; // error: can't assign number to finite
2323
`;
2424

25-
let { outputMessages, } = Typl.Checker.check(code,{ verbose: false, });
25+
let { outputMessages, } = TL.Checker.check(code,{ verbose: false, });
2626
let errors = outputMessages.filter(function isError(msg){ return msg.type == "error"; });
2727
assert.equal(outputMessages.length,6,"total output length");
2828
assert.equal(errors.length,2,"num errors");
@@ -49,7 +49,7 @@ QUnit.test( "Checker: #7 enforce bool type check in conditionals", function test
4949
do{} while(foo()) // error
5050
let b = foo() ? 1 : 0; // error`
5151

52-
let {outputMessages} = Typl.Checker.check(code, {verbose:false});
52+
let {outputMessages} = TL.Checker.check(code, {verbose:false});
5353
let errors = outputMessages.filter(m => m.type == "error")
5454
assert.equal(outputMessages.length, 18, 'total output length');
5555
assert.equal(errors.length, 6, 'num errors');
@@ -62,7 +62,7 @@ QUnit.test( "Checker: #8 any", function test(assert){
6262
a = 1; // also OK because a is still type any
6363
var b = a + 2; // error: mixed operand types: any and number`
6464

65-
let {outputMessages} = Typl.Checker.check(code, {verbose:false});
65+
let {outputMessages} = TL.Checker.check(code, {verbose:false});
6666
let errors = outputMessages.filter(m => m.type == "error")
6767
assert.equal(outputMessages.length, 16, 'total output length');
6868
assert.equal(errors.length, 1, 'num errors');
@@ -82,7 +82,7 @@ QUnit.test( "Checker: #9 undef", function test(assert){
8282
var d = undef\`\`;
8383
d = 4; // error, d is already tagged-type of undef`
8484

85-
let {outputMessages} = Typl.Checker.check(code, {verbose:false});
85+
let {outputMessages} = TL.Checker.check(code, {verbose:false});
8686
let errors = outputMessages.filter(m => m.type == "error")
8787
assert.equal(outputMessages.length, 24, 'total output length');
8888
assert.equal(errors.length, 2, 'num errors');
@@ -99,7 +99,7 @@ QUnit.test( "Checker: #17 Narrower number type inference", function test(assert)
9999
y = NaN // error, expected finite, got number
100100
z = "a" // error, expected number, found string`
101101

102-
let {outputMessages} = Typl.Checker.check(code, {verbose:false});
102+
let {outputMessages} = TL.Checker.check(code, {verbose:false});
103103
let errors = outputMessages.filter(m => m.type == "error")
104104
assert.equal(outputMessages.length, 29, 'total output length');
105105
assert.equal(errors.length, 3, 'num errors');
@@ -111,7 +111,7 @@ QUnit.test( "Checker: #33 Treat IIFE as a validated call-expression", function t
111111
return String(x);
112112
})(true);`
113113

114-
let {outputMessages} = Typl.Checker.check(code, {verbose:false});
114+
let {outputMessages} = TL.Checker.check(code, {verbose:false});
115115
let errors = outputMessages.filter(m => m.type == "error")
116116
assert.equal(outputMessages.length, 32, 'total output length');
117117
assert.equal(errors.length, 1, 'num errors');
@@ -125,7 +125,7 @@ QUnit.test( "Checker: #34 check tagged-type simple literals", function test(asse
125125
bool\`true\` // OK
126126
bool\`ok\` // error`
127127

128-
let {outputMessages} = Typl.Checker.check(code, {verbose:false});
128+
let {outputMessages} = TL.Checker.check(code, {verbose:false});
129129
let errors = outputMessages.filter(m => m.type == "error")
130130
assert.equal(outputMessages.length, 34, 'total output length');
131131
assert.equal(errors.length, 2, 'num errors');

0 commit comments

Comments
 (0)