ui: Add selective no-console eslint rule (#11938)

This commit is contained in:
John Cowen 2022-01-05 16:56:26 +00:00 committed by GitHub
parent 31dee2340f
commit 6d0a73c0eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 14 deletions

View File

@ -1,8 +0,0 @@
module.exports = {
extends: ['./.eslintrc.js'],
rules: {
'no-console': 'warn',
'no-unused-vars': ['error', { args: 'none' }],
'ember/routes-segments-snake-case': 'warn',
},
};

View File

@ -14,6 +14,7 @@ module.exports = {
browser: true, browser: true,
}, },
rules: { rules: {
'no-console': ['error', {allow: ['error', 'info']}],
'no-unused-vars': ['error', { args: 'none' }], 'no-unused-vars': ['error', { args: 'none' }],
'ember/no-new-mixins': ['warn'], 'ember/no-new-mixins': ['warn'],
'ember/no-jquery': 'warn', 'ember/no-jquery': 'warn',

View File

@ -240,7 +240,7 @@ export default class FSMWithOptionalLocation {
*/ */
transitionTo(url) { transitionTo(url) {
if (this.router.currentRouteName.startsWith('docs') && url.startsWith('console://')) { if (this.router.currentRouteName.startsWith('docs') && url.startsWith('console://')) {
console.log(`location.transitionTo: ${url.substr(10)}`); console.info(`location.transitionTo: ${url.substr(10)}`);
return true; return true;
} }
const previousOptional = Object.entries(this.optionalParams()); const previousOptional = Object.entries(this.optionalParams());

View File

@ -2,7 +2,6 @@ import OAuth2CodeProvider from 'torii/providers/oauth2-code';
import { runInDebug } from '@ember/debug'; import { runInDebug } from '@ember/debug';
export default class OAuth2CodeWithURLProvider extends OAuth2CodeProvider { export default class OAuth2CodeWithURLProvider extends OAuth2CodeProvider {
name = 'oidc-with-url'; name = 'oidc-with-url';
buildUrl() { buildUrl() {
@ -23,7 +22,9 @@ export default class OAuth2CodeWithURLProvider extends OAuth2CodeProvider {
authorizationCode: decodeURIComponent(authData[responseType]), authorizationCode: decodeURIComponent(authData[responseType]),
provider: name, provider: name,
}; };
runInDebug(_ => console.log('Retrieved the following creds from the OAuth Provider', creds)) runInDebug(_ =>
console.info('Retrieved the following creds from the OAuth Provider', creds)
);
return creds; return creds;
}); });
} }
@ -34,6 +35,4 @@ export default class OAuth2CodeWithURLProvider extends OAuth2CodeProvider {
return popup.close(); return popup.close();
} }
} }
} }

View File

@ -16,7 +16,6 @@
"lint": "FORCE_COLOR=1 npm-run-all --aggregate-output --continue-on-error --parallel lint:*", "lint": "FORCE_COLOR=1 npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint:hbs": "ember-template-lint .", "lint:hbs": "ember-template-lint .",
"lint:js": "eslint .", "lint:js": "eslint .",
"_lint:dev:js": "eslint -c .dev.eslintrc.js --fix ./*.js ./.*.js app config lib server tests",
"format": "npm-run-all format:*", "format": "npm-run-all format:*",
"format:js": "prettier --write \"{app,config,lib,server,vendor,tests}/**/*.js\" ./*.js ./.*.js", "format:js": "prettier --write \"{app,config,lib,server,vendor,tests}/**/*.js\" ./*.js ./.*.js",
"format:sass": "prettier --write \"app/**/*.scss\"", "format:sass": "prettier --write \"app/**/*.scss\"",