From 59415e85815c4c8e419875435335b54b795ee324 Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Tue, 14 May 2019 15:42:10 -0400 Subject: [PATCH 1/2] Silence all low-priority linter warnings --- .eslintrc | 8 ++++---- validator/.eslintrc | 23 +++++++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.eslintrc b/.eslintrc index 979fd6c74c8b..2fa82ef42bdd 100644 --- a/.eslintrc +++ b/.eslintrc @@ -59,7 +59,7 @@ "amphtml-internal/no-export-side-effect": 2, "amphtml-internal/no-for-of-statement": 2, "amphtml-internal/no-global": 0, - "amphtml-internal/no-has-own-property-method": 1, + "amphtml-internal/no-has-own-property-method": 2, "amphtml-internal/no-import": 2, "amphtml-internal/no-import-rename": 2, "amphtml-internal/no-is-amp-alt": 2, @@ -70,12 +70,12 @@ "amphtml-internal/no-style-display": 2, "amphtml-internal/no-style-property-setting": 2, "amphtml-internal/no-swallow-return-from-allow-console-error": 2, - "amphtml-internal/prefer-deferred-promise": 1, + "amphtml-internal/prefer-deferred-promise": 0, "amphtml-internal/prefer-destructuring": 2, "amphtml-internal/query-selector": 2, "amphtml-internal/todo-format": 0, - "amphtml-internal/unused-private-field": 1, - "amphtml-internal/vsync": 1, + "amphtml-internal/unused-private-field": 0, + "amphtml-internal/vsync": 0, "array-bracket-spacing": [2, "never"], "arrow-parens": [2, "as-needed"], "arrow-spacing": 2, diff --git a/validator/.eslintrc b/validator/.eslintrc index 98d636e94a51..1e38f79bf994 100644 --- a/validator/.eslintrc +++ b/validator/.eslintrc @@ -23,8 +23,11 @@ "amphtml-internal/no-module-exports": 0, "amphtml-internal/no-for-of-statement": 0, "amphtml-internal/no-has-own-property-method": 0, - "chai-expect/missing-assertion": 1, + "chai-expect/missing-assertion": 0, "google-camelcase/google-camelcase": 0, + "jasmine/expect-matcher": 0, + "jasmine/no-spec-dupes": 0, + "jasmine/prefer-jasmine-matcher": 0, "jsdoc/check-param-names": 0, "jsdoc/check-tag-names": 0, "jsdoc/check-types": 0, @@ -32,24 +35,24 @@ "jsdoc/require-param-name": 0, "jsdoc/require-param-type": 0, "jsdoc/require-returns-type": 0, - "max-len": [1, 80, 4, { + "max-len": [0, 80, 4, { "ignoreTrailingComments": true, "ignoreRegExpLiterals": true, "ignorePattern": "^import.*';|}\\ from.*;|.*require\\(.*;$|@typedef|@param|@return|@private|@const|@type|@implements", "ignoreUrls": true }], - "no-cond-assign": 1, - "no-div-regex": 1, + "no-cond-assign": 0, + "no-div-regex": 0, "no-multi-spaces": 0, - "no-throw-literal": 1, - "no-undef": 1, - "no-unused-vars": [1, { + "no-throw-literal": 0, + "no-undef": 0, + "no-unused-vars": [0, { "argsIgnorePattern": "^var_|opt_|unused", "varsIgnorePattern": "AmpElement|Def|Interface$" }], - "no-useless-concat": 1, - "no-var": 1, - "prefer-const": 1, + "no-useless-concat": 0, + "no-var": 0, + "prefer-const": 0, "require-jsdoc": 0 } } From 4ce846de7ea43ed7026949eb3e64b734c0fac99b Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Tue, 14 May 2019 15:51:03 -0400 Subject: [PATCH 2/2] Clean up useless code in lint.js --- build-system/tasks/lint.js | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/build-system/tasks/lint.js b/build-system/tasks/lint.js index 2529cc1f588b..d0922945a229 100644 --- a/build-system/tasks/lint.js +++ b/build-system/tasks/lint.js @@ -28,7 +28,7 @@ const log = require('fancy-log'); const path = require('path'); const watch = require('gulp-watch'); const {gitDiffNameOnlyMaster} = require('../git'); -const {isTravisBuild, isTravisPullRequestBuild} = require('../travis'); +const {isTravisBuild} = require('../travis'); const {maybeUpdatePackages} = require('./update-packages'); const isWatching = (argv.watch || argv.w) || false; @@ -36,7 +36,6 @@ const options = { fix: false, quiet: argv.quiet || false, }; -let collapseLintResults = isTravisBuild(); const rootDir = path.dirname(path.dirname(__dirname)); @@ -79,11 +78,6 @@ function runLinter(filePath, stream, options) { if (!isTravisBuild()) { log(colors.green('Starting linter...')); } - if (collapseLintResults) { - // TODO(#15255, #14761): Remove log folding after warnings are fixed. - log(colors.bold(colors.yellow('Lint results: ')) + 'Expand this section'); - console./* OK*/log('travis_fold:start:lint_results\n'); - } const fixedFiles = {}; return stream.pipe(eslint(options)) .pipe(eslint.formatEach('stylish', function(msg) { @@ -103,10 +97,6 @@ function runLinter(filePath, stream, options) { } })) .pipe(eslint.results(function(results) { - // TODO(#15255, #14761): Remove log folding after warnings are fixed. - if (collapseLintResults) { - console./* OK*/log('travis_fold:end:lint_results'); - } if (results.errorCount == 0 && results.warningCount == 0) { if (!isTravisBuild()) { logOnSameLine(colors.green('SUCCESS: ') + @@ -157,9 +147,6 @@ function jsFilesChanged() { * @return {boolean} */ function eslintRulesChanged() { - if (!isTravisPullRequestBuild()) { - return false; - } return gitDiffNameOnlyMaster().filter(function(file) { return path.basename(file).includes('.eslintrc') || path.dirname(file) === 'build-system/eslint-rules'; @@ -180,7 +167,6 @@ function setFilesToLint(files) { log(colors.cyan(file)); }); } - collapseLintResults = false; } /** @@ -195,9 +181,7 @@ function lint() { if (argv.files) { setFilesToLint(argv.files.split(',')); } else if (!eslintRulesChanged() && - (isTravisPullRequestBuild() || - process.env.LOCAL_PR_CHECK || - argv['local-changes'])) { + (process.env.LOCAL_PR_CHECK || argv['local-changes'])) { const jsFiles = jsFilesChanged(); if (jsFiles.length == 0) { log(colors.green('INFO: ') + 'No JS files in this PR');