diff --git a/.gitlab/ci/static-analysis.gitlab-ci.yml b/.gitlab/ci/static-analysis.gitlab-ci.yml index 17dc2a55e4eb4fa0a90d93c6797bb36930014f0e..6fa7de26c74f2f8f6d152c8a816c0c0ac3273594 100644 --- a/.gitlab/ci/static-analysis.gitlab-ci.yml +++ b/.gitlab/ci/static-analysis.gitlab-ci.yml @@ -71,9 +71,13 @@ eslint: needs: ['generate-apollo-graphql-schema'] variables: USE_BUNDLE_INSTALL: "false" + ESLINT_CODE_QUALITY_REPORT: "gl-code-quality-report.json" script: - yarn_install_script - - run_timed_command "yarn run lint:eslint:all" + - run_timed_command "yarn run lint:eslint:all --format gitlab" + artifacts: + reports: + codequality: gl-code-quality-report.json eslint-docs: extends: diff --git a/app/assets/javascripts/diff.js b/app/assets/javascripts/diff.js index 0c31443e5f7d0bb4bce8f5333e063b24b18bffbe..c5d79368c5db3625afbf405985bb9fbb2f4c4116 100644 --- a/app/assets/javascripts/diff.js +++ b/app/assets/javascripts/diff.js @@ -154,7 +154,6 @@ export default class Diff { } } - // eslint-disable-next-line class-methods-use-this lineNumbers(line) { const children = line.find('.diff-line-num').toArray(); if (children.length !== 2) { diff --git a/eslint.config.mjs b/eslint.config.mjs index 8b2a368cb6874e9e5eb8532e37b4d6970fb67156..5d4d6b47a4e45967a7475f6b1f0c2f0e9a3021cd 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -127,7 +127,7 @@ export default [ rules: { 'import/no-commonjs': 'error', - 'import/no-default-export': 'off', + // 'import/no-default-export': 'off', 'no-underscore-dangle': [ 'error', @@ -147,7 +147,7 @@ export default [ 'no-jquery/no-animate-toggle': 'off', 'no-jquery/no-event-shorthand': 'off', 'no-jquery/no-serialize': 'error', - 'promise/always-return': 'off', + // 'promise/always-return': 'off', 'promise/no-callback-in-promise': 'off', '@gitlab/no-global-event-off': 'error', @@ -168,8 +168,8 @@ export default [ 'error', { props: true, - ignorePropertyModificationsFor: ['acc', 'accumulator', 'el', 'element', 'state'], - ignorePropertyModificationsForRegex: ['^draft'], + ignorePropertyModificationsFor: ['accumulator', 'el', 'element', 'state'], + // ignorePropertyModificationsForRegex: ['^draft'], }, ], @@ -408,8 +408,8 @@ export default [ '@gitlab/no-max-width-media-queries': 'off', '@gitlab/vue-tailwind-no-max-width-media-queries': 'off', 'require-await': 'error', - 'import/no-dynamic-require': 'off', - 'no-import-assign': 'off', + // 'import/no-dynamic-require': 'off', + // 'no-import-assign': 'off', 'no-restricted-syntax': [ 'error', diff --git a/jest.config.js b/jest.config.js index acfaee14fbfc59bb726d867cca5206baad95cf93..5043b607b2042f2c761a5d946fd2d66485f1df95 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,7 +5,6 @@ const baseConfig = require('./jest.config.base'); // TODO: Remove existsSync once jh has added jest.config.js if (IS_JH && fs.existsSync('./jh/jest.config.js')) { // We can't be explicit with eslint-disable rules because in JH it'll pass import/no-unresolved - // eslint-disable-next-line module.exports = require('./jh/jest.config'); } else { module.exports = { diff --git a/package.json b/package.json index 420b9a674c09495237489293a437f8d9aa669dc7..ee3658be23b9d87a93196450ea7998a622292b7e 100644 --- a/package.json +++ b/package.json @@ -282,6 +282,7 @@ "crypto": "^1.0.1", "custom-jquery-matchers": "^2.1.0", "eslint": "9.14.0", + "eslint-formatter-gitlab": "^5.1.0", "eslint-import-resolver-jest": "3.0.2", "eslint-import-resolver-webpack": "0.13.9", "eslint-plugin-import": "^2.31.0", diff --git a/yarn.lock b/yarn.lock index 3946d6b278ba96fc43552f555e963587fde482d9..f95da9e6cc87aad2cedf50a812434ed44578f423 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7242,6 +7242,14 @@ eslint-config-prettier@^9.1.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f" integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw== +eslint-formatter-gitlab@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/eslint-formatter-gitlab/-/eslint-formatter-gitlab-5.1.0.tgz#33162a17eefba5a44a257af568511d360212e866" + integrity sha512-IxhrjLYzDlbFgPWEnvZlWLwPjMeyymbyo0hDHWntZ3DSAP9AP9huj15KbU+BK3OqeO3OHhbFEh2TA6sR0KZhkA== + dependencies: + chalk "^4.0.0" + yaml "^2.0.0" + eslint-import-resolver-jest@3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/eslint-import-resolver-jest/-/eslint-import-resolver-jest-3.0.2.tgz#b20150f574576b6bd0d432a7ff08b0067141b33e"