Get started with jshint CDN
MIT licensed
JSHint: popular tool, identifies, corrects JS coding errors and inconsistencies.
Tags:- detect
- code-analysis
Stable version
Copied!
How to start using jshint CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with jshint CDN - cdnhub.io</title>
<script src="https://cdn.jsdelivr.net/npm/jshint/dist/jshint.min.js"></script>
<script src="https://cdn.cdnhub.io/jshint/2.13.6/jshint.min.js"></script>
<script>
const sourceCode = `
function add(a, b) {
return a + b;
}
function multiply(a, b) {
return a * b;
}
const result = add(multiply(2, 3), 5);
console.log(result);
`;
const options = {
esversion: 6,
};
const ast = JSHINT.parse(sourceCode, options, 'esnext');
const errors = JSHINT.findErrors(ast);
if (errors.length > 0) {
console.log('JSHint Errors:');
errors.forEach((error) => console.log(error.reason));
} else {
console.log('No JSHint Errors');
}
try {
eval(sourceCode);
console.log('Code executed without errors');
} catch (error) {
console.log('Code execution failed:', error.message);
}
</script>
</head>
<body></body>
</html>
Copied!
Copied!
All versions
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
2.1.4
2.10.0
2.10.1
2.10.2
2.10.3
2.11.0
2.11.0-rc1
2.11.1
2.11.2
2.12.0
2.13.0
2.13.1
2.13.2
2.13.3
2.13.4
2.13.5
*** 2.13.6
2.5.1
2.5.10
2.5.11
2.5.2
2.5.3
2.5.4
2.5.5
2.5.6
2.5.7
2.5.8
2.5.9
2.6.0
2.6.1
2.6.2
2.6.3
2.7.0
2.8.0
2.9.1
2.9.1-rc1
2.9.1-rc2
2.9.1-rc3
2.9.2
2.9.3
2.9.4
2.9.5
2.9.6
2.9.7