Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
685450b
Install `@stylistic/eslint-plugin`
williamjallen Jul 23, 2026
acf0c81
Update config to use stylistic rules
williamjallen Jul 23, 2026
c1fc218
Group rules by plugin
williamjallen Jul 23, 2026
927f1c9
Remove unnecessary single-valued arrays
williamjallen Jul 23, 2026
05455b6
Drop stroustrup brace style
williamjallen Jul 23, 2026
2915194
Apply rules
williamjallen Jul 23, 2026
b7b0ab9
Drop confusing switch-case formatting
williamjallen Jul 23, 2026
75edf28
Apply rules
williamjallen Jul 23, 2026
97539c1
Add `array-bracket-newline` rule
williamjallen Jul 23, 2026
38a6222
Add `array-bracket-spacing` rule
williamjallen Jul 23, 2026
e447e15
Add `array-element-newline` rule
williamjallen Jul 23, 2026
299f558
Add `arrow-parens` rule
williamjallen Jul 23, 2026
f48c64c
Apply `arrow-parens` rule
williamjallen Jul 23, 2026
52c1a2e
Reorder `arrow-spacing`
williamjallen Jul 23, 2026
fabd138
Reorder `block-spacing`
williamjallen Jul 23, 2026
a18afb1
Remove redundant option specification for defaults
williamjallen Jul 23, 2026
76b1de0
Reorder `brace-style`
williamjallen Jul 23, 2026
9b73ab2
Reorder `indent`
williamjallen Jul 23, 2026
a80f317
Add `comma-spacing` rule
williamjallen Jul 23, 2026
f06ac4d
Apply `comma-spacing` rule
williamjallen Jul 23, 2026
3e48d50
Add `comma-style` rule
williamjallen Jul 23, 2026
74ecd17
Add `computed-property-spacing` rule
williamjallen Jul 23, 2026
516fae8
Add `curly-newline` rule
williamjallen Jul 23, 2026
10c5a07
Add `dot-location` rule
williamjallen Jul 23, 2026
3c4be93
Add `function-call-argument-newline` rule
williamjallen Jul 23, 2026
08b603e
Add `function-call-spacing` rule
williamjallen Jul 23, 2026
6084078
Add `function-paren-newline` rule
williamjallen Jul 23, 2026
ec7bd2f
Add `generator-star-spacing` rule
williamjallen Jul 23, 2026
f8f200c
Add `implicit-arrow-linebreak` rule
williamjallen Jul 23, 2026
79191c5
Reorder `indent`
williamjallen Jul 23, 2026
dab9894
Add `indent-binary-ops` rule
williamjallen Jul 23, 2026
d298307
Add `key-spacing` rule
williamjallen Jul 23, 2026
434bef4
Apply `key-spacing` rule
williamjallen Jul 23, 2026
a82764f
Drop redundant defaults for `keyword-spacing`
williamjallen Jul 23, 2026
fdc27fe
Add `lines-between-class-members` rule
williamjallen Jul 23, 2026
c0453b7
Apply `lines-between-class-members` rule
williamjallen Jul 23, 2026
f680de9
Add `max-statements-per-line` rule
williamjallen Jul 23, 2026
dd0cdd8
Add `member-delimiter-style` rule
williamjallen Jul 23, 2026
caea1a4
Add `new-parens` rule
williamjallen Jul 23, 2026
a7396aa
Apply `new-parens` rule
williamjallen Jul 23, 2026
99e3ff0
Add `no-extra-semi` rule
williamjallen Jul 23, 2026
adebdc5
Add `no-floating-decimal` rule
williamjallen Jul 23, 2026
de8497e
Add `no-mixed-operators` rule
williamjallen Jul 23, 2026
6366a33
Apply `no-mixed-operators` rule
williamjallen Jul 23, 2026
7d99143
Add `no-multi-spaces` rule
williamjallen Jul 23, 2026
1519f22
Apply `no-multi-spaces` rule
williamjallen Jul 23, 2026
a84649e
Add `no-multiple-empty-lines` rule
williamjallen Jul 23, 2026
59e160c
Add `no-tabs` rule
williamjallen Jul 23, 2026
719b6d7
Reorder `no-trailing-spaces`
williamjallen Jul 23, 2026
a31eaec
Add `no-whitespace-before-property` rule
williamjallen Jul 23, 2026
90c37ec
Add `object-curly-newline` rule
williamjallen Jul 23, 2026
61af5dd
Apply `object-curly-newline` rule
williamjallen Jul 23, 2026
15d5331
Add `object-curly-spacing` rule
williamjallen Jul 23, 2026
d21bf5a
Apply `object-curly-spacing` rule
williamjallen Jul 23, 2026
96c93b0
Add `object-property-newline` rule
williamjallen Jul 23, 2026
8b6500d
Apply `object-property-newline` rule
williamjallen Jul 23, 2026
91e8eb0
Add `one-var-declaration-per-line` rule
williamjallen Jul 23, 2026
a0fe67d
Add `operator-linebreak` rule
williamjallen Jul 23, 2026
ac4128b
Add `padded-blocks` rule
williamjallen Jul 24, 2026
9ee64e0
Apply `padded-blocks` rule
williamjallen Jul 24, 2026
d7230e1
Add `quote-props` rule
williamjallen Jul 24, 2026
5204172
Apply `quote-props` rule
williamjallen Jul 24, 2026
a9979ff
Reconfigure `avoidEscape` rule
williamjallen Jul 24, 2026
7fd5b88
Add `rest-spread-spacing` rule
williamjallen Jul 24, 2026
73c85b1
Reorder `semi` rule
williamjallen Jul 24, 2026
1bd4cf9
Add `semi-spacing` rule
williamjallen Jul 24, 2026
5a755f7
Relocate `semi-style` rule
williamjallen Jul 24, 2026
980eb94
Remove redundant default for `space-before-blocks`
williamjallen Jul 24, 2026
29df80c
Add `space-before-function-paren` rule
williamjallen Jul 24, 2026
56996f7
Apply `space-before-function-paren` rule
williamjallen Jul 24, 2026
1111f8d
Add `space-in-parens` rule
williamjallen Jul 24, 2026
32a3668
Add `space-infix-ops` rule
williamjallen Jul 24, 2026
a899da1
Apply `space-infix-ops` rule
williamjallen Jul 24, 2026
f287594
Add `space-unary-ops` rule
williamjallen Jul 24, 2026
8b27982
Add `spaced-comment` rule
williamjallen Jul 24, 2026
4e9a153
Apply `spaced-comment` rule
williamjallen Jul 24, 2026
6872791
Add `switch-colon-spacing` rule
williamjallen Jul 24, 2026
0fd8fb8
Relocate `template-curly-spacing`
williamjallen Jul 24, 2026
3422ce3
Add `template-tag-spacing` rule
williamjallen Jul 24, 2026
8ecc909
Add `type-annotation-spacing` rule
williamjallen Jul 24, 2026
2543925
Add `type-generic-spacing` rule
williamjallen Jul 24, 2026
c9ee153
Add `type-named-tuple-spacing` rule
williamjallen Jul 24, 2026
d00e57d
Add `wrap-regex` rule
williamjallen Jul 24, 2026
64d2183
Add `yield-star-spacing` rule
williamjallen Jul 24, 2026
e59ff6f
Relocate `linebreak-style`
williamjallen Jul 24, 2026
c504c56
Apply style rules to eslint config file
williamjallen Jul 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 80 additions & 21 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand All @@ -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',
Expand Down Expand Up @@ -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'],
},
},
{
Expand Down
66 changes: 66 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions resources/js/vue/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
6 changes: 3 additions & 3 deletions resources/js/vue/components/BuildBuildPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions resources/js/vue/components/BuildBuildPage/BuildErrorItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
8 changes: 3 additions & 5 deletions resources/js/vue/components/BuildBuildPage/BuildErrorList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const BUILD_QUERY = gql`

export default {
name: 'BuildErrorList',
components: {BuildErrorItem, LoadingIndicator},
components: { BuildErrorItem, LoadingIndicator },

props: {
buildId: {
Expand Down Expand Up @@ -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.';
}
},
Expand Down
4 changes: 2 additions & 2 deletions resources/js/vue/components/BuildCommentsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export default {
}
}
`,
update: data => data?.build?.comments?.edges,
update: (data) => data?.build?.comments?.edges,
variables() {
return {
buildId: this.buildId,
Expand Down Expand Up @@ -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.');
Expand Down
6 changes: 3 additions & 3 deletions resources/js/vue/components/BuildConfigure.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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,
Expand Down
21 changes: 9 additions & 12 deletions resources/js/vue/components/BuildCoveragePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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);
Expand All @@ -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: {
Expand All @@ -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);

Expand Down Expand Up @@ -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';
}
},
Expand Down
Loading