Docsity

OpenJS Foundation webhint Practice Exam, Exams of Technology

Toggle sidebar
bg1
OpenJS Foundation webhint Practice Exam
**Question 1. What is the primary purpose of webhint?**
A) To minify JavaScript files
B) To lint web projects for best‑practice issues
C) To compile TypeScript to JavaScript
D) To generate service workers automatically
Answer: B
Explanation: webhint works as a linting tool that analyses HTML, CSS, JS and other web assets to
detect best‑practice violations, not as a build or compilation tool.
**Question 2. Which npm command installs webhint globally?**
A) npm install webhint --save-dev
B) npm install -g @hint/cli
C) npm install webhint --global
D) npm add webhint -g
Answer: B
Explanation: The official CLI package is `@hint/cli`; the `-g` flag installs it globally.
**Question 3. How can you run webhint against a remote URL?**
A) hint https://example.com
B) webhint scan https://example.com
C) hint https://example.com --format json
D) npx hint https://example.com
Answer: D
Explanation: Using `npx hint <url>` executes the CLI without a prior global install, scanning the
remote site.
**Question 4. In a .hintrc file, what does the “extends” property do?**
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e

Partial preview of the text

Download OpenJS Foundation webhint Practice Exam and more Exams Technology in PDF only on Docsity!

Question 1. What is the primary purpose of webhint? A) To minify JavaScript files B) To lint web projects for best‑practice issues C) To compile TypeScript to JavaScript D) To generate service workers automatically Answer: B Explanation: webhint works as a linting tool that analyses HTML, CSS, JS and other web assets to detect best‑practice violations, not as a build or compilation tool. Question 2. Which npm command installs webhint globally? A) npm install webhint --save-dev B) npm install - g @hint/cli C) npm install webhint --global D) npm add webhint - g Answer: B Explanation: The official CLI package is @hint/cli; the -g flag installs it globally. Question 3. How can you run webhint against a remote URL? A) hint https://example.com B) webhint scan https://example.com C) hint https://example.com --format json D) npx hint https://example.com Answer: D Explanation: Using npx hint <url> executes the CLI without a prior global install, scanning the remote site. Question 4. In a .hintrc file, what does the “extends” property do?

A) Adds custom parsers to the run B) Merges settings from another configuration C) Overrides the default formatter D) Enables the Chrome connector automatically Answer: B Explanation: “extends” allows you to inherit rules from an existing hint configuration such as progressive-web-apps. Question 5. Which connector enables webhint to run audits in a real Chrome browser? A) jsdom B) chrome C) edge D) puppeteer Answer: B Explanation: The chrome connector launches a headless Chrome instance to evaluate pages as a real browser would. Question 6. What file type does the “webpack-config” parser analyze? A) webpack.config.js or .ts files B) package.json only C) .babelrc files D) .eslintrc files Answer: A Explanation: The webpack-config parser reads the configuration file used by Webpack, which can be JavaScript or TypeScript. Question 7. Which formatter would you choose to generate an Excel report of hint results?

B)

C)