MCPcopy Index your code
hub / github.com/ampproject/amphtml / lint

Function lint

build-system/tasks/lint.js:124–134  ·  view source on GitHub ↗

* Checks files for formatting (and optionally fixes them) with Eslint. * Explicitly makes sure the API doesn't check files in `.eslintignore`. * When local changes are linted (e.g. during CI), we also check if the list of * forbidden terms needs to be updated. * @return {Promise }

()

Source from the content-addressed store, hash-verified

122 * @return {Promise<void>}
123 */
124async function lint() {
125 const filesToCheck = getFilesToCheck(lintGlobs, {}, '.eslintignore');
126 if (filesToCheck.length == 0) {
127 return;
128 }
129 const forbiddenTerms = 'build-system/test-configs/forbidden-terms.js';
130 if (argv.local_changes && !filesToCheck.includes(forbiddenTerms)) {
131 filesToCheck.push(forbiddenTerms);
132 }
133 await runLinter(filesToCheck);
134}
135
136module.exports = {
137 lint,

Callers

nothing calls this directly

Calls 3

getFilesToCheckFunction · 0.85
runLinterFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected