StackEye is a chrome extension which lets user watch questions on stackoverflow and other stackexchange sites.StackEye notifies the user about any new comment/answer on watched questions.
(Run npm install to install TypeScript locally via package.json.)
If you run npm watch it will start the TypeScript compiler in watch mode, to let you know if the types are okay. You can also open the project directory in VS Code and it can mostly understand the project, including autocomplete for Chrome and jQuery APIs.
Limitations:
TypeScript checking is not integrated with the build/release process yet.
The compiler is not in strict mode, and "implicit any" is enabled, which means many things will only be detected as any (unknown type) for now.
I configured it for ES2016 (ES6), since I found const was already used in the code. This might be able to go higher, given that Chrome 64+ apparently supports ES2018.
If we wanted to type everything, we could add more JSDoc types all over the place, but it might be easier to rename all the files to .ts and add a transpilation step (.ts to .js). We could also transpile from say ES2018 to ES5, if we wanted compatibility with really old Chrome versions for some reason.
(Run
npm install
to install TypeScript locally viapackage.json
.)If you run
npm watch
it will start the TypeScript compiler in watch mode, to let you know if the types are okay. You can also open the project directory in VS Code and it can mostly understand the project, including autocomplete for Chrome and jQuery APIs.Limitations:
any
(unknown type) for now.const
was already used in the code. This might be able to go higher, given that Chrome 64+ apparently supports ES2018.If we wanted to type everything, we could add more JSDoc types all over the place, but it might be easier to rename all the files to .ts and add a transpilation step (.ts to .js). We could also transpile from say ES2018 to ES5, if we wanted compatibility with really old Chrome versions for some reason.