Skip to content

Commit

Permalink
Move overrides from JS to .eslintrc-strict
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimha committed May 14, 2018
1 parent 5f48ac0 commit 0dee7f0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"amphtml-internal/resolve-inside-promise-resolver": 1,
"amphtml-internal/todo-format": 0,
"amphtml-internal/unused-private-field": 1,
"amphtml-internal/vsync": 0,
"amphtml-internal/vsync": 1,
"array-bracket-spacing": [2, "never"],
"arrow-parens": [2, "as-needed"],
"arrow-spacing": 2,
Expand Down
14 changes: 14 additions & 0 deletions .eslintrc-strict
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"rules": {
"amphtml-internal/resolve-inside-promise-resolver": 2,
"amphtml-internal/unused-private-field": 2,
"amphtml-internal/vsync": 2,
"valid-jsdoc": [2, {
"prefer": {"return": "return"},
"requireParamDescription": false,
"requireReturn": false,
"requireReturnType": true,
"requireReturnDescription": false
}]
}
}
17 changes: 3 additions & 14 deletions build-system/tasks/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,9 @@ function lint() {
config.lintGlobs =
config.lintGlobs.filter(e => e !== '**/*.js').concat(getLintFiles());
}
// Override .eslintrc settings here.
options['rules'] = {
// TODO(rsimha, #15255): Make this error by default in .eslintrc.
'valid-jsdoc': [2, {
'prefer': {'return': 'return'},
'requireParamDescription': false,
'requireReturn': false,
'requireReturnType': true,
'requireReturnDescription': false,
}],
// TODO(jridgewell, #14761): Make these error by default in .eslintrc.
'amphtml-internal/resolve-inside-promise-resolver': 2,
'amphtml-internal/unused-private-field': 2,
};
// TODO(#14761, #15255): Remove these overrides and make the rules errors by
// default in .eslintrc after all code is fixed.
options['configFile'] = '.eslintrc-strict';
}
const stream = initializeStream(config.lintGlobs, {});
return runLinter('.', stream, options);
Expand Down
3 changes: 1 addition & 2 deletions src/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"rules": {
"amphtml-internal/no-global": 2,
"amphtml-internal/vsync": 1
"amphtml-internal/no-global": 2
}
}

0 comments on commit 0dee7f0

Please sign in to comment.