diff --git a/.eslintrc.json b/.eslintrc.json index c84c406591..4a7bee0aec 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,18 +3,13 @@ "node": true, "es6": true }, - "extends": [ - "eslint:recommended", - "prettier" - ], + "extends": ["eslint:recommended", "prettier"], "parserOptions": { "ecmaVersion": 2019, "warnOnUnsupportedTypeScriptVersion": false, "sourceType": "module" }, - "plugins": [ - "eslint-plugin-empty-returns" - ], + "plugins": ["eslint-plugin-empty-returns"], "rules": { "array-callback-return": "error", "arrow-body-style": "error", @@ -24,7 +19,8 @@ "empty-returns/main": "error", "eqeqeq": "error", "guard-for-in": "error", - "new-cap": [ "error", + "new-cap": [ + "error", { "capIsNew": false } @@ -59,9 +55,10 @@ "no-self-compare": "error", "no-sync": "error", "no-undef-init": "error", - "no-unneeded-ternary": [ "error", { "defaultAssignment": false } ], + "no-unneeded-ternary": ["error", {"defaultAssignment": false}], "no-unused-expressions": "error", - "no-unused-vars": [ "error", + "no-unused-vars": [ + "error", { "vars": "local", "varsIgnorePattern": "print_elapsed_time|check_duplicate_ids" @@ -71,9 +68,10 @@ "no-useless-constructor": "error", "no-var": "error", "object-shorthand": "error", - "one-var": [ "error", "never" ], + "one-var": ["error", "never"], "prefer-arrow-callback": "error", - "prefer-const": [ "error", + "prefer-const": [ + "error", { "ignoreReadBeforeAssign": true } @@ -82,15 +80,12 @@ "sort-imports": "error", "spaced-comment": "off", "strict": "off", - "valid-typeof": [ "error", { "requireStringLiterals": true } ], + "valid-typeof": ["error", {"requireStringLiterals": true}], "yoda": "error" }, "overrides": [ { - "files": [ - "frontend_tests/**/*.{js,ts}", - "static/js/**/*.{js,ts}" - ], + "files": ["frontend_tests/**/*.{js,ts}", "static/js/**/*.{js,ts}"], "globals": { "$": false, "ClipboardJS": false, @@ -301,10 +296,7 @@ } }, { - "files": [ - "frontend_tests/casper_tests/*.js", - "frontend_tests/casper_lib/*.js" - ], + "files": ["frontend_tests/casper_tests/*.js", "frontend_tests/casper_lib/*.js"], "rules": { // Don’t require ES features that PhantomJS doesn’t support "no-var": "off", @@ -314,10 +306,7 @@ }, { "files": ["**/*.ts"], - "extends": [ - "plugin:@typescript-eslint/recommended", - "prettier/@typescript-eslint" - ], + "extends": ["plugin:@typescript-eslint/recommended", "prettier/@typescript-eslint"], "parserOptions": { "project": "tsconfig.json" }, @@ -330,7 +319,10 @@ "@typescript-eslint/array-type": "error", "@typescript-eslint/await-thenable": "error", "@typescript-eslint/consistent-type-assertions": "error", - "@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true }], + "@typescript-eslint/explicit-function-return-type": [ + "error", + {"allowExpressions": true} + ], "@typescript-eslint/member-ordering": "error", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-extraneous-class": "error", @@ -338,7 +330,7 @@ "@typescript-eslint/no-parameter-properties": "error", "@typescript-eslint/no-unnecessary-qualifier": "error", "@typescript-eslint/no-unnecessary-type-assertion": "error", - "@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" } ], + "@typescript-eslint/no-unused-vars": ["error", {"varsIgnorePattern": "^_"}], "@typescript-eslint/no-use-before-define": "error", "@typescript-eslint/no-useless-constructor": "error", "@typescript-eslint/prefer-includes": "error", diff --git a/frontend_tests/.eslintrc.json b/frontend_tests/.eslintrc.json index 4cd05701bc..78d379ee88 100644 --- a/frontend_tests/.eslintrc.json +++ b/frontend_tests/.eslintrc.json @@ -3,7 +3,7 @@ "shared-node-browser": true, "es6": true }, - "parserOptions": { "ecmaVersion": 2018 }, + "parserOptions": {"ecmaVersion": 2018}, "globals": { "assert": false, "casper": false, diff --git a/static/js/tslint.json b/static/js/tslint.json index 7b73ab8410..4f93ae90ed 100644 --- a/static/js/tslint.json +++ b/static/js/tslint.json @@ -1,8 +1,6 @@ { "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], + "extends": ["tslint:recommended"], "jsRules": {}, "rules": {}, "rulesDirectory": [] diff --git a/tools/webpack.assets.json b/tools/webpack.assets.json index 4ae9918ade..34b172cb05 100644 --- a/tools/webpack.assets.json +++ b/tools/webpack.assets.json @@ -45,17 +45,13 @@ "./static/js/loading.js", "./static/styles/portico/billing.scss" ], - "portico": [ - "./static/js/bundles/portico.js" - ], + "portico": ["./static/js/bundles/portico.js"], "error-styles": [ "./static/third/bootstrap/css/bootstrap.css", "./static/third/bootstrap/css/bootstrap-responsive.css", "./static/styles/portico/portico-styles.scss" ], - "common": [ - "./static/js/bundles/common.js" - ], + "common": ["./static/js/bundles/common.js"], "help": [ "./static/js/bundles/portico.js", "simplebar/dist/simplebar.css", @@ -97,14 +93,8 @@ "./static/js/analytics/support.js", "./static/styles/app_components.scss" ], - "dev-login": [ - "./static/js/bundles/portico.js", - "./static/js/portico/dev-login.js" - ], - "desktop-login": [ - "./static/js/bundles/portico.js", - "./static/js/portico/desktop-login.js" - ], + "dev-login": ["./static/js/bundles/portico.js", "./static/js/portico/dev-login.js"], + "desktop-login": ["./static/js/bundles/portico.js", "./static/js/portico/desktop-login.js"], "desktop-redirect": [ "./static/js/bundles/portico.js", "./static/js/portico/desktop-redirect.js" @@ -128,11 +118,6 @@ "./static/js/stats/stats.js", "plotly.js/dist/plotly-basic.min.js" ], - "app": [ - "./static/js/bundles/app.js", - "katex/dist/katex.min.js" - ], - "digest": [ - "./static/js/bundles/portico.js" - ] + "app": ["./static/js/bundles/app.js", "katex/dist/katex.min.js"], + "digest": ["./static/js/bundles/portico.js"] }