Skip to content

Commit 4217bd2

Browse files
committed
replace tslint with eslint, fix linting
1 parent eff7c5e commit 4217bd2

File tree

23 files changed

+2038
-499
lines changed

23 files changed

+2038
-499
lines changed

.eslintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# don't ever lint node_modules
2+
node_modules
3+
4+
# don't lint build output
5+
dist
6+
build
7+
8+
# don't lint rollup dist scripts
9+
scripts

.eslintrc.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": false,
5+
"es6": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/eslint-recommended",
10+
"plugin:@typescript-eslint/recommended"
11+
],
12+
"plugins": [
13+
"@typescript-eslint"
14+
],
15+
"parser": "@typescript-eslint/parser",
16+
"rules": {
17+
"@typescript-eslint/interface-name-prefix": [
18+
"warn",
19+
{
20+
"prefixWithI": "always"
21+
}
22+
]
23+
}
24+
}

.vscode/settings.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
{
2-
"typescript.tsdk": "node_modules\\typescript\\lib"
2+
"typescript.tsdk": "node_modules\\typescript\\lib",
3+
"search.exclude": {
4+
"**/node_modules": true,
5+
"**/.git": true,
6+
"**/*.log": true,
7+
"**/*.lock": true,
8+
"**/build": true,
9+
"**/dist": true
10+
},
311
}

README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ web audio API player is published to the [npm registry](https://npm.im/web-audio
1717

1818
This player has two modes, SOUND_MODE_AUDIO which uses the audio element to load sounds via the audio element and SOUND_MODE_FETCH to load sounds via the web audio API. Here are some of the differences between the two:
1919

20-
### the web audio API
20+
### the web audio API (SOUND_MODE_FETCH)
2121

2222
* No support for streaming
2323
* Files get loaded using fetch, the loading progress is in percent and it is a single value between 0 and 100 percent loaded
2424
* A song has to be fully fetched before it can be turned into a buffer and hence before the playback can start
2525

2626
For a more complete list of features, check out the w3c [web audio API features list](https://www.w3.org/TR/webaudio/#Features) in their [candidate recommendation document](https://www.w3.org/TR/webaudio/#Features)
2727

28-
### the audio element
28+
### the audio element (SOUND_MODE_AUDIO)
2929

3030
* Support for streaming
3131
* Files get loaded using the audio element, the loading progress is not just a single value, it can be split into multiple parts (time ranges), so for example the start of a song from 0 to 10 percent got loaded, then there is a blank of not yet loaded data and then also the part from 35 to 60 percent has been loaded
@@ -87,7 +87,7 @@ update npm to latest version
8787

8888
install the dependencies
8989

90-
`npm install`
90+
`npm i`
9191

9292
to build the distributions
9393

@@ -140,14 +140,6 @@ Unfortunatly the defined window does not have AudioContext:
140140
check out [[open] github ticket (as of 06/2019)](https://github.com/microsoft/TypeScript/issues/31686)
141141
the current [dom.d.ts on github](https://github.com/microsoft/TypeScript/blob/master/src/lib/dom.generated.d.ts)
142142

143-
### linting setup notes
144-
145-
TSlint will be deprecated [github ticket](https://github.com/palantir/tslint/issues/4534)
146-
147-
> we plan to deprecate TSLint and focus our efforts instead on improving ESLint’s TypeScript support
148-
149-
Their [blog post](https://medium.com/palantir/tslint-in-2019-1a144c2317a9) announcing that [TSLint](https://github.com/palantir/tslint) will be deprecated in 2019 and you should switch to [ESLint](https://github.com/eslint/eslint) when TSLint is officially deprecated
150-
151143
## TODOs (help wanted 😊)
152144

153145
* create a react example
@@ -224,6 +216,7 @@ fileInput.addEventListener('change', function(event) {
224216
* add an option that uses the visibility API to automatically mute and unmute a sound when the visibility changes
225217
* rewrite how the audiocontext is created, for browser that enforce that a user interaction has taken place before a context can be running
226218
* add option to persist the user volume choice using the localstorage
219+
* switch from tslint to eslint with typescript-eslint plugin / parser: TSlint will be deprecated [github ticket](https://github.com/palantir/tslint/issues/4534), read their [blog post](https://medium.com/palantir/tslint-in-2019-1a144c2317a9) and then switch to [ESLint](https://github.com/eslint/eslint)
227220

228221
## License
229222

dist/index.js

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

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)