-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🏗 Refactor lint.js
and update jsdoc/check-tag-names
rule
#15298
🏗 Refactor lint.js
and update jsdoc/check-tag-names
rule
#15298
Conversation
jsdoc/check-tag-names
rulejsdoc/check-tag-names
rule; Refactor lint.js
jsdoc/check-tag-names
rule; Refactor lint.js
lint.js
and update jsdoc/check-tag-names
rule
* | ||
* @return {boolean} | ||
*/ | ||
function eslintrcChangesInPr() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider checking that this is a PR build inside this function instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check for a PR build needs to be outside because it's also used when .eslintrc
is not in the list of files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, good idea. Done.
build-system/tasks/lint.js
Outdated
/** | ||
* Enables linting in strict mode. | ||
*/ | ||
function enableStrictMode() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: enableStrictLinting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
build-system/tasks/lint.js
Outdated
* | ||
* @param {!Array<string>} files | ||
*/ | ||
function setFiles(files) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: setFilesToLint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
build-system/tasks/lint.js
Outdated
*/ | ||
function setFiles(files) { | ||
config.lintGlobs = | ||
config.lintGlobs.filter(e => e !== '**/*.js').concat(files); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to check paths that end with **/*.js
instead of strictly matching?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works because there's only one positive glob in config.lintGlobs
:
amphtml/build-system/config.js
Lines 119 to 134 in 5088f70
lintGlobs: [ | |
'**/*.js', | |
'!**/*.extern.js', | |
'!{node_modules,build,dist,dist.3p,dist.tools,' + | |
'third_party}/**/*.*', | |
'!examples/**/*.*', | |
// TODO: temporary, remove when validator is up to date | |
'!validator/**/*.*', | |
'!eslint-rules/**/*.*', | |
'!karma.conf.js', | |
'!**/local-amp-chrome-extension/background.js', | |
'!extensions/amp-access/0.1/access-expr-impl.js', | |
'!extensions/amp-animation/0.1/css-expr-impl.js', | |
'!extensions/amp-bind/0.1/bind-expr-impl.js', | |
'!test/coverage/**/*.*', | |
], |
This PR:
jsdoc/check-tag-names
rulelint.js
so that:.eslintrc
is changedFollow up to #15294
Follow up to #15256
Partial fix for #15255