diff --git a/eslint.config.mjs b/eslint.config.mjs index 1ea76aac74..c6ebc947c9 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -3,6 +3,7 @@ import globals from 'globals'; import pluginVue from 'eslint-plugin-vue'; import pluginCypress from 'eslint-plugin-cypress'; import pluginJest from 'eslint-plugin-jest'; +import stylistic from '@stylistic/eslint-plugin'; import { defineConfig, globalIgnores } from 'eslint/config'; export default defineConfig([ @@ -26,8 +27,86 @@ export default defineConfig([ ...globals.browser, }, }, + plugins: { + '@stylistic': stylistic, + }, rules: { - 'indent': ['error', 2], + eqeqeq: ['error', 'always'], + curly: 'error', + 'default-param-last': 'error', + 'no-var': 'error', + 'prefer-arrow-callback': 'error', + 'prefer-const': 'error', + 'prefer-template': 'error', + + '@stylistic/array-bracket-newline': ['error', 'consistent'], + '@stylistic/array-bracket-spacing': 'error', + '@stylistic/array-element-newline': ['error', 'consistent'], + '@stylistic/arrow-parens': 'error', + '@stylistic/arrow-spacing': 'error', + '@stylistic/block-spacing': 'error', + '@stylistic/brace-style': 'error', + '@stylistic/comma-dangle': ['error', 'always-multiline'], + '@stylistic/comma-spacing': 'error', + '@stylistic/comma-style': 'error', + '@stylistic/computed-property-spacing': 'error', + '@stylistic/curly-newline': 'error', + '@stylistic/dot-location': ['error', 'property'], + '@stylistic/eol-last': 'error', + '@stylistic/function-call-argument-newline': ['error', 'consistent'], + '@stylistic/function-call-spacing': 'error', + '@stylistic/function-paren-newline': ['error', 'multiline-arguments'], + '@stylistic/generator-star-spacing': 'error', + '@stylistic/implicit-arrow-linebreak': 'error', + '@stylistic/indent': ['error', 2], + '@stylistic/indent-binary-ops': ['error', 2], + '@stylistic/key-spacing': 'error', + '@stylistic/keyword-spacing': 'error', + '@stylistic/linebreak-style': 'error', + '@stylistic/lines-between-class-members': 'error', + '@stylistic/max-statements-per-line': 'error', + '@stylistic/member-delimiter-style': 'error', + '@stylistic/new-parens': 'error', + '@stylistic/no-extra-semi': 'error', + '@stylistic/no-floating-decimal': 'error', + '@stylistic/no-mixed-operators': 'error', + '@stylistic/no-multi-spaces': 'error', + '@stylistic/no-multiple-empty-lines': 'error', + '@stylistic/no-tabs': 'error', + '@stylistic/no-trailing-spaces': 'error', + '@stylistic/no-whitespace-before-property': 'error', + '@stylistic/object-curly-newline': 'error', + '@stylistic/object-curly-spacing': ['error', 'always'], + '@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }], + '@stylistic/one-var-declaration-per-line': 'error', + '@stylistic/operator-linebreak': ['error', 'before'], + '@stylistic/padded-blocks': ['error', 'never'], + '@stylistic/quote-props': ['error', 'as-needed'], + '@stylistic/quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: 'avoidEscape' }], + '@stylistic/rest-spread-spacing': 'error', + '@stylistic/semi': ['error', 'always'], + '@stylistic/semi-spacing': 'error', + '@stylistic/semi-style': 'error', + '@stylistic/space-before-blocks': 'error', + '@stylistic/space-before-function-paren': ['error', { + anonymous: 'always', + named: 'never', + asyncArrow: 'always', + catch: 'always', + }], + '@stylistic/space-in-parens': 'error', + '@stylistic/space-infix-ops': 'error', + '@stylistic/space-unary-ops': ['error', { words: true, nonwords: false }], + '@stylistic/spaced-comment': 'error', + '@stylistic/switch-colon-spacing': 'error', + '@stylistic/template-curly-spacing': 'error', + '@stylistic/template-tag-spacing': 'error', + '@stylistic/type-annotation-spacing': 'error', + '@stylistic/type-generic-spacing': 'error', + '@stylistic/type-named-tuple-spacing': 'error', + '@stylistic/wrap-regex': 'error', + '@stylistic/yield-star-spacing': 'error', + 'vue/component-name-in-template-casing': ['error', 'PascalCase'], 'vue/no-v-html': 'off', 'vue/require-v-for-key': 'off', @@ -65,26 +144,6 @@ export default defineConfig([ 'vue/require-emit-validator': 'error', 'vue/require-name-property': 'error', 'vue/slot-name-casing': 'error', - 'eqeqeq': ['error', 'always'], - 'arrow-spacing': ['error'], - 'block-spacing': ['error'], - 'brace-style': ['error', 'stroustrup'], - 'comma-dangle': ['error', 'always-multiline'], - 'curly' : ['error'], - 'default-param-last': ['error'], - 'eol-last': ['error'], - 'keyword-spacing': ['error', {'before': true, 'after': true}], - 'space-before-blocks': ['error', 'always'], - 'linebreak-style': ['error', 'unix'], - 'no-trailing-spaces': ['error'], - 'no-var': ['error'], - 'prefer-arrow-callback': ['error'], - 'prefer-const': ['error'], - 'prefer-template': ['error'], - 'quotes': ['error', 'single', {'avoidEscape': true}], - 'semi': ['error', 'always'], - 'semi-style': ['error', 'last'], - 'template-curly-spacing': ['error', 'never'], }, }, { diff --git a/package-lock.json b/package-lock.json index 8d5ffbcba0..a1a60399f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,6 +51,7 @@ }, "devDependencies": { "@eslint/js": "^10.0.1", + "@stylistic/eslint-plugin": "^5.10.0", "@vue/test-utils": "^2.4.11", "@vue/vue3-jest": "^29.2.6", "babel-core": "^7.0.0-bridge.0", @@ -3842,6 +3843,71 @@ "@sinonjs/commons": "^3.0.0" } }, + "node_modules/@stylistic/eslint-plugin": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.10.0.tgz", + "integrity": "sha512-nPK52ZHvot8Ju/0A4ucSX1dcPV2/1clx0kLcH5wDmrE4naKso7TUC/voUyU1O9OTKTrR6MYip6LP0ogEMQ9jPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/types": "^8.56.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "estraverse": "^5.3.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": "^9.0.0 || ^10.0.0" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/picomatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/@types/babel__core": { "version": "7.20.4", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.4.tgz", diff --git a/package.json b/package.json index 09e3cd181e..b3153bba3c 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ }, "devDependencies": { "@eslint/js": "^10.0.1", + "@stylistic/eslint-plugin": "^5.10.0", "@vue/test-utils": "^2.4.11", "@vue/vue3-jest": "^29.2.6", "babel-core": "^7.0.0-bridge.0", diff --git a/resources/js/vue/app.js b/resources/js/vue/app.js index 7990c72481..f7b315d20e 100755 --- a/resources/js/vue/app.js +++ b/resources/js/vue/app.js @@ -46,8 +46,7 @@ axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; const token = document.head.querySelector('meta[name="csrf-token"]'); if (token) { axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; -} -else { +} else { console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); } diff --git a/resources/js/vue/components/BuildBuildPage.vue b/resources/js/vue/components/BuildBuildPage.vue index 88b4f75e2c..edcc2b427b 100644 --- a/resources/js/vue/components/BuildBuildPage.vue +++ b/resources/js/vue/components/BuildBuildPage.vue @@ -134,7 +134,7 @@ import { faCircleExclamation, faTriangleExclamation, } from '@fortawesome/free-solid-svg-icons'; -import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'; +import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; import BuildErrorList from './BuildBuildPage/BuildErrorList.vue'; import CodeBox from './shared/CodeBox.vue'; @@ -271,9 +271,9 @@ export default { }; if (this.previousBuildWithErrors) { - this.buildWithErrors.children.edges.forEach(({node: currentBuildNode}) => { + this.buildWithErrors.children.edges.forEach(({ node: currentBuildNode }) => { if (currentBuildNode.subProject) { - this.previousBuildWithErrors.children.edges.forEach(({node: previousBuildNode}) => { + this.previousBuildWithErrors.children.edges.forEach(({ node: previousBuildNode }) => { if (parseInt(currentBuildNode.subProject.id) === parseInt(previousBuildNode.subProject.id)) { retVal[parseInt(currentBuildNode.id)] = parseInt(previousBuildNode.id); } diff --git a/resources/js/vue/components/BuildBuildPage/BuildErrorItem.vue b/resources/js/vue/components/BuildBuildPage/BuildErrorItem.vue index 88c62c3d39..c65843870f 100644 --- a/resources/js/vue/components/BuildBuildPage/BuildErrorItem.vue +++ b/resources/js/vue/components/BuildBuildPage/BuildErrorItem.vue @@ -101,13 +101,13 @@ import { faCircleExclamation, faTriangleExclamation, } from '@fortawesome/free-solid-svg-icons'; -import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'; -import {getRepository} from '../shared/RepositoryIntegrations'; +import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; +import { getRepository } from '../shared/RepositoryIntegrations'; import 'core-js/actual/regexp/escape'; export default { name: 'BuildErrorItem', - components: {FontAwesomeIcon, CodeBox}, + components: { FontAwesomeIcon, CodeBox }, props: { buildError: { diff --git a/resources/js/vue/components/BuildBuildPage/BuildErrorList.vue b/resources/js/vue/components/BuildBuildPage/BuildErrorList.vue index 9478f729f7..82c5bcb482 100644 --- a/resources/js/vue/components/BuildBuildPage/BuildErrorList.vue +++ b/resources/js/vue/components/BuildBuildPage/BuildErrorList.vue @@ -121,7 +121,7 @@ const BUILD_QUERY = gql` export default { name: 'BuildErrorList', - components: {BuildErrorItem, LoadingIndicator}, + components: { BuildErrorItem, LoadingIndicator }, props: { buildId: { @@ -215,15 +215,13 @@ export default { return currentErrorList.filter(({ node }) => { return !previousErrorSet.has(this.stringifyError(node)); }); - } - else if (this.showFixedErrors) { + } else if (this.showFixedErrors) { // Note: showing the fixed errors actually shows errors for the previous build. // This may be confusing to users and should be re-evaluated in the future. return previousErrorList.filter(({ node }) => { return !currentErrorSet.has(this.stringifyError(node)); }); - } - else { + } else { throw 'Invalid state.'; } }, diff --git a/resources/js/vue/components/BuildCommentsPage.vue b/resources/js/vue/components/BuildCommentsPage.vue index 3e0d8d402c..19693fac06 100644 --- a/resources/js/vue/components/BuildCommentsPage.vue +++ b/resources/js/vue/components/BuildCommentsPage.vue @@ -167,7 +167,7 @@ export default { } } `, - update: data => data?.build?.comments?.edges, + update: (data) => data?.build?.comments?.edges, variables() { return { buildId: this.buildId, @@ -202,7 +202,7 @@ export default { this.commentText = ''; this.submitting = false; }) - .catch(error => { + .catch((error) => { console.error(error); this.submitting = false; alert('Failed to add comment. Please try again.'); diff --git a/resources/js/vue/components/BuildConfigure.vue b/resources/js/vue/components/BuildConfigure.vue index 7c2d65138e..7d7ba3b581 100644 --- a/resources/js/vue/components/BuildConfigure.vue +++ b/resources/js/vue/components/BuildConfigure.vue @@ -62,11 +62,11 @@ import { faCircleExclamation, faTriangleExclamation, } from '@fortawesome/free-solid-svg-icons'; -import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'; +import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; export default { name: 'BuildConfigure', - components: {FontAwesomeIcon, ConfigureCard, LoadingIndicator, BuildSummaryCard, BuildSidebar}, + components: { FontAwesomeIcon, ConfigureCard, LoadingIndicator, BuildSummaryCard, BuildSidebar }, props: { buildId: { @@ -110,7 +110,7 @@ export default { } `, update: (data) => { - let configures = data.build.configure !== null ? [{configure: data.build.configure}] : []; + let configures = data.build.configure !== null ? [{ configure: data.build.configure }] : []; data.build.children.edges.forEach((child) => { configures = configures.concat({ ...child.node, diff --git a/resources/js/vue/components/BuildCoveragePage.vue b/resources/js/vue/components/BuildCoveragePage.vue index d558a7d8ca..5465eaa641 100644 --- a/resources/js/vue/components/BuildCoveragePage.vue +++ b/resources/js/vue/components/BuildCoveragePage.vue @@ -184,13 +184,13 @@ import LoadingIndicator from './shared/LoadingIndicator.vue'; import BuildSidebar from './shared/BuildSidebar.vue'; import gql from 'graphql-tag'; import FilterBuilder from './shared/FilterBuilder.vue'; -import {faFolder, faReply} from '@fortawesome/free-solid-svg-icons'; -import {faFile} from '@fortawesome/free-regular-svg-icons'; -import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'; +import { faFolder, faReply } from '@fortawesome/free-solid-svg-icons'; +import { faFile } from '@fortawesome/free-regular-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; export default { name: 'BuildCoveragePage', - components: {FontAwesomeIcon, FilterBuilder, LoadingIndicator, DataTable, BuildSummaryCard, BuildSidebar}, + components: { FontAwesomeIcon, FilterBuilder, LoadingIndicator, DataTable, BuildSummaryCard, BuildSidebar }, props: { buildId: { @@ -360,7 +360,7 @@ export default { formattedTableRows() { const coverageByPrefix = {}; - this.coverage?.filter(edge => { + this.coverage?.filter((edge) => { return edge.node.filePath.startsWith(this.currentPrefix) || edge.node.filePath.startsWith(`./${this.currentPrefix}`); }).forEach((edge) => { const pathWithoutPrefix = edge.node.filePath.replace(/^.\//, '').slice(this.currentPrefix.length); @@ -373,8 +373,7 @@ export default { coverageByPrefix[cleanedPath].linesOfCodeUntested += edge.node.linesOfCodeUntested; coverageByPrefix[cleanedPath].branchesTested += edge.node.branchesTested; coverageByPrefix[cleanedPath].branchesUntested += edge.node.branchesUntested; - } - else { + } else { coverageByPrefix[cleanedPath] = { subProject: !isDirectory && edge.subProject ? edge.subProject : '', path: { @@ -391,7 +390,7 @@ export default { } }); - return Object.values(coverageByPrefix).map(obj => { + return Object.values(coverageByPrefix).map((obj) => { const linePct = this.computePercentage(obj.linesOfCodeTested, obj.linesOfCodeUntested); const branchPct = this.computePercentage(obj.branchesTested, obj.branchesUntested); @@ -430,11 +429,9 @@ export default { percentToProgressBarColorClass(pct) { if (pct >= this.coveragePercentCutoff) { return 'tw-progress-success'; - } - else if (pct >= 0.7 * this.coveragePercentCutoff) { + } else if (pct >= 0.7 * this.coveragePercentCutoff) { return 'tw-progress-warning'; - } - else { + } else { return 'tw-progress-error'; } }, diff --git a/resources/js/vue/components/BuildDynamicAnalysisIdPage.vue b/resources/js/vue/components/BuildDynamicAnalysisIdPage.vue index 7d89777fe2..c8e1438309 100644 --- a/resources/js/vue/components/BuildDynamicAnalysisIdPage.vue +++ b/resources/js/vue/components/BuildDynamicAnalysisIdPage.vue @@ -40,7 +40,7 @@ import CodeBox from './shared/CodeBox.vue'; export default { name: 'BuildDynamicAnalysisIdPage', - components: {CodeBox, LoadingIndicator, BuildSummaryCard, BuildSidebar}, + components: { CodeBox, LoadingIndicator, BuildSummaryCard, BuildSidebar }, props: { buildId: { @@ -89,27 +89,27 @@ export default { status() { switch (this.dynamicAnalysis.status) { - case 'passed': - return 'Passed'; - case 'notrun': - return 'Not Run'; - case 'failed': - return 'Failed'; - default: - return this.dynamicAnalysis.status; + case 'passed': + return 'Passed'; + case 'notrun': + return 'Not Run'; + case 'failed': + return 'Failed'; + default: + return this.dynamicAnalysis.status; } }, statusColor() { switch (this.dynamicAnalysis.status) { - case 'passed': - return 'tw-bg-green-400'; - case 'notrun': - return 'tw-bg-orange-400'; - case 'failed': - return 'tw-bg-red-400'; - default: - return this.dynamicAnalysis.status; + case 'passed': + return 'tw-bg-green-400'; + case 'notrun': + return 'tw-bg-orange-400'; + case 'failed': + return 'tw-bg-red-400'; + default: + return this.dynamicAnalysis.status; } }, }, diff --git a/resources/js/vue/components/BuildFilesPage.vue b/resources/js/vue/components/BuildFilesPage.vue index e093b9845f..4e12886d04 100644 --- a/resources/js/vue/components/BuildFilesPage.vue +++ b/resources/js/vue/components/BuildFilesPage.vue @@ -75,7 +75,7 @@ import gql from 'graphql-tag'; export default { name: 'BuildFilesPage', - components: {LoadingIndicator, DataTable, BuildSummaryCard, BuildSidebar}, + components: { LoadingIndicator, DataTable, BuildSummaryCard, BuildSidebar }, props: { buildId: { @@ -107,13 +107,13 @@ export default { } } `, - update: data => data?.build?.urls, + update: (data) => data?.build?.urls, variables() { return { buildId: this.buildId, }; }, - result({data}) { + result({ data }) { if (data && data.build.urls.pageInfo.hasNextPage) { this.$apollo.queries.urls.fetchMore({ variables: { @@ -149,13 +149,13 @@ export default { } } `, - update: data => data?.build?.files, + update: (data) => data?.build?.files, variables() { return { buildId: this.buildId, }; }, - result({data}) { + result({ data }) { if (data && data.build.files.pageInfo.hasNextPage) { this.$apollo.queries.files.fetchMore({ variables: { @@ -170,7 +170,7 @@ export default { computed: { formattedUrlRows() { - return this.urls.edges?.map(edge => { + return this.urls.edges?.map((edge) => { return { url: { value: edge.node.href, @@ -182,7 +182,7 @@ export default { }, formattedFileRows() { - return this.files.edges?.map(edge => { + return this.files.edges?.map((edge) => { return { name: { value: edge.node.name, @@ -206,17 +206,13 @@ export default { humanReadableFileSize(bytes) { if (bytes < 1024) { return `${bytes} bytes`; - } - else if (bytes < 1024 * 1024) { + } else if (bytes < 1024 * 1024) { return `${(bytes / 1024).toFixed(2)} KiB`; - } - else if (bytes < 1024 * 1024 * 1024) { + } else if (bytes < 1024 * 1024 * 1024) { return `${(bytes / (1024 * 1024)).toFixed(2)} MiB`; - } - else if (bytes < 1024 * 1024 * 1024 * 1024) { + } else if (bytes < 1024 * 1024 * 1024 * 1024) { return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GiB`; - } - else { + } else { return `${(bytes / (1024 * 1024 * 1024 * 1024)).toFixed(2)} TiB`; } }, diff --git a/resources/js/vue/components/BuildInstrumentationPage.vue b/resources/js/vue/components/BuildInstrumentationPage.vue index 77b43fb266..f609d728da 100644 --- a/resources/js/vue/components/BuildInstrumentationPage.vue +++ b/resources/js/vue/components/BuildInstrumentationPage.vue @@ -230,7 +230,7 @@ export default { if (!this.filteredCommands) { return new Set(); } - return new Set(this.filteredCommands.map(edge => edge.node.id)); + return new Set(this.filteredCommands.map((edge) => edge.node.id)); }, formattedChartCommands() { @@ -238,7 +238,7 @@ export default { return []; } - return this.allCommands?.map(edge => { + return this.allCommands?.map((edge) => { return { id: edge.node.id, startTime: DateTime.fromISO(edge.node.startTime), @@ -259,11 +259,11 @@ export default { } const memoryData = []; - this.allCommands.forEach(edge => { + this.allCommands.forEach((edge) => { const command = edge.node; if (command.measurements.edges && command.measurements.edges.length > 0) { const memoryMeasurement = command.measurements.edges.find( - m => m.node.name === 'BeforeHostMemoryUsed' || m.node.name === 'AfterHostMemoryUsed', + (m) => m.node.name === 'BeforeHostMemoryUsed' || m.node.name === 'AfterHostMemoryUsed', ); if (memoryMeasurement) { diff --git a/resources/js/vue/components/BuildNotesPage.vue b/resources/js/vue/components/BuildNotesPage.vue index f0d01c64a0..03e39a6979 100644 --- a/resources/js/vue/components/BuildNotesPage.vue +++ b/resources/js/vue/components/BuildNotesPage.vue @@ -82,7 +82,7 @@ import BuildSidebar from './shared/BuildSidebar.vue'; export default { name: 'BuildNotesPage', - components: {CodeBox, LoadingIndicator, BuildSummaryCard, BuildSidebar}, + components: { CodeBox, LoadingIndicator, BuildSummaryCard, BuildSidebar }, props: { buildId: { @@ -122,13 +122,13 @@ export default { } } `, - update: data => data?.build?.notes, + update: (data) => data?.build?.notes, variables() { return { buildId: this.buildId, }; }, - result({data}) { + result({ data }) { if (data && data.build.notes.pageInfo.hasNextPage) { this.$apollo.queries.notes.fetchMore({ variables: { diff --git a/resources/js/vue/components/BuildSummary.vue b/resources/js/vue/components/BuildSummary.vue index 8722f58530..373471eaec 100644 --- a/resources/js/vue/components/BuildSummary.vue +++ b/resources/js/vue/components/BuildSummary.vue @@ -447,7 +447,7 @@ import { faQuestionCircle, faLink, } from '@fortawesome/free-solid-svg-icons'; -import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'; +import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; import LoadingIndicator from './shared/LoadingIndicator.vue'; import BuildSummaryCard from './shared/BuildSummaryCard.vue'; import BuildSidebar from './shared/BuildSidebar.vue'; @@ -458,7 +458,7 @@ import { DateTime, Duration } from 'luxon'; export default { name: 'BuildSummary', - components: {BuildTimeChart, BuildSummaryCard, LoadingIndicator, BuildSidebar, FontAwesomeIcon}, + components: { BuildTimeChart, BuildSummaryCard, LoadingIndicator, BuildSidebar, FontAwesomeIcon }, props: { projectId: { @@ -492,7 +492,7 @@ export default { }, }, - data () { + data() { return { // API results. cdash: {}, @@ -578,8 +578,7 @@ export default { ntestfailed: Math.max(0, prev.failedTestsCount), ntestnotrun: Math.max(0, prev.notRunTestsCount), }; - } - else { + } else { this.cdash.previousbuild = null; } @@ -594,8 +593,7 @@ export default { ntestfailed: Math.max(0, next.failedTestsCount), ntestnotrun: Math.max(0, next.notRunTestsCount), }; - } - else { + } else { this.cdash.nextbuild = null; } @@ -659,7 +657,7 @@ export default { } } `, - update: data => data?.project?.builds.edges, + update: (data) => data?.project?.builds.edges, variables() { return { projectId: this.projectId, @@ -710,7 +708,7 @@ export default { if (!this.buildHistory) { return []; } - return [...this.buildHistory].reverse().map(edge => { + return [...this.buildHistory].reverse().map((edge) => { const build = edge.node; return { buildId: build.id, diff --git a/resources/js/vue/components/BuildSummaryPage/BuildTimeChart.vue b/resources/js/vue/components/BuildSummaryPage/BuildTimeChart.vue index 7689467ed4..acb9eb04f8 100644 --- a/resources/js/vue/components/BuildSummaryPage/BuildTimeChart.vue +++ b/resources/js/vue/components/BuildSummaryPage/BuildTimeChart.vue @@ -99,7 +99,7 @@ export default { ...baseOption, xAxis: { type: 'category', - data: this.data.map(d => d.buildId), + data: this.data.map((d) => d.buildId), axisLabel: { show: false, }, @@ -109,21 +109,21 @@ export default { name: 'Configure', type: 'bar', stack: 'total', - data: this.data.map(d => d.configureTime.toMillis()), + data: this.data.map((d) => d.configureTime.toMillis()), color: '#bce784', }, { name: 'Build', type: 'bar', stack: 'total', - data: this.data.map(d => d.buildTime.toMillis()), + data: this.data.map((d) => d.buildTime.toMillis()), color: '#5dd39e', }, { name: 'Test', type: 'bar', stack: 'total', - data: this.data.map(d => d.testTime.toMillis()), + data: this.data.map((d) => d.testTime.toMillis()), color: '#348aa7', markArea: { silent: true, diff --git a/resources/js/vue/components/BuildTargetsPage.vue b/resources/js/vue/components/BuildTargetsPage.vue index 1f076d9aca..5bd0ea11e4 100644 --- a/resources/js/vue/components/BuildTargetsPage.vue +++ b/resources/js/vue/components/BuildTargetsPage.vue @@ -131,11 +131,11 @@ export default { } } `, - update: data => { + update: (data) => { let targets = data?.build?.targets?.edges || []; if (data?.build?.children) { - data.build.children.edges.forEach(childEdge => { + data.build.children.edges.forEach((childEdge) => { targets = targets.concat(childEdge?.node?.targets?.edges || []); }); } @@ -214,7 +214,7 @@ export default { }, formattedTargetRows() { - return this.targets.edges?.map(edge => { + return this.targets.edges?.map((edge) => { return { name: { value: edge.node.name, @@ -236,7 +236,7 @@ export default { if (!this.targets || !this.targets.edges) { return new Set(); } - return new Set(this.targets.edges.map(edge => edge.node.id)); + return new Set(this.targets.edges.map((edge) => edge.node.id)); }, formattedCommands() { @@ -248,7 +248,7 @@ export default { const visibleIds = this.visibleTargetIds; - return commands?.map(edge => { + return commands?.map((edge) => { const targetId = edge.node.target?.id; return { id: edge.node.id, @@ -268,22 +268,22 @@ export default { methods: { humanReadableTargetType(type) { switch (type) { - case 'UNKNOWN': - return 'Unknown'; - case 'STATIC_LIBRARY': - return 'Static Library'; - case 'MODULE_LIBRARY': - return 'Module Library'; - case 'SHARED_LIBRARY': - return 'Shared Library'; - case 'OBJECT_LIBRARY': - return 'Object Library'; - case 'INTERFACE_LIBRARY': - return 'Interface Library'; - case 'EXECUTABLE': - return 'Executable'; - default: - return type; + case 'UNKNOWN': + return 'Unknown'; + case 'STATIC_LIBRARY': + return 'Static Library'; + case 'MODULE_LIBRARY': + return 'Module Library'; + case 'SHARED_LIBRARY': + return 'Shared Library'; + case 'OBJECT_LIBRARY': + return 'Object Library'; + case 'INTERFACE_LIBRARY': + return 'Interface Library'; + case 'EXECUTABLE': + return 'Executable'; + default: + return type; } }, }, diff --git a/resources/js/vue/components/BuildTestsPage.vue b/resources/js/vue/components/BuildTestsPage.vue index 3140fdc1bf..788c83b846 100644 --- a/resources/js/vue/components/BuildTestsPage.vue +++ b/resources/js/vue/components/BuildTestsPage.vue @@ -72,7 +72,7 @@ import FilterBuilder from './shared/FilterBuilder.vue'; import LoadingIndicator from './shared/LoadingIndicator.vue'; import BuildSummaryCard from './shared/BuildSummaryCard.vue'; import BuildSidebar from './shared/BuildSidebar.vue'; -import {DateTime} from 'luxon'; +import { DateTime } from 'luxon'; const TEST_QUERY = gql` query( @@ -276,12 +276,12 @@ export default { return []; } - const previousTestsMap = new Map(this.previousTests.map(test => [ + const previousTestsMap = new Map(this.previousTests.map((test) => [ `${test.subProject}:${test.node.name}`, test.node.status, ])); - return this.tests.filter(test => { + return this.tests.filter((test) => { const key = `${test.subProject}:${test.node.name}`; const previousStatus = previousTestsMap.get(key); return previousStatus !== test.node.status; @@ -308,7 +308,7 @@ export default { }, formattedTestRows() { - return this.filteredTests?.map(edge => { + return this.filteredTests?.map((edge) => { return { name: { value: edge.node.name, @@ -351,27 +351,27 @@ export default { methods: { testStatusToColorClass(status) { switch (status) { - case 'PASSED': - return 'normal'; - case 'FAILED': - return 'error'; - case 'NOT_RUN': - return 'warning'; - default: - return ''; + case 'PASSED': + return 'normal'; + case 'FAILED': + return 'error'; + case 'NOT_RUN': + return 'warning'; + default: + return ''; } }, humanReadableTestStatus(status) { switch (status) { - case 'PASSED': - return 'Passed'; - case 'FAILED': - return 'Failed'; - case 'NOT_RUN': - return 'Not Run'; - default: - return status; + case 'PASSED': + return 'Passed'; + case 'FAILED': + return 'Failed'; + case 'NOT_RUN': + return 'Not Run'; + default: + return status; } }, }, diff --git a/resources/js/vue/components/BuildUpdate/CommitCard.vue b/resources/js/vue/components/BuildUpdate/CommitCard.vue index 1a2f783efe..8d705e8e8f 100644 --- a/resources/js/vue/components/BuildUpdate/CommitCard.vue +++ b/resources/js/vue/components/BuildUpdate/CommitCard.vue @@ -39,13 +39,13 @@