Skip to content

Commit b78a583

Browse files
authored
Converted to TypeScript (#35)
* Remove babel & webpack. Converted code to TypeScript. * Safer null checking all around * 100% code coverage w/ re-organized tests * Removed dependency on LoDash
1 parent 08fabd3 commit b78a583

19 files changed

+6033
-9145
lines changed

.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

.eslintrc.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"root": true,
3+
"overrides": [
4+
{
5+
"files": ["src/**/*.ts"],
6+
"parserOptions": {
7+
"project": ["tsconfig.json"]
8+
},
9+
"extends": [
10+
"eslint:recommended",
11+
"plugin:@typescript-eslint/strict"
12+
],
13+
"rules": {
14+
"@typescript-eslint/explicit-function-return-type": "warn",
15+
"@typescript-eslint/method-signature-style": ["warn"],
16+
"@typescript-eslint/no-extraneous-class": "off",
17+
"no-invalid-this": "off",
18+
"@typescript-eslint/no-invalid-this": "error",
19+
"no-loop-func": "off",
20+
"@typescript-eslint/no-loop-func": "error",
21+
"no-redeclare": "off",
22+
"@typescript-eslint/no-redeclare": "error",
23+
"no-shadow": "off",
24+
"@typescript-eslint/no-shadow": "error",
25+
"no-use-before-define": "off",
26+
"@typescript-eslint/no-use-before-define": "error",
27+
"@typescript-eslint/no-unnecessary-qualifier": "warn",
28+
"@typescript-eslint/prefer-readonly": "warn",
29+
"@typescript-eslint/prefer-regexp-exec": "error",
30+
"no-return-await": "off",
31+
"@typescript-eslint/return-await": "error",
32+
"@typescript-eslint/strict-boolean-expressions": "error",
33+
34+
"array-callback-return": "error",
35+
"complexity": ["error", { "max": 8 }],
36+
"eqeqeq": ["error", "always", { "null": "ignore" }],
37+
"no-unused-vars": "warn",
38+
"object-shorthand": ["warn", "always"]
39+
}
40+
},
41+
{
42+
"files": ["src/**/*.test.ts"],
43+
"parserOptions": {
44+
"project": ["tsconfig.test.json"]
45+
},
46+
"rules": {
47+
"@typescript-eslint/no-non-null-assertion": ["off"],
48+
"@typescript-eslint/explicit-function-return-type": "off"
49+
}
50+
}
51+
]
52+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
node_modules
33
dist
44
coverage
5+
test

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ You can parse the contents of the file to create a `Song` object:
3535

3636
```javascript
3737
const fs = require('fs');
38-
const SongPro = require('SongPro');
38+
const { SongPro } = require('songpro');
3939

4040
fs.readFile('escape-capsule.md', function(err, contents) {
4141
let song = SongPro.parse(contents);
@@ -48,7 +48,7 @@ fs.readFile('escape-capsule.md', function(err, contents) {
4848

4949
## Contributing
5050

51-
Bug reports and pull requests are welcome on GitHub at https://github.com/SongProOrg/songpro-js.
51+
Bug reports and pull requests are welcome on GitHub at https://github.com/SongProOrg/songpro-javascript
5252

5353
## License
5454

0 commit comments

Comments
 (0)