Analyze TypeScript and HTML files to identify hardcoded API endpoints that may require refactoring.
- A TypeScript source file
- Its corresponding HTML template file
# Snippet for ReactJS ES6 component template | |
'.source.js.jsx': | |
'React component template': | |
'prefix': 'comptempl' | |
'body': """ | |
import React from 'react' | |
export default class ${1} extends React.Component { | |
constructor(props) { | |
super(props) |
#!/usr/bin/env bash | |
# | |
# Approach: | |
# 1. Find variable declaration in the form of "$my-var: anyvalue" | |
# 2. Loop through found variables and find occurrences of each variable in all sass files | |
# 3. Filter out vars that occurred only once | |
if [ -z "$1" ]; then | |
echo "Please specify a directory as the first argument." | |
exit 1 |
var debug = process.env.NODE_ENV !== "production"; | |
var webpack = require('webpack'); | |
module.exports = { | |
context: __dirname, | |
devtool: debug ? "inline-sourcemap" : null, | |
entry: "./js/scripts.js", | |
output: { | |
path: __dirname + "/js", | |
filename: "scripts.min.js" |
/* eslint no-var: 0 */ | |
var path = require('path'); | |
var webpack = require('webpack'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | |
var StyleLintPlugin = require('stylelint-webpack-plugin'); |
{ | |
"name": "tourist-club", | |
"version": "0.0.0", | |
"lockfileVersion": 1, | |
"requires": true, | |
"dependencies": { | |
"@agm/core": { | |
"version": "1.0.0-beta.2", | |
"resolved": "https://registry.npmjs.org/@agm/core/-/core-1.0.0-beta.2.tgz", | |
"integrity": "sha512-3bdfvkWDmJszpj/F6Fzgv7sks0cs/cUEQPfs37tcJFz3jc62SsXy4TGb/WJT8FpH2nSGE6DonP8lXuFxB0lblQ==" |
describe('', () => { | |
let originalPluginReference; | |
let globalPluginStub; | |
beforeAll(() => { | |
// Backing up original property reference, so we could restore it | |
// after all tests being performed | |
originalPluginReference = window['GlobalPlugin']; | |
}); | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Efficient Debugging with DevTools. MagicJS</title> | |
</head> | |
<body> | |
<h1>Efficient Debugging with DevTools. MagicJS</h1> | |
<input id="num1" type="text" placeholder="First number"> | |
<input id="num2" type="text" placeholder="Second number"> |